Automate tax deduction processing with GPT-4 receipt analysis and Gmail reporting
Ready for 3.0What this workflow does
This AI workflow has 14 nodes and runs on a schedule (every month at 09:00). Along the way it connects OpenAI Chat Model and Gmail.
How it runs
Trigger: On a schedule (every month at 09:00).
- Workflow Configuration (Edit Fields (Set)): sets 4 fields: expenseReceiptsApiUrl, revenueDataApiUrl, taxAgentEmail…
- Fetch Expense Receipts (HTTP Request): calls an HTTP API
- Fetch Revenue Data (HTTP Request): calls an HTTP API
- Check Receipt File Type (If): checks a condition and branches into true / false
- Merge: merges the data from its input branches
- Extract Receipt Data (Extract from File): extracts data from a file (pdf)
- Match Expenses to Revenue Periods (Code): runs custom JavaScript code
- Extract Deductible Categories (AI Agent): runs an AI agent, with model: OpenAI Chat Model; output parser: Structured Output Parser
- Calculate Tax Deductions (Code): runs custom JavaScript code
- Format Tax Report (Edit Fields (Set)): sets 7 fields: reportTitle, generatedDate, totalRevenue…
…plus 1 more step. See the full node list below.
Services it uses
Other OpenAI + Gmail templates (1,623)
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 - Edit Fields (Set)
n8n-nodes-base.set - HTTP Request
n8n-nodes-base.httpRequest - If
n8n-nodes-base.if - Extract from File
n8n-nodes-base.extractFromFile - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Merge
n8n-nodes-base.merge - Code
n8n-nodes-base.code - Gmail
n8n-nodes-base.gmail
From the author
How It Works This workflow automates monthly tax processing by ingesting expense receipts alongside revenue data, extracting structured deduction details using GPT-4, and accurately matching expenses to their corresponding revenue periods. It retrieves…