Crear un chatbot de análisis de datos GPT-4 para análisis en tiempo real de hojas de cálculo de Google

Avanzado

Este es unAI Chatbot, Multimodal AIflujo de automatización del dominio deautomatización que contiene 17 nodos.Utiliza principalmente nodos como Merge, Aggregate, GoogleSheets, Agent, ChatTrigger. Crear un chatbot de análisis de datos con GPT-4 para el análisis en tiempo real de Google Sheets

Requisitos previos
  • Credenciales de API de Google Sheets
  • Clave de API de OpenAI
Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "meta": {
    "instanceId": "d1786ab0d745a7498abf13a9c2cdabb1374c006e889b79eef64ce0386b8f8a41",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "c2a31cd3-1cb9-4268-b587-cf5f0462e4a4",
      "name": "Modelo de chat OpenAI",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        960,
        600
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5",
          "cachedResultName": "gpt-5"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "MGwGMKEkdcjzlYCw",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "6253a41e-be2d-4938-8658-1798f76282b7",
      "name": "Al recibir mensaje de chat",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -200,
        400
      ],
      "webhookId": "e4a9a147-7a38-4027-b869-bdb13a89dc30",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "b5db715e-c2a9-46af-a544-6ccf32f3cd11",
      "name": "Fusionar",
      "type": "n8n-nodes-base.merge",
      "position": [
        720,
        400
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition",
        "numberInputs": 3
      },
      "typeVersion": 3.1
    },
    {
      "id": "c7317d56-e218-4544-b0fa-787280ea6ff3",
      "name": "Simple Memoria",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1120,
        600
      ],
      "parameters": {
        "sessionKey": "={{ $('When chat message received').item.json.sessionId }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "0938975c-2dad-41a8-ae91-b61f7bea50b7",
      "name": "Data Analyst Agente IA",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        960,
        400
      ],
      "parameters": {
        "text": "=User Input:\n{{ $('When chat message received').item.json.chatInput }}",
        "options": {
          "systemMessage": "=You are a helpful AI Data Analyst.  \nUse the provided JSON data to analyze and answer questions.  \n\nProducts:  \n{{ $json.products.map(item => item).toJsonString() }}  \n\nCustomers:  \n{{ $json.customers.map(item => item).toJsonString() }}  \n\nOrders:  \n{{ $json.orders.map(item => item).toJsonString() }}  \n\nAlways use the data above when performing analysis.  \n"
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "96c91c7f-9111-43fc-b56d-2811ba18fdc9",
      "name": "Hojas de Google - Get Products Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        160,
        200
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Products"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/d/13QGuASZJE2MtpTvX83OUCz_dn-WRy4DggWLy5HjBvJk/edit?gid=1076558389#gid=1076558389"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ypmzFxQFfAacuVVC",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "f6594bb6-8b89-41cc-8e72-8a970af4c982",
      "name": "Hojas de Google - Get Customers Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        160,
        400
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Customers"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/d/13QGuASZJE2MtpTvX83OUCz_dn-WRy4DggWLy5HjBvJk/edit?gid=1076558389#gid=1076558389"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ypmzFxQFfAacuVVC",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "36deeb5c-7e7e-4ee2-b0a2-97e8c4b33c9a",
      "name": "Hojas de Google - Get Orders Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        160,
        620
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Orders"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/d/13QGuASZJE2MtpTvX83OUCz_dn-WRy4DggWLy5HjBvJk/edit?gid=1076558389#gid=1076558389"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ypmzFxQFfAacuVVC",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "67ddb3e6-dacb-413c-afc4-832b6c6a2c53",
      "name": "Agregar Data 1",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        400,
        200
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "products"
      },
      "typeVersion": 1
    },
    {
      "id": "847c0e0b-e519-4eaf-be0a-992d8f02cb18",
      "name": "Agregar Data 2",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        400,
        400
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "customers"
      },
      "typeVersion": 1
    },
    {
      "id": "e72588a6-eac5-4015-a302-ff0a96747a71",
      "name": "Agregar Data 3",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        400,
        640
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "orders"
      },
      "typeVersion": 1
    },
    {
      "id": "ca4b8f48-338c-480e-b0ca-f424044c50f3",
      "name": "Nota adhesiva",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        60,
        -40
      ],
      "parameters": {
        "color": 4,
        "width": 300,
        "height": 860,
        "content": "## Google Sheet - Get Data  \nUpdate the document URL  \nUpdate the sheet name  \nAdjust the number of Google Sheets nodes based on your use case  \n"
      },
      "typeVersion": 1
    },
    {
      "id": "af0947bb-3e99-4eac-8186-32a506581366",
      "name": "Nota adhesiva1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -780,
        140
      ],
      "parameters": {
        "color": 4,
        "width": 520,
        "height": 300,
        "content": "Workflow Configurations:  \n- Update the Google Sheets document ID in all Google Sheets nodes to point to your data source based on your use case  \n- Example Google Sheets template you can copy: https://docs.google.com/spreadsheets/d/1-QTFO3TbGFjtYOMUfZb0aY66J_8G-R0Rb0JHLWrEZ90/edit?gid=0#gid=0  \n- Configure the sheet names to match your Google Sheets structure  \n- Adjust the AI Agent system message to reflect your specific data schema and analysis requirements  \n- Customize the chat trigger webhook ID for your specific implementation  \n"
      },
      "typeVersion": 1
    },
    {
      "id": "31d2d863-2087-4de6-b7d7-b845b44e40ef",
      "name": "Nota adhesiva2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -800,
        860
      ],
      "parameters": {
        "color": 4,
        "width": 880,
        "height": 320,
        "content": "## 🤖 Build a Smart AI Data Analyst Chatbot with Google Sheet and GPT-5\n\nWhat This Template Does:\n\n- Creates an intelligent chatbot that can analyze data from Google Sheets in real time  \n- Fetches live data from all Google Sheets whenever a chat message is received  \n- Uses OpenAI's model to provide intelligent data analysis and insights  \n- Maintains conversation memory to provide context-aware responses across chat sessions  \n- Combines multiple data sources to provide comprehensive business intelligence answers  \n"
      },
      "typeVersion": 1
    },
    {
      "id": "39c68ef9-71c2-45a1-99e3-b88576d16c45",
      "name": "Nota adhesiva3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        140,
        860
      ],
      "parameters": {
        "color": 4,
        "width": 820,
        "height": 420,
        "content": "## 📋 WORKFLOW PROCESS OVERVIEW\n\nStep 1: 💬 Chat Trigger receives incoming chat messages with session ID tracking  \nStep 2: 📊 Data Retrieval (Parallel Processing)  \nStep 3: 🔄 Data Aggregation combines data from all sources  \nStep 4: 🤝 Merge Node combines all aggregated data streams into a single data object  \nStep 5: 🧠 AI Analysis processes user input using:  \n - OpenAI Model for intelligent responses  \n - Simple Memory maintains conversation context using session ID  \n - Data Analyst AI Agent analyzes the combined data and generates insights based on user queries  \nStep 6: 📤 Response delivers analytical insights, charts, summaries, or answers back to the chat interface  \n"
      },
      "typeVersion": 1
    },
    {
      "id": "1ef90da5-29e6-4b21-9045-3db6d4bb7f78",
      "name": "Nota adhesiva4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1400,
        120
      ],
      "parameters": {
        "color": 4,
        "width": 380,
        "height": 760,
        "content": "# 👋 Hi, I’m Billy\n\nI help businesses build **n8n workflows** & **AI automation projects**.  \nNeed help with n8n or AI Automation projects? \nContact me and let’s build your automation together.\n\n📩 **Email:** billychartanto@gmail.com  \n🤝 **n8n Creator:** [n8n.io/creators/billy](https://n8n.io/creators/billy/)\n🌐 **My n8n Projects:** [billychristi.com/n8n](https://www.billychristi.com/n8n)  \n\n\n\n---\n💡 Feel free to get in touch if you’d like help on your next automation project or if you have any feedback or thoughts to share.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "27d66d12-5a60-45c8-a175-03fdea4db01d",
      "name": "Nota adhesiva5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        860,
        200
      ],
      "parameters": {
        "color": 4,
        "width": 460,
        "height": 640,
        "content": "## Data Analyst AI Agent  \nThis is where all data is processed based on user input  \n\nConfiguration:  \nUpdate the system message prompt data sources based on your use case  \n"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Data Analyst AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Data Analyst AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Data 1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Data 2": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Aggregate Data 3": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Data Analyst AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Google Sheets - Get Orders Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Google Sheets - Get Products Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Google Sheets - Get Customers Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets - Get Orders Data": {
      "main": [
        [
          {
            "node": "Aggregate Data 3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets - Get Products Data": {
      "main": [
        [
          {
            "node": "Aggregate Data 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets - Get Customers Data": {
      "main": [
        [
          {
            "node": "Aggregate Data 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿Cómo usar este flujo de trabajo?

Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.

¿En qué escenarios es adecuado este flujo de trabajo?

Avanzado - Chatbot de IA, IA Multimodal

¿Es de pago?

Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.

Flujos de trabajo relacionados recomendados

Información del flujo de trabajo
Nivel de dificultad
Avanzado
Número de nodos17
Categoría2
Tipos de nodos8
Descripción de la dificultad

Adecuado para usuarios avanzados, flujos de trabajo complejos con 16+ nodos

Autor
Billy Christi

Billy Christi

@billy

I build scalable automation systems with n8n to help businesses save time and cut costs. 💼 n8n expert available for new projects 📩 billychartanto@gmail.com

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34