Send idempotent invoices and payment reminders with Gmail and n8n Data Tables
Ready for 3.0What this workflow does
This workflow has 71 nodes and runs when an HTTP POST request hits its webhook URL (plus 3 other triggers). Along the way it connects Gmail.
How it runs
Trigger: When an HTTP POST request hits its webhook URL (plus 3 other triggers).
- Validate Completion Token (Code): runs custom JavaScript code
- Validate Payment Token (Code): runs custom JavaScript code
- Find Invoice Sent Rows (Data table): get
- Find Escalation Invoice Rows (Data table): get
- Completion Authorized? (If): checks a condition and branches into true / false
- Payment Authorized? (If): checks a condition and branches into true / false
- Build Due Dunning Actions (Code): runs custom JavaScript code
- Build Due Escalation Actions (Code): runs custom JavaScript code
- Normalize Completion Event (Code): runs custom JavaScript code
- Respond Completion Unauthorized (Respond to Webhook): sends the response back to the webhook caller
…plus 57 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (7)
- Webhook
n8n-nodes-base.webhook - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Respond to Webhook
n8n-nodes-base.respondToWebhook - Data table
n8n-nodes-base.dataTable - Gmail
n8n-nodes-base.gmail - Schedule Trigger
n8n-nodes-base.scheduleTrigger
From the author
Quick Overview This workflow receives job completion and payment webhooks to create invoices, track status, and run an idempotent dunning process that stops immediately on payment. It stores invoice state in n8n Data Tables and sends controlled invoice,…