AutomationFlowsAI & RAG › Ecommerce AI Telegram

Ecommerce AI Telegram

Ecommerce AI Telegram. Uses telegramTrigger, agent, lmChatOpenAi, memoryBufferWindow. Event-driven trigger; 8 nodes.

Event trigger★★★☆☆ complexityAI-powered8 nodesTelegram TriggerAgentOpenAI ChatMemory Buffer WindowTelegramGoogle SheetsGoogle Sheets ToolHTTP Request Tool
AI & RAG Trigger: Event Nodes: 8 Complexity: ★★★☆☆ AI nodes: yes Added:

This workflow follows the Agent → Google Sheets 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
{
  "name": "Ecommerce AI Telegram",
  "nodes": [
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.3,
      "position": [
        -32,
        272
      ],
      "id": "3027ef0e-f7fc-416d-bfc2-4d8507071357",
      "name": "Telegram Trigger",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.message.text }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "# Prompt de comportamiento\n\nTu tarea principal es brindar informaci\u00f3n clara, \u00fatil y directa.\n\n## Reglas obligatorias\n\n* Respond\u00e9 de forma breve y entendible.\n* Prioriz\u00e1 respuestas cortas y resumidas.\n* Explic\u00e1 solo lo necesario.\n* Evit\u00e1 textos largos o demasiado detallados salvo que el usuario lo pida.\n* Si el usuario se equivoca, corregilo claramente.\n* Manten\u00e9 las respuestas ordenadas y f\u00e1ciles de leer.\n* Us\u00e1 siempre Markdown compatible con mensajes de Telegram.\n* Evit\u00e1 HTML.\n* Us\u00e1 \u00fanicamente formato soportado por Telegram:\n\n  * `*negrita*`\n  * `_it\u00e1lica_`\n  * `` `c\u00f3digo` ``\n  * listas\n  * links Markdown\n* No uses tablas complejas ni formatos incompatibles.\n* Si mostr\u00e1s c\u00f3digo, us\u00e1 bloques con triple backticks.\n* Manten\u00e9 el formato limpio y f\u00e1cil de copiar.\n\n## Links e im\u00e1genes\n\n* Los links deben ir en Markdown:\n  `[texto](https://ejemplo.com)`\n* Las im\u00e1genes deben mostrarse usando Markdown:\n  `![descripcion](https://imagen.jpg)`\n* Si hay varias im\u00e1genes, listalas una debajo de otra.\n* No pegues URLs enormes sin formato.\n* Evit\u00e1 texto innecesario alrededor de links o im\u00e1genes.\n\n## Productos\n\n* Si el usuario pregunta por un producto, brind\u00e1 informaci\u00f3n r\u00e1pida y \u00fatil:\n\n  * caracter\u00edsticas principales\n  * precio aproximado\n  * ventajas y desventajas\n  * uso recomendado\n* No hagas respuestas excesivamente largas.\n* Us\u00e1 listas cortas y f\u00e1ciles de leer.\n* Si corresponde, suger\u00ed alternativas similares.\n* Termin\u00e1 preguntando si el usuario quiere:\n\n  * link de compra\n  * comparaci\u00f3n\n  * talles\n  * especificaciones\n  * alternativas\n\n## Estilo de respuesta\n\n* Prioriz\u00e1 respuestas breves.\n* Evit\u00e1 introducciones innecesarias.\n* Respond\u00e9 de manera clara y ordenada.\n* Si una respuesta requiere pasos, us\u00e1 listas.\n* Adapt\u00e1 el nivel t\u00e9cnico seg\u00fan la pregunta del usuario.\n* Evit\u00e1 repetir informaci\u00f3n.\n\n## Objetivo\n\nResolver la consulta del usuario de forma \u00fatil, clara y r\u00e1pida.\n\nOfrecerr UNICAMENTE productos de nuestro cataloogo:\nLa tool action se llama search_product y es la unica fuente de productos de la cual puedes recomendar y brindar informacion sobre productos.\nTIENES PROHIVIDO RECOMENDAR PRODUCTOS INVENTADOS O CREAR ORDENES CON PRODUCTOS Q NO SEAN DE search_product.\nTIENES PROHIBIDO BRINDARLE PPUBLICAMENTE LOS SKU O ID DE PRODUCTO AL USER\n\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        352,
        384
      ],
      "id": "67009508-5e08-4eca-8588-bf46162fde38",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4.1-mini",
          "mode": "list",
          "cachedResultName": "gpt-4.1-mini"
        },
        "builtInTools": {},
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.3,
      "position": [
        272,
        560
      ],
      "id": "24d8f921-d024-4065-88a3-dd1960449985",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.message.from.id }}",
        "contextWindowLength": 12
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.4,
      "position": [
        384,
        576
      ],
      "id": "c96d982d-fc6e-46fe-9475-d0015b65092b",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "={{ $json.output }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        912,
        240
      ],
      "id": "710aeca5-5435-4480-b7ce-0968ddef7c58",
      "name": "Send a text message1",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1Nteu0NZC22sQIpks5FVE5ZylBk0hozx39itZQ7dDkFk",
          "mode": "list",
          "cachedResultName": "chatbot-memory",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Nteu0NZC22sQIpks5FVE5ZylBk0hozx39itZQ7dDkFk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "https://docs.google.com/spreadsheets/d/1Nteu0NZC22sQIpks5FVE5ZylBk0hozx39itZQ7dDkFk/edit?gid=0#gid=0",
          "mode": "url"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "userName": "={{ $('Telegram Trigger').item.json.message.from.first_name }} {{ $('Telegram Trigger').item.json.message.from.last_name }}",
            "message": "={\"user\":\"{{ $('Telegram Trigger').item.json.message.text }}\", \"assistant\":\"{{ $json.output }}\"} ",
            "userId": "={{ $('Telegram Trigger').item.json.message.from.id }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "userId",
              "displayName": "userId",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "userName",
              "displayName": "userName",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "message",
              "displayName": "message",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        784,
        544
      ],
      "id": "2fb3101e-fe61-4611-9cbc-f6a7962b2367",
      "name": "Append row in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Utiliza esta herramienta EXCLUSIVAMENTE para crear una nueva orden cuando el cliente solicite comprar o pedir productos. ANTES de ejecutar esta acci\u00f3n, es OBLIGATORIO que extraigas o le preguntes al usuario la siguiente informaci\u00f3n: 1. Su correo electr\u00f3nico (email). 2. La lista de productos que desea, asegur\u00e1ndote de obtener la cantidad exacta y de determinar el 'SKU' (ID) correcto de cada producto seg\u00fan tu base de datos o contexto. Si el usuario no te da su email, o si no menciona las cantidades, NO ejecutes la herramienta todav\u00eda; preg\u00fantale amablemente los datos faltantes.",
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "https://docs.google.com/spreadsheets/d/1Nteu0NZC22sQIpks5FVE5ZylBk0hozx39itZQ7dDkFk/edit?gid=2060238285#gid=2060238285",
          "mode": "url"
        },
        "sheetName": {
          "__rl": true,
          "value": 2060238285,
          "mode": "list",
          "cachedResultName": "Orders",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Nteu0NZC22sQIpks5FVE5ZylBk0hozx39itZQ7dDkFk/edit#gid=2060238285"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "status": "PENDING",
            "user": "={{ $json.message.chat.id }}",
            "details": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('details', 'Genera un string en formato JSON v\u00e1lido con los detalles de la orden para guardarlo en la base de datos. El JSON resultante debe tener ESTRICTAMENTE esta estructura: {\"email\": \"correo del usuario\", \"products\": [{\"sku\": \"ID del producto buscado en la base\", \"quantity\": numero}]}. REGLA CR\u00cdTICA: P\u00eddele al usuario su correo y las cantidades antes de ejecutar esta acci\u00f3n. Devuelve \u00daNICAMENTE el texto del JSON plano, sin formato markdown, sin comillas invertidas (\\\\``) y sin introducciones como \"Order creation\".`', 'string') }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "status",
              "displayName": "status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "details",
              "displayName": "details",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "user",
              "displayName": "user",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.7,
      "position": [
        656,
        736
      ],
      "id": "b56bd264-ef3d-4a5a-8061-9fe82d77e590",
      "name": "create_order",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "toolDescription": "solo ejecuta esta action si el usuario tiene interes en algun producto. Obtiene info sobre productos desde Fake Store API para el user.\nEsta action se llama search_product y es la unica fuente de productos de la cuales ppuedes hablar y brindar informacion",
        "url": "https://fakestoreapi.com/products",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequestTool",
      "typeVersion": 4.4,
      "position": [
        496,
        752
      ],
      "id": "42e1e40c-422d-4c9e-8c4c-29effb4670b3",
      "name": "search_product"
    }
  ],
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send a text message1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create_order": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "search_product": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate"
  },
  "staticData": null,
  "triggerCount": 1,
  "meta": {
    "templateCredsSetupCompleted": true
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

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

About this workflow

Ecommerce AI Telegram. Uses telegramTrigger, agent, lmChatOpenAi, memoryBufferWindow. Event-driven trigger; 8 nodes.

Source: https://github.com/Javi-cba/Ecommerce-AI-Telegram/blob/main/workflow.json — 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

Content Ai Agent. Uses agent, telegramTrigger, memoryBufferWindow, telegram. Event-driven trigger; 28 nodes.

Agent, Telegram Trigger, Memory Buffer Window +6
AI & RAG

This workflow contains community nodes that are only compatible with the self-hosted version of n8n. In simple terms, this workflow triggers when you receive an e-mail in your inbox; classifies this e

Email Read Imap, Telegram Trigger, Telegram +6
AI & RAG

Automate trading on AlphaInsider by monitoring Telegram messages. Uses AI to analyze signals and execute trades, create posts, or answer questions.

OpenAI, Telegram, HTTP Request +7
AI & RAG

Meet Troy, your intelligent personal assistant that seamlessly manages your Google Calendar and Tasks through Telegram. This workflow combines AI-powered natural language processing with MCP (Model Co

Mcp Trigger, Google Calendar Tool, Google Tasks Tool +7
AI & RAG

This workflow creates a Telegram chatbot agent that has access to several knowledge bases at the same time (used as "experts").

OpenAI Chat, Memory Buffer Window, Telegram Trigger +4