Send staged invoice payment reminders with Microsoft SQL and Gmail
Ready for 3.0What this workflow does
This workflow has 42 nodes and runs on a schedule (every day at 09:00). Along the way it connects Microsoft SQL and Gmail.
How it runs
Trigger: On a schedule (every day at 09:00).
- Fetch Unpaid Invoices (Microsoft SQL): run a query
- Has Unpaid Invoices? (If): checks a condition and branches into true / false
- Process Each Invoice (Loop Over Items (Split in Batches)): loops over the items in batches
- No Invoices to Process (Edit Fields (Set)): sets 1 field: message
- Merge: merges the data from its input branches
- Calculate Days Until Due (Date & Time): formats or calculates dates
- Aggregate: combines items into one
- Route to Reminder Stage (Switch): routes items into 6 branches
- Generate Summary Report (Edit Fields (Set)): sets 3 fields: totalProcessed, reportDate, subject
- Already Sent 7 Before? (If): checks a condition and branches into true / false
…plus 31 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.
Nodes used (11)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Microsoft SQL
n8n-nodes-base.microsoftSql - If
n8n-nodes-base.if - Merge
n8n-nodes-base.merge - Date & Time
n8n-nodes-base.dateTime - Switch
n8n-nodes-base.switch - Edit Fields (Set)
n8n-nodes-base.set - Gmail
n8n-nodes-base.gmail - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Aggregate
n8n-nodes-base.aggregate - HTML
n8n-nodes-base.html
From the author
Quick Overview This workflow runs daily at 9 AM to pull unpaid invoices from Microsoft SQL, send staged payment reminder emails via Gmail based on due date timing, update invoice status and an audit log in the database, and email an HTML summary report to the…