Reconcile expenses and optimize tax deductions with OpenAI GPT‑4.1‑mini and Gmail
Ready for 3.0What this workflow does
This AI workflow has 18 nodes and runs on a schedule (every day at 09:00). Along the way it connects OpenAI Chat Model and Gmail.
How it runs
Trigger: On a schedule (every day at 09:00).
- Workflow Configuration (Edit Fields (Set)): sets 3 fields: receiptsApiUrl, revenueApiUrl, taxAgentEmail
- Fetch Expense Receipts (HTTP Request): calls an HTTP API
- Fetch Revenue Data (HTTP Request): calls an HTTP API
- Extract Receipt Data (Extract from File): extracts data from a file (pdf)
- Merge: merges the data from its input branches
- Receipt Matching Agent (AI Agent): runs an AI agent, with model: OpenAI Model - Receipt Matching; output parser: Structured Output - Receipt Matching
- Deduction Category Extraction Agent (AI Agent): runs an AI agent, with model: OpenAI Model - Deduction Extraction; output parser: Structured Output - Deduction Extraction
- Calculate Tax Deductions (Code): runs custom JavaScript code
- Report Generation Agent (AI Agent): runs an AI agent, with model: OpenAI Model - Report Generation; output parser: Structured Output - Report Generation
- Prepare Final Packet (Edit Fields (Set)): sets 3 fields: emailSubject, emailBody, taxAgentEmail
…plus 1 more step. 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 (10)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Edit Fields (Set)
n8n-nodes-base.set - HTTP Request
n8n-nodes-base.httpRequest - 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 - Code
n8n-nodes-base.code - Gmail
n8n-nodes-base.gmail - Merge
n8n-nodes-base.merge
From the author
How It Works This workflow streamlines financial operations for accounting teams, finance departments, and tax professionals managing business expenses. It addresses the challenge of reconciling expenses with revenue data, accurately categorizing deductions,…