ChatGPTMoneyLower billsAI score · 73/100AI-assisted edit · no obvious prompt-injection riskn8n.io

AI Expense Approval Workflow: Airtable + GPT-4 + Pinecone Auto-Audit

Airtable expense submission → n8n AI Agent analysis → structured output → Pinecone vector storage → write-back approval result

Some experienceStepsWorkflowPrompt
Who
Finance teams, CFOs, or ops staff who need automated expense approval and compliance auditing
You get
New expense submissions automatically trigger AI analysis, flag suspicious items, and leave a searchable vector audit trail
You need
n8n · airtable · pinecone

Constraints

Prerequisites: n8n instance (self-hosted or cloud), Airtable account with a base containing expense data, OpenAI API key, Pinecone account with an index. Credential types: airtableTokenApi, openAiApi, pineconeApi. Default model is gpt-4o-mini; switchable to gpt-4o or gpt-4 in the OpenAI node. The expenses table needs fields: Amount, Submitted By, Category, Description, Date Submitted, Status.

What they did

Author Yaron Been published an expense approval workflow template on the n8n template platform. The template listens for expense submissions via Airtable Trigger, uses an n8n AI Agent node to call an OpenAI model for CFO-level expense analysis, converts unstructured responses to JSON via Structured Output Parser, vectorizes the analysis reasoning into Pinecone, and writes the approval decision and reasoning back to Airtable.

How it went

The template description provides one example: input "$4,500 business class flight to Tokyo" yields AI output "Flagged - Amount exceeds typical travel thresholds..." (author_report). The source claims "99% faster expense processing vs manual review" (author_report, unverified).

Worth knowing

1. The template defaults to gpt-4o-mini; the model field in the node is set to list mode and can be switched to gpt-4o or gpt-4. 2. chunkSize=100 is the source default; you may need to tune it for longer reasoning texts. 3. The Pinecone namespace uses a dynamic expression {{ $json.output.decision }}, so Approved/Flagged decisions land in separate namespaces. 4. The Airtable update node hardcodes Status to "completed", forming a state transition from the trigger condition "Pending". 5. The source does not provide explicit expense baseline rules; AI judgment relies on model pre-training rather than configured policy thresholds. 6. This site has not reproduced the workflow; actual latency, cost, and accuracy require your own validation.

n8n workflow template

Structure checked · Not run-tested

Use “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.

Setup and test checklist

Credentials to connect

  • Watch New Expense Requests node: connect Airtable credentials.
  • OpenAI GPT-4 Model node: connect OpenAI API credentials.
  • Store Decision in Pinecone node: connect pineconeApi credentials.
  • Generate Embeddings node: connect OpenAI API credentials.
  • Update Airtable Record node: connect Airtable credentials.

Configuration to replace

  • Source template is n8n public workflow #4576 (~15 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
  • Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.

Test input and expected output

  • Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
  • Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.

Template changes

  • Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
  • No business-logic edits; verify keys, quotas and privacy compliance before use.

Template retrieved: 2026-10-24

Steps

  1. Configure Airtable Trigger

    Add an 'Airtable Trigger' node in n8n, select your base and Expenses table. Set the trigger field to Amount and authentication to airtableTokenApi. Once saved, the workflow auto-starts when a new or updated record with Status = Pending appears.

  2. Configure AI Analysis Agent and Structured Output

    Add an 'AI Agent' node (CFO Expense Review Agent), connecting an OpenAI Chat Model and a Structured Output Parser. Enter the expense data template in the Agent's text field; set the CFO analysis role in systemMessage. Choose the model in the OpenAI node (default gpt-4o-mini). Provide a JSON Schema example in the Structured Output Parser to ensure outputs include decision, reason, amount, submitted_by, category, etc.

    Execution prompt · Source text。CFO Expense Review Agent node text / user prompt field

    =An employee submitted an expense:
    Amount: ${{ $json.fields.Amount }}
    Submitted by: {{ $json.fields['Submitted By'] }}
    Category: {{ $json.fields.Category }}
    Description: {{ $json.fields.Description }}
    Date Submitted: {{ $json.fields['Date Submitted'] }}
    Status: {{ $json.fields.Status }}

    Execution prompt · Source text。CFO Expense Review Agent node systemMessage field

    You are a CFO expense analysis agent. Flag suspicious expenses with the reason. When you answer try to give answer with all the given details

    Execution prompt · Source text。Parse CFO Agent Response node jsonSchemaExample field

    {
      "amount": 4500,
      "submitted_by": "Alice",
      "category": "Travel",
      "description": "Business class flight to Tokyo",
      "date_submitted": "2025-05-29",
      "status": "Pending",
      "decision": "Flagged",
      "reason": "The amount of $4500 for a business class flight appears unusually high and requires verification against standard travel policies and previous similar expenses. Additionally, the submission date is in the future (2025), which raises concerns about the legitimacy of the expense. It is advisable to confirm the travel plans and the necessity of the business class flight for this trip."
    }
  3. Configure Vector Store Audit Chain

    Add nodes in sequence: Default Data Loader → Recursive Character Text Splitter → Embeddings OpenAI → Pinecone Vector Store. Feed the AI-generated reasoning text into the Data Loader. Set Text Splitter to chunkSize=100, chunkOverlap=20 (source defaults; adjust as needed). Use openAiApi credentials for Embeddings. Set Pinecone to insert mode with namespace as a dynamic value like {{ $json.output.decision }} and specify the target index.

  4. Configure Airtable Write-Back and Closure

    Add an 'Airtable' update node with operation set to update. Use the record id from the trigger node as the matching field. Map Amount, Reason, Status (fixed value 'completed'), Category, decision, Description, and Submitted By from the CFO Expense Review Agent output. Save and activate the workflow.

Prompt you can copy

Setup guidance · Editorial suggestion。Setup assistant starter prompt to confirm prerequisites and credentials

This block is the prompt. Ads are never placed here.

You are setting up an n8n automated expense approval workflow. Please confirm you have: an Airtable base (with fields Amount, Submitted By, Category, Description, Date Submitted, Status), an OpenAI API key, and a Pinecone account with an index. Verify credentials before importing the template or rebuilding nodes step by step.

Before building, ensure your Airtable field names match the template; otherwise adjust the field references in expressions.

Source

Automated expense approval system with GPT-4, Airtable & Pinecone Vector DB · yaron-nofluff · n8n.io · 2025-06-02

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related