
Invoice OverdueInvoiceTrigger
CertifiedTrigger a flow when QuickBooks invoices become overdue
Invoice OverdueInvoiceTrigger
Trigger a flow when QuickBooks invoices become overdue
Polls the QuickBooks query API for invoices matching Balance > '0' AND DueDate < '<today>' (today in UTC) and starts an execution for the ones not reported yet. An invoice is reported once while it stays overdue and is not reported again on later polls.
A polling trigger starts at most one execution per evaluation. With BATCH that execution holds every new overdue invoice. With PER_INVOICE it holds the oldest not yet reported one, and the next ones follow on the next evaluations, so use a short interval when many invoices can become overdue at once.
The reported invoice ids are stored in the namespace KV store, only after the execution has been built, and are dropped once the invoice is no longer overdue. All overdue invoices are loaded in memory on every poll.
type: io.kestra.plugin.quickbooks.invoices.OverdueInvoiceTriggerExamples
Send one daily batch of newly overdue invoices
id: qbo_overdue_invoices
namespace: company.finance
triggers:
- id: overdue
type: io.kestra.plugin.quickbooks.invoices.OverdueInvoiceTrigger
clientId: "{{ secret('QBO_CLIENT_ID') }}"
clientSecret: "{{ secret('QBO_CLIENT_SECRET') }}"
refreshToken: "{{ secret('QBO_REFRESH_TOKEN') }}"
realmId: "{{ secret('QBO_REALM_ID') }}"
mode: BATCH
interval: P1D
tasks:
- id: log
type: io.kestra.plugin.core.log.Log
message: "{{ trigger.count }} invoice(s) overdue, up to {{ trigger.daysOverdue }} day(s)"
Start one execution per overdue invoice, checking every hour
id: qbo_overdue_invoice_reminder
namespace: company.finance
triggers:
- id: overdue
type: io.kestra.plugin.quickbooks.invoices.OverdueInvoiceTrigger
clientId: "{{ secret('QBO_CLIENT_ID') }}"
clientSecret: "{{ secret('QBO_CLIENT_SECRET') }}"
refreshToken: "{{ secret('QBO_REFRESH_TOKEN') }}"
realmId: "{{ secret('QBO_REALM_ID') }}"
mode: PER_INVOICE
interval: PT1H
tasks:
- id: log
type: io.kestra.plugin.core.log.Log
message: "Invoice {{ trigger.invoices[0].DocNumber }} is {{ trigger.daysOverdue }} day(s) overdue"
Properties
clientId *string
QuickBooks Client ID
clientSecret *string
QuickBooks Client Secret
realmId *string
QuickBooks Realm ID
refreshToken *string
QuickBooks Refresh Token
allowConcurrent boolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
authUrl string
https://oauth.platform.intuit.com/oauth2/v1/tokens/bearerOAuth Token URL
The OAuth2 token endpoint. Must be an intuit.com domain.
baseUrl string
https://quickbooks.api.intuit.comBase URL
The Base URL for QuickBooks API. Must be an intuit.com domain. Defaults to production.
interval string
P1DdurationPolling interval
How often the trigger should look for overdue invoices.
minorVersion integerstring
75Minor Version
The minor version of the QuickBooks API to use. Must be 1 or more, checked after rendering.
mode string
BATCHBATCHPER_INVOICEExecution mode
BATCH: one execution with all newly overdue invoices ininvoices.PER_INVOICE: one execution per invoice,invoicesholds a single invoice. Executions are created one per evaluation, oldest due date first.
stopAfter array
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDList of execution states after which a trigger should be stopped (a.k.a. disabled).
when string
trueA condition that determines whether the trigger should run.
A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.
Outputs
count *integer
Count
The number of invoices in invoices.
daysOverdue *integer
Days overdue
The number of days past due date, for the most overdue invoice of invoices (UTC, never negative).
invoices *array
Invoices
The overdue invoices of this execution, oldest due date first, as returned by QuickBooks.