Finance Operations
Decide whether an invoice needs a reminder
Separate invoices needing operator attention from those that should stay out of a reminder queue. The workflow checks invoice state, outstanding balance, due date and an explicit hold flag.
Experimental native example · local preview · revision 1
WORKFLOW PREVIEW
See how it works
Use + and − to zoom, F to fit. Press Enter on a node to inspect it.
Private preview. These tested drafts are available for inspection. Adding them to a Vora workspace is still being tested.
What you need
- Current invoice facts from the responsible finance system or an authorized manual record.
- A YYYY-MM-DD observation date and a confirmed reminderHold flag.
Follow the workflow step by step
Supplied agency data
Receive the explicitly supplied manual input packet.
Decide whether an invoice needs a reminder
Return reminder eligibility and reason codes from supplied invoice facts. No email, payment collection or ledger update occurs.
Setup and review
- Supply invoice state open, draft, paid, void or uncollectible.
- Test an overdue open invoice, one due today, a paid invoice and a held invoice.
- Inspect eligible and reasons. Before connecting any reminder sender, re-read the invoice from its provider and apply an authorized delivery policy.
Inspect every node
Expand a node to inspect its complete settings. Review the runtime and adoption evidence before installing it.
Supplied agency data · wfManualTrigger
{
"label": "Supplied agency data"
}Decide whether an invoice needs a reminder · code
{
"label": "Decide whether an invoice needs a reminder",
"code": "\nfunction obj(value, keys, required = keys) {\n if (!value || typeof value !== 'object' || Array.isArray(value)) throw new Error('Expected object');\n if (Object.keys(value).some(key => !keys.includes(key))) throw new Error('Unknown input field');\n if (required.some(key => !Object.hasOwn(value, key))) throw new Error('Missing required input field');\n return value;\n}\nfunction text(value, name, max = 200, allowEmpty = false) {\n if (typeof value !== 'string' || value.length > max || (!allowEmpty && !value.trim())) throw new Error('Invalid ' + name);\n return value.trim();\n}\nfunction list(value, name, max = 500) {\n if (!Array.isArray(value) || value.length > max) throw new Error('Invalid ' + name);\n return value;\n}\nfunction int(value, name, min = 0, max = Number.MAX_SAFE_INTEGER) {\n if (!Number.isSafeInteger(value) || value < min || value > max) throw new Error('Invalid ' + name);\n return value;\n}\nfunction amount(value, name) {\n if (!Number.isFinite(value) || value < 0 || value > 1000000000) throw new Error('Invalid ' + name);\n return value;\n}\nfunction email(value) { return /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value); }\nfunction day(value) {\n if (typeof value !== 'string' || !/^\\d{4}-\\d{2}-\\d{2}$/.test(value)) throw new Error('Invalid calendar date');\n const ms = Date.parse(value + 'T00:00:00Z');\n if (!Number.isFinite(ms) || new Date(ms).toISOString().slice(0, 10) !== value) throw new Error('Invalid calendar date');\n return ms;\n}\nfunction instant(value) {\n if (typeof value !== 'string' || !/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?Z$/.test(value)) throw new Error('Invalid UTC timestamp');\n const ms = Date.parse(value);\n const normalized = value.includes('.') ? value : value.replace('Z', '.000Z');\n if (!Number.isFinite(ms) || new Date(ms).toISOString() !== normalized) throw new Error('Invalid UTC timestamp');\n return ms;\n}\nfunction uniqueIds(items) {\n const ids = items.map(item => text(item.id, 'item ID', 120));\n if (new Set(ids).size !== ids.length) throw new Error('Duplicate item ID');\n return ids;\n}\nfunction ratioBps(numerator, denominator) {\n const n = BigInt(numerator) * 10000n;\n const d = BigInt(denominator);\n const quotient = n / d;\n const floor = n < 0n && n % d !== 0n ? quotient - 1n : quotient;\n const result = Number(floor);\n if (!Number.isSafeInteger(result)) throw new Error('Unsafe calculated ratio');\n return result;\n}\n\n\nconst x = obj(context.input, ['invoiceId','state','dueDate','asOf','outstandingMinor','reminderHold']);\nconst invoiceId = text(x.invoiceId, 'invoice ID', 120);\nif (!['open','draft','paid','void','uncollectible'].includes(x.state)) throw new Error('Invalid invoice state');\nif (typeof x.reminderHold !== 'boolean') throw new Error('Missing reminder hold flag');\nint(x.outstandingMinor, 'outstanding minor units');\nconst due = day(x.dueDate), observed = day(x.asOf);\nconst daysOverdue = Math.max(0, Math.floor((observed - due) / 86400000));\nconst reasons = [];\nif (x.state !== 'open') reasons.push('not_open');\nif (x.outstandingMinor === 0) reasons.push('no_balance');\nif (observed <= due) reasons.push('not_overdue');\nif (x.reminderHold) reasons.push('reminder_hold');\nreturn {invoiceId, eligible:reasons.length === 0, daysOverdue, reasons};\n",
"outputVar": "result",
"timeout": 1000,
"memoryLimit": 16
}Input and output contracts
Input
{
"type": "object",
"properties": {
"invoiceId": {
"type": "string",
"maxLength": 120
},
"state": {
"type": "string",
"maxLength": 20
},
"dueDate": {
"type": "string",
"maxLength": 10
},
"asOf": {
"type": "string",
"maxLength": 10
},
"outstandingMinor": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"reminderHold": {
"type": "boolean"
}
},
"required": [
"invoiceId",
"state",
"dueDate",
"asOf",
"outstandingMinor",
"reminderHold"
],
"additionalProperties": false
}Output
{
"type": "object",
"properties": {
"invoiceId": {
"type": "string",
"maxLength": 120
},
"eligible": {
"type": "boolean"
},
"daysOverdue": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"reasons": {
"type": "array",
"items": {
"type": "string",
"maxLength": 200
},
"maxItems": 4
}
},
"required": [
"invoiceId",
"eligible",
"daysOverdue",
"reasons"
],
"additionalProperties": false
}Choose an output for this job
This business workflow also has 15 delivery formats. Compare their inputs, output examples and limits.
Example input and result
These examples use synthetic data.
Input
{
"invoiceId": "inv-01",
"state": "open",
"dueDate": "2026-10-05",
"asOf": "2026-10-07",
"outstandingMinor": 12000,
"reminderHold": false
}Expected result
{
"invoiceId": "inv-01",
"eligible": true,
"daysOverdue": 2,
"reasons": []
}Success means: Return reminder eligibility and reason codes from supplied invoice facts. No email, payment collection or ledger update occurs.
When something goes wrong
- Invalid dates or a missing hold flag stop the decision. Correct the record and repeat. Ineligible output preserves all applicable reasons, so paid or held invoices remain excluded even when overdue.
Limits and costs
- Dates are compared as UTC calendar days. Eligibility does not prove a provider balance is current, send a payment request, collect money or update accounting records.
- No paid model calls or metered third-party operations are declared in this pure graph. Vora plan availability, compute and quotas still apply; pricing has not been verified by this batch.