Follow up on overdue invoices with OpenAI, Gmail and Google Sheets
Ready for 3.0What this workflow does
This AI workflow has 22 nodes and runs on a schedule (cron 0 9 * * *). Along the way it connects Google Sheets, Gmail and OpenAI.
How it runs
Trigger: On a schedule (cron 0 9 * * *).
- Initialize Configurations (Code): runs custom JavaScript code
- Read from Invoice Sheets (Google Sheets): uses Google Sheets
- Identify Eligibility Stage (Code): runs custom JavaScript code
- Loop Through Invoices (Loop Over Items (Split in Batches)): loops over the items in batches
- Retrieve Gmail History (Gmail): get many
- Construct Email Context (Code): runs custom JavaScript code
- Check Stage Sent Already (If): checks a condition and branches into true / false
- Reconcile Sent Invoices (Code): runs custom JavaScript code
- Check Recent Conversation (If): checks a condition and branches into true / false
- Update Invoice in Sheets (Google Sheets): update
…plus 10 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 (8)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Code
n8n-nodes-base.code - Google Sheets
n8n-nodes-base.googleSheets - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Gmail
n8n-nodes-base.gmail - If
n8n-nodes-base.if - OpenAI
@n8n/n8n-nodes-langchain.openAi - No Operation, do nothing
n8n-nodes-base.noOp
From the author
Quick overview This workflow runs daily and reads an invoices Google Sheet, checks recent Gmail threads for each overdue invoice, and uses OpenAI to classify correspondence before sending a stage-based follow-up email via Gmail or deferring/flagging for human…