AutomationFlowsAI & RAG › Analyze Invoices and Predict Cash Flow with Gemini, Google Sheets, Gmail,…

Analyze Invoices and Predict Cash Flow with Gemini, Google Sheets, Gmail,…

Original n8n title: Analyze Invoices and Predict Cash Flow with Gemini, Google Sheets, Gmail, and Slack

ByOka Hironobu @okp29 on n8n.io

This workflow automates invoice processing and cash flow prediction by combining Google Gemini AI with form-based invoice capture, fraud detection, and financial reporting.

Event trigger★★★★☆ complexityAI-powered16 nodesForm TriggerChain LlmGoogle Gemini ChatGoogle SheetsSlackGmail
AI & RAG Trigger: Event Nodes: 16 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #13420 — we link there as the canonical source.

This workflow follows the Chainllm → Form Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "784bfe7d-15ec-426d-9d52-7f4c669f8a73",
      "name": "Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1520,
        -240
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "54401a2c-8daf-42a3-a904-0b8d07182ad4",
      "name": "Step 1 - Invoice Capture",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        -240
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "3bcb6023-1867-49d6-81d9-64e30b91e8f5",
      "name": "Step 2 - AI Analysis",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        -240
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "ba537830-35a8-4d74-b73f-328f6effe3e7",
      "name": "Step 3 - Processing",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        -240
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "276c5a6c-44cb-4eb3-9c4f-10fa80821271",
      "name": "Step 4 - Reporting",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        -240
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "6a92a463-2d46-48f1-93e1-77ad3771a4b6",
      "name": "Invoice Upload Form",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -864,
        -32
      ],
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "f944c845-0432-4421-8f2a-789d1b602c7b",
      "name": "Process Invoice Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -640,
        -32
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "ec79ec9c-347a-45ed-9d02-48e563d67e61",
      "name": "AI Invoice Analyzer",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -288,
        -32
      ],
      "parameters": {},
      "typeVersion": 1.4
    },
    {
      "id": "f37d625b-48d7-4e8d-8cbf-7dc5a4c7f873",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -288,
        128
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ce2d8616-0714-43ec-a108-dec2caf9212e",
      "name": "Parse AI Response",
      "type": "n8n-nodes-base.code",
      "position": [
        128,
        -32
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "4b773e72-0954-44bc-b272-01da8206b578",
      "name": "Fraud Risk Check",
      "type": "n8n-nodes-base.if",
      "position": [
        400,
        -32
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "09ab2b1f-0bdc-4c8b-861f-0d048b94fe00",
      "name": "Log to Financial Database",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        960,
        -32
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "1765f748-fd06-4ad4-ba75-0103d1258bfe",
      "name": "Cash Flow Predictor",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1200,
        -32
      ],
      "parameters": {},
      "typeVersion": 1.4
    },
    {
      "id": "78516068-d71b-40ff-8fd4-0e75027b5665",
      "name": "Google Gemini Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1200,
        128
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "3ced5895-f364-40be-a90b-7cad3cf258c9",
      "name": "Send Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        720,
        -144
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "914728e8-ebf9-4a35-9a9a-b5c53e3bb3f6",
      "name": "Send Financial Report",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1504,
        -32
      ],
      "parameters": {},
      "typeVersion": 2.1
    }
  ],
  "connections": {
    "Fraud Risk Check": {
      "main": [
        [
          {
            "node": "Send Alert",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log to Financial Database",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log to Financial Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI Response": {
      "main": [
        [
          {
            "node": "Fraud Risk Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Invoice Analyzer": {
      "main": [
        [
          {
            "node": "Parse AI Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cash Flow Predictor": {
      "main": [
        [
          {
            "node": "Send Financial Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Invoice Upload Form": {
      "main": [
        [
          {
            "node": "Process Invoice Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Invoice Data": {
      "main": [
        [
          {
            "node": "AI Invoice Analyzer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Invoice Analyzer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Cash Flow Predictor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Log to Financial Database": {
      "main": [
        [
          {
            "node": "Cash Flow Predictor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow automates invoice processing and cash flow prediction by combining Google Gemini AI with form-based invoice capture, fraud detection, and financial reporting.

Source: https://n8n.io/workflows/13420/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Automate your lead intake, scoring, and outreach pipeline. This workflow collects leads from forms, enriches and scores them using Relevance AI, routes them by quality, and triggers the right follow-u

Form Trigger, HTTP Request, Chain Llm +6
AI & RAG

Transform your sales pipeline with this comprehensive AI-powered platform that automates lead capture, scoring, revenue prediction, and sales team coordination. Perfect for B2B teams processing 50+ le

Form Trigger, HTTP Request, Chain Llm +4
AI & RAG

Content creators, YouTubers, marketing agencies, and social media managers who want to optimize their YouTube videos for better discoverability and engagement. Perfect for teams managing multiple chan

Form Trigger, HTTP Request, Chain Llm +4
AI & RAG

Gym-goers, runners, home workout enthusiasts, and personal trainers who want to track workouts without fiddling with complicated fitness apps. Just type what you did and let AI handle the rest.

Form Trigger, Chain Llm, Google Gemini Chat +3
AI & RAG

Sales teams and B2B marketers who spend hours researching leads manually. If you've looked at Clay but didn't want the $149/month price tag, this workflow does the same job as a one-time n8n template.

Form Trigger, HTTP Request, Chain Llm +3