AutomationFlowsSlack & Telegram › General Qa

General Qa

General QA. Uses executeWorkflowTrigger, httpRequest, telegram. Event-driven trigger; 4 nodes.

Event trigger★★★★☆ complexity4 nodesExecute Workflow TriggerHTTP RequestTelegram
Slack & Telegram Trigger: Event Nodes: 4 Complexity: ★★★★☆ Added:

This workflow follows the Execute Workflow Trigger → HTTP Request 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": "General QA",
  "id": "qaPatch429",
  "active": true,
  "nodes": [
    {
      "parameters": {},
      "id": "trigger_qa",
      "name": "Execute Workflow Trigger",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $env.OPENROUTER_BASE_URL + '/chat/completions' }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{ 'Bearer ' + $env.OPENROUTER_API_KEY }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"model\": \"{{ $env.OPENROUTER_MODEL }}\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"Voc\u00ea \u00e9 um assistente t\u00e9cnico para um estudante de Engenharia Eletr\u00f4nica. Responda em portugu\u00eas brasileiro, tom direto e informal. Se n\u00e3o souber, diga. Para quest\u00f5es t\u00e9cnicas prefira manter foco em f\u00f3rmulas e c\u00f3digo.\\n\\nN\u00c3O REPITA A PERGUNTA. V\u00e1 direto ao ponto.\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"{{ $json.original_message.text }}\"\n    }\n  ]\n}",
        "options": {}
      },
      "id": "http_openrouter",
      "name": "OpenRouter API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [
        200,
        0
      ],
      "onError": "continueRegularOutput",
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 5000
    },
    {
      "parameters": {
        "jsCode": "// General QA \u2014 Parse QA node\n// Parses OpenRouter LLM response and sanitizes Markdown for Telegram\n\nfunction sanitizeMd(text) {\n  let t = String(text);\n  // Ensure bold markers (*) are properly paired\n  const stars = (t.match(/(?<!\\\\)\\*/g) || []);\n  if (stars.length % 2 !== 0) {\n    // Find the last unpaired * and escape it\n    const lastIdx = t.lastIndexOf('*');\n    t = t.substring(0, lastIdx) + '\\\\*' + t.substring(lastIdx + 1);\n  }\n  // Ensure italic markers (_) are properly paired\n  const underscores = (t.match(/(?<!\\\\)_/g) || []);\n  if (underscores.length % 2 !== 0) {\n    const lastIdx = t.lastIndexOf('_');\n    t = t.substring(0, lastIdx) + '\\\\_' + t.substring(lastIdx + 1);\n  }\n  // Ensure code markers (`) are properly paired (ignore triple backticks)\n  const singles = (t.match(/(?<!`)(?<!\\\\)`(?!`)/g) || []);\n  if (singles.length % 2 !== 0) {\n    const lastIdx = t.lastIndexOf('`');\n    t = t.substring(0, lastIdx) + '\\\\`' + t.substring(lastIdx + 1);\n  }\n  // Escape unmatched [ without ]\n  t = t.replace(/\\[(?![^\\]]*\\])/g, '\\\\[');\n  return t;\n}\n\nconst data = $input.first().json;\nif (!data.choices || data.choices.length === 0) {\n  const errMsg = data.error && data.error.message ? data.error.message : 'Erro desconhecido';\n  return [{ json: { text: `Erro no OpenRouter: ${sanitizeMd(errMsg)}` } }];\n}\nconst raw = data.choices[0].message.content;\nreturn [{ json: { text: sanitizeMd(raw) } }];"
      },
      "id": "parse_qa",
      "name": "Parse QA",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        400,
        0
      ]
    },
    {
      "parameters": {
        "chatId": "={{ $env.TELEGRAM_CHAT_ID }}",
        "text": "={{ $json.text }}",
        "additionalFields": {
          "parse_mode": "Markdown",
          "appendAttribution": false
        }
      },
      "id": "telegram_qa",
      "name": "Telegram",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.1,
      "position": [
        600,
        0
      ],
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Execute Workflow Trigger": {
      "main": [
        [
          {
            "node": "OpenRouter API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter API": {
      "main": [
        [
          {
            "node": "Parse QA",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse QA": {
      "main": [
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}

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

General QA. Uses executeWorkflowTrigger, httpRequest, telegram. Event-driven trigger; 4 nodes.

Source: https://github.com/webtraveler-br/servidor-assistente-com-n8n/blob/212c03ae8f676129a5fc3354b7c64e4876716fb1/workflows/general-qa.json — 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

03 - Command Handler. Uses executeWorkflowTrigger, telegram, executeCommand, postgres. Event-driven trigger; 53 nodes.

Execute Workflow Trigger, Telegram, Execute Command +2
Slack & Telegram

Deal-Finder. Uses executeWorkflowTrigger, googleSheets, perplexity, httpRequest. Event-driven trigger; 49 nodes.

Execute Workflow Trigger, Google Sheets, Perplexity +2
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

A — Приём и перевод (Челлендж 200 дней). Uses executeWorkflowTrigger, telegram, httpRequest, executeCommand. Event-driven trigger; 32 nodes.

Execute Workflow Trigger, Telegram, HTTP Request +5
Slack & Telegram

C — Кнопки и публикация (Челлендж 200 дней). Uses executeWorkflowTrigger, telegram, googleSheets, httpRequest. Event-driven trigger; 22 nodes.

Execute Workflow Trigger, Telegram, Google Sheets +1