AutomationFlowsSlack & Telegram › Asistente De Ventas

Asistente De Ventas

Asistente De Ventas. Uses telegramTrigger, googleGenerativeAi, googleSheets, telegram. Event-driven trigger; 12 nodes.

Event trigger★★★★☆ complexity12 nodesTelegram TriggerGoogle Generative AiGoogle SheetsTelegram
Slack & Telegram Trigger: Event Nodes: 12 Complexity: ★★★★☆ Added:

This workflow follows the Google Sheets → Telegram 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
{
  "nodes": [
    {
      "parameters": {
        "botToken": "=<YOUR_TELEGRAM_BOT_TOKEN>",
        "path": "webhook",
        "chatId": "={{ $json.message.chat.id }}",
        "text": "Hello! How can I help you today?"
      },
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1,
      "workflowId": null,
      "position": [
        240,
        280
      ]
    },
    {
      "parameters": {
        "model": "gemini-pro",
        "prompt": "You are an eBook sales assistant. Your task is to understand the user's query about our books. Identify if they are asking for a specific book, a category, prices, or a general question. If searching for a book, extract the title or category. If it's a greeting, respond kindly. If it's a purchase question, indicate it. Provide your response in JSON format with 'intent' (e.g., 'search_book', 'greeting', 'purchase_question', 'generic') and 'detail' (e.g., 'fantasy', 'book title', 'specific question').\n\nUser query: {{ $json.message.text }}",
        "options": {}
      },
      "name": "Gemini: Process Query",
      "type": "n8n-nodes-base.googleGenerativeAi",
      "typeVersion": 1,
      "workflowId": null,
      "position": [
        460,
        280
      ]
    },
    {
      "parameters": {
        "conditions": [
          {
            "value1": "={{ $json.intent }}",
            "value2": "=search_book",
            "type": "string",
            "operator": "stringEqual"
          }
        ]
      },
      "name": "IF: Intent is 'search_book'",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "workflowId": null,
      "position": [
        700,
        180
      ]
    },
    {
      "parameters": {
        "conditions": [
          {
            "value1": "={{ $json.intent }}",
            "value2": "=greeting",
            "type": "string",
            "operator": "stringEqual"
          }
        ]
      },
      "name": "IF: Intent is 'greeting'",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "workflowId": null,
      "position": [
        700,
        340
      ]
    },
    {
      "parameters": {
        "conditions": [
          {
            "value1": "={{ $json.intent }}",
            "value2": "=purchase_question",
            "type": "string",
            "operator": "stringEqual"
          }
        ]
      },
      "name": "IF: Intent is 'purchase_question'",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "workflowId": null,
      "position": [
        700,
        500
      ]
    },
    {
      "parameters": {
        "conditions": [
          {
            "value1": "={{ $json.intent }}",
            "value2": "=generic",
            "type": "string",
            "operator": "stringEqual"
          }
        ]
      },
      "name": "IF: Intent is 'generic'",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "workflowId": null,
      "position": [
        700,
        660
      ]
    },
    {
      "parameters": {
        "operation": "getAll",
        "spreadsheetId": "<YOUR_GOOGLE_SHEET_ID>",
        "sheetName": "<YOUR_SHEET_NAME>",
        "options": {}
      },
      "name": "Google Sheets: Get eBooks",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "workflowId": null,
      "position": [
        920,
        180
      ],
      "disabled": false
    },
    {
      "parameters": {
        "functionCode": "const searchTerm = $json.detail.toLowerCase();\nconst ebooks = $input.item.json.data;\n\nlet responseMessage = 'Lo siento, no pude encontrar eBooks que coincidan con \"' + searchTerm + '\". \u00bfHay algo m\u00e1s en lo que pueda ayudarte?';\nlet foundEbooks = [];\n\nif (ebooks && Array.isArray(ebooks)) {\n  foundEbooks = ebooks.filter(book => \n    (book.Titulo && book.Titulo.toLowerCase().includes(searchTerm)) ||\n    (book.Categoria && book.Categoria.toLowerCase().includes(searchTerm))\n  );\n\n  if (foundEbooks.length > 0) {\n    responseMessage = 'Aqu\u00ed est\u00e1n los eBooks que encontr\u00e9:\\n';\n    foundEbooks.forEach(book => {\n      responseMessage += `\\n* ${book.Titulo} de ${book.Autor}`; \n      if (book.Precio) responseMessage += ` - Precio: ${book.Precio}`; \n      if (book.Descripcion) responseMessage += `\\n  Descripci\u00f3n: ${book.Descripcion.substring(0, 100)}...`;\n      if (book.EnlaceDescarga) responseMessage += `\\n  Enlace: ${book.EnlaceDescarga}`; \n      responseMessage += '\\n';\n    });\n  } else {\n    responseMessage = 'No encontr\u00e9 eBooks que coincidan con \"' + searchTerm + '\". \u00bfTe gustar\u00eda buscar por otra cosa?';\n  }\n}\n\nreturn [{ json: { text: responseMessage } }];",
        "options": {}
      },
      "name": "Code: Format eBook Response",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "workflowId": null,
      "position": [
        1160,
        180
      ],
      "disabled": false
    },
    {
      "parameters": {
        "functionCode": "return [{ json: { text: '\u00a1Hola! Soy tu asistente de ventas de eBooks. \u00bfEn qu\u00e9 puedo ayudarte hoy?' } }];",
        "options": {}
      },
      "name": "Code: Greeting Message",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "workflowId": null,
      "position": [
        920,
        340
      ],
      "disabled": false
    },
    {
      "parameters": {
        "functionCode": "return [{ json: { text: 'Para preguntas sobre compras o m\u00e9todos de pago, por favor, env\u00edanos un correo a ventas@tusebooks.com o visita nuestra secci\u00f3n de preguntas frecuentes.' } }];",
        "options": {}
      },
      "name": "Code: Purchase Question Message",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "workflowId": null,
      "position": [
        920,
        500
      ],
      "disabled": false
    },
    {
      "parameters": {
        "functionCode": "return [{ json: { text: 'Lo siento, no entend\u00ed tu pregunta. \u00bfPodr\u00edas ser m\u00e1s espec\u00edfico sobre lo que buscas o qu\u00e9 eBook te interesa?' } }];",
        "options": {}
      },
      "name": "Code: Generic Message",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "workflowId": null,
      "position": [
        920,
        660
      ],
      "disabled": false
    },
    {
      "parameters": {
        "chatId": "={{ $json.message.chat.id }}",
        "text": "={{ $json.text }}"
      },
      "name": "Telegram: Send Response",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1,
      "workflowId": null,
      "position": [
        1400,
        420
      ]
    }
  ],
  "connections": [
    {
      "from": "Telegram Trigger",
      "to": "Gemini: Process Query",
      "fromHandle": "main",
      "toHandle": "main"
    },
    {
      "from": "Gemini: Process Query",
      "to": "IF: Intent is 'search_book'",
      "fromHandle": "main",
      "toHandle": "main"
    },
    {
      "from": "IF: Intent is 'search_book'",
      "to": "Google Sheets: Get eBooks",
      "fromHandle": "true",
      "toHandle": "main"
    },
    {
      "from": "IF: Intent is 'search_book'",
      "to": "IF: Intent is 'greeting'",
      "fromHandle": "false",
      "toHandle": "main"
    },
    {
      "from": "IF: Intent is 'greeting'",
      "to": "Code: Greeting Message",
      "fromHandle": "true",
      "toHandle": "main"
    },
    {
      "from": "IF: Intent is 'greeting'",
      "to": "IF: Intent is 'purchase_question'",
      "fromHandle": "false",
      "toHandle": "main"
    },
    {
      "from": "IF: Intent is 'purchase_question'",
      "to": "Code: Purchase Question Message",
      "fromHandle": "true",
      "toHandle": "main"
    },
    {
      "from": "IF: Intent is 'purchase_question'",
      "to": "IF: Intent is 'generic'",
      "fromHandle": "false",
      "toHandle": "main"
    },
    {
      "from": "IF: Intent is 'generic'",
      "to": "Code: Generic Message",
      "fromHandle": "true",
      "toHandle": "main"
    },
    {
      "from": "Google Sheets: Get eBooks",
      "to": "Code: Format eBook Response",
      "fromHandle": "main",
      "toHandle": "main"
    },
    {
      "from": "Code: Format eBook Response",
      "to": "Telegram: Send Response",
      "fromHandle": "main",
      "toHandle": "main"
    },
    {
      "from": "Code: Greeting Message",
      "to": "Telegram: Send Response",
      "fromHandle": "main",
      "toHandle": "main"
    },
    {
      "from": "Code: Purchase Question Message",
      "to": "Telegram: Send Response",
      "fromHandle": "main",
      "toHandle": "main"
    },
    {
      "from": "Code: Generic Message",
      "to": "Telegram: Send Response",
      "fromHandle": "main",
      "toHandle": "main"
    }
  ]
}
Pro

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

About this workflow

Asistente De Ventas. Uses telegramTrigger, googleGenerativeAi, googleSheets, telegram. Event-driven trigger; 12 nodes.

Source: https://gist.github.com/Ojcalzada/2de540336c2fdc93978243b61e85f469 — original creator credit. Request a take-down →

More Slack & Telegram workflows → · Browse all categories →

Related workflows

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

Slack & Telegram

This workflow provides a complete solution for handling Telegram Stars payments, invoicing and refunds using n8n. It automates the process of sending invoices, managing pre-checkout approvals, recordi

HTTP Request, Execute Workflow Trigger, Google Sheets +2
Slack & Telegram

clients kept booking meetings during my prayer times. i'd either miss a prayer or scramble to reschedule. the problem wasn't the clients — it was that my calendar had no blocked windows for salah. i n

Telegram Trigger, HTTP Request, Google Calendar +3
Slack & Telegram

This workflow is a powerful reputation management tool designed to proactively filter customer reviews. It helps you encourage positive reviews on Google while capturing negative feedback privately be

Telegram Trigger, Google Sheets, Telegram
Slack & Telegram

This workflow is designed to automate your e-commerce order processing by instantly syncing new Jotform submissions with your internal systems and immediately notifying the customer on Telegram.

Jot Form Trigger, Telegram, Data Table +3
Slack & Telegram

This template is perfect for freelancers, small business owners, or financial assistants who want to record and approve financial transactions like income and expenses directly from Telegram, without

Telegram Trigger, Telegram, Google Sheets