AutomationFlows › AI & RAG › Chat-based Financial Analysis of P&l and Balance Sheets with Gpt-4 & Postgresql

Chat-based Financial Analysis of P&l and Balance Sheets with Gpt-4 & Postgresql

ByZain Ali @zain104✓ on n8n.io

This workflow is designed for finance teams, accountants, and data analysts 📊 who want to interact with financial data from two PostgreSQL databases — one containing Profit & Loss data and another containing Balance Sheet data — using natural language chat. It’s perfect for…

Chat trigger trigger★★☆☆☆ complexityAI-powered7 nodesAgentPostgres ToolMemory Buffer WindowOpenAI ChatChat Trigger
AI & RAG Trigger: Chat trigger Nodes: 7 Complexity: ★★☆☆☆ AI nodes: yes Added:

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

This workflow follows the Agent → Chat 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
{
  "id": "okpWKYL7NWpYys9Q",
  "name": "Financial Analyst  Agent",
  "tags": [],
  "nodes": [
    {
      "id": "9d80bab4-d014-4e2c-9f9c-15cb29f49545",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        416,
        192
      ],
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "f3cd7b4d-0e89-403f-b505-4f9fdce05f30",
      "name": "P_L_Reports",
      "type": "n8n-nodes-base.postgresTool",
      "position": [
        608,
        400
      ],
      "parameters": {},
      "typeVersion": 2.6
    },
    {
      "id": "09825591-c77e-4635-a635-282a3cc0d98c",
      "name": "Balance_Sheets",
      "type": "n8n-nodes-base.postgresTool",
      "position": [
        752,
        400
      ],
      "parameters": {},
      "typeVersion": 2.6
    },
    {
      "id": "7da3e4a5-0861-493e-a427-9cecf010de3d",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        480,
        400
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "d6e2fec8-9910-496f-a630-113ee0e94eb2",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        336,
        400
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "ee289e2e-716f-49b5-aaf0-80737e1692bc",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -32
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "4da765c4-d0b7-46dd-b197-d0179bdf1c92",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        176,
        192
      ],
      "parameters": {},
      "typeVersion": 1.3
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8783b3c8-e1bb-4505-8de7-50dfa925535f",
  "connections": {
    "AI Agent": {
      "main": [
        []
      ]
    },
    "P_L_Reports": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Balance_Sheets": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "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 is designed for finance teams, accountants, and data analysts 📊 who want to interact with financial data from two PostgreSQL databases — one containing Profit & Loss data and another containing Balance Sheet data — using natural language chat. It’s perfect for…

Source: https://n8n.io/workflows/7197/ — 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

Chat with Postgresql Database. Uses chatTrigger, agent, lmChatOpenAi, postgresTool. Chat trigger; 11 nodes.

Chat Trigger, Agent, OpenAI Chat +2
AI & RAG

Chat with Postgresql Database. Uses chatTrigger, agent, lmChatOpenAi, postgresTool. Chat trigger; 11 nodes.

Chat Trigger, Agent, OpenAI Chat +2
AI & RAG

This workflow template is designed for any professionals seeking relevent data from database using natural language. Each time user ask's question using the n8n chat interface, the workflow runs. Then

Chat Trigger, Agent, OpenAI Chat +2
AI & RAG

Turn your PostgreSQL database into a conversational AI agent! Ask questions in plain English and get instant data results without writing SQL. Natural Language Queries: "Show laptops under $500 in sto

Chat Trigger, OpenAI Chat, Memory Buffer Window +2
AI & RAG

Postgrestool Stickynote. Uses stickyNote, chatTrigger, postgresTool, memoryBufferWindow. Chat trigger; 7 nodes.

Chat Trigger, Postgres Tool, Memory Buffer Window +2