AutomationFlowsSlack & Telegram › Automate Task Processing with MySQL & Telegram

Automate Task Processing with MySQL & Telegram

Original n8n title: Post-task Processing

Post-Task Processing. Uses mySql, httpRequest, telegram. Webhook trigger; 8 nodes.

Webhook trigger★★★★☆ complexity8 nodesMySQLHTTP RequestTelegram
Slack & Telegram Trigger: Webhook Nodes: 8 Complexity: ★★★★☆ Added:

This workflow follows the HTTP Request → 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
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "wf-post-task",
  "name": "Post-Task Processing",
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "callerPolicy": "workflowsFromSameOwner"
  },
  "tags": [
    {
      "id": "3",
      "name": "core"
    }
  ],
  "nodes": [
    {
      "id": "node-webhook-trigger",
      "name": "Webhook: Receive Task ID",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        240,
        300
      ],
      "parameters": {
        "path": "post-task",
        "httpMethod": "POST",
        "responseMode": "responseNode",
        "options": {}
      }
    },
    {
      "id": "node-get-task",
      "name": "MySQL: SELECT Task + Agent Memory Config",
      "type": "n8n-nodes-base.mySql",
      "typeVersion": 2.4,
      "position": [
        480,
        300
      ],
      "parameters": {
        "operation": "executeQuery",
        "query": "SELECT t.id, t.agent_id, t.input, t.output, t.model_used, t.status, a.system_prompt, a.memory_rules, JSON_EXTRACT(a.memory_rules, '$.generate_summary') as generate_summary, JSON_EXTRACT(a.memory_rules, '$.collection_id') as collection_id FROM tasks t JOIN agents a ON t.agent_id = a.id WHERE t.id = '{{ $json.body.task_id }}';",
        "options": {}
      },
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "node-if-generate-summary",
      "name": "IF: Generate Summary?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        720,
        300
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "condition-summary",
              "leftValue": "={{ $json.generate_summary }}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "true"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "node-summarize",
      "name": "HTTP: Proxy Summarize Task",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        960,
        200
      ],
      "parameters": {
        "method": "POST",
        "url": "http://proxy:8100/claude",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ system: 'Eres un asistente que genera resumenes concisos de tareas completadas. Responde SOLO con un JSON {\"summary\": \"...\", \"key_points\": [...], \"keywords\": [...]}', prompt: 'Resume la siguiente tarea completada:\\n\\nInput: ' + $('MySQL: SELECT Task + Agent Memory Config').item.json.input + '\\n\\nOutput: ' + $('MySQL: SELECT Task + Agent Memory Config').item.json.output }) }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          },
          "timeout": 60000
        }
      }
    },
    {
      "id": "node-chromadb-add",
      "name": "HTTP: ChromaDB Add to Collection",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1200,
        200
      ],
      "parameters": {
        "method": "POST",
        "url": "http://chromadb:8000/api/v1/collections/{{ $('MySQL: SELECT Task + Agent Memory Config').item.json.collection_id || $('MySQL: SELECT Task + Agent Memory Config').item.json.agent_id + '_memories' }}/add",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ ids: [$('MySQL: SELECT Task + Agent Memory Config').item.json.id], documents: [$json.response?.summary || $json.summary || $('MySQL: SELECT Task + Agent Memory Config').item.json.output], metadatas: [{ task_id: $('MySQL: SELECT Task + Agent Memory Config').item.json.id, agent_id: $('MySQL: SELECT Task + Agent Memory Config').item.json.agent_id, model_used: $('MySQL: SELECT Task + Agent Memory Config').item.json.model_used, created_at: new Date().toISOString() }] }) }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          },
          "timeout": 15000
        }
      }
    },
    {
      "id": "node-insert-memory-meta",
      "name": "MySQL: INSERT task_memories_meta",
      "type": "n8n-nodes-base.mySql",
      "typeVersion": 2.4,
      "position": [
        1440,
        200
      ],
      "parameters": {
        "operation": "executeQuery",
        "query": "INSERT INTO task_memories_meta (id, task_id, agent_id, summary, keywords, chromadb_id, created_at) VALUES (UUID(), '{{ $('MySQL: SELECT Task + Agent Memory Config').item.json.id }}', '{{ $('MySQL: SELECT Task + Agent Memory Config').item.json.agent_id }}', '{{ $('HTTP: Proxy Summarize Task').item.json.response?.summary?.replace(/'/g, \"''\") || $('HTTP: Proxy Summarize Task').item.json.summary?.replace(/'/g, \"''\") || '' }}', '{{ JSON.stringify($('HTTP: Proxy Summarize Task').item.json.response?.keywords || $('HTTP: Proxy Summarize Task').item.json.keywords || []).replace(/'/g, \"''\") }}', '{{ $('MySQL: SELECT Task + Agent Memory Config').item.json.id }}', NOW());",
        "options": {}
      },
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "node-telegram-complete",
      "name": "Telegram: Send Completion Notification",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1680,
        200
      ],
      "parameters": {
        "operation": "sendMessage",
        "chatId": "={{ $env.TELEGRAM_CHAT_ID }}",
        "text": "=Tarea completada y memorizada.\n\nTask ID: {{ $('MySQL: SELECT Task + Agent Memory Config').item.json.id }}\nAgente: {{ $('MySQL: SELECT Task + Agent Memory Config').item.json.agent_id }}\nModelo: {{ $('MySQL: SELECT Task + Agent Memory Config').item.json.model_used }}\n\nResumen: {{ $('HTTP: Proxy Summarize Task').item.json.response?.summary || $('HTTP: Proxy Summarize Task').item.json.summary || 'N/A' }}",
        "additionalFields": {
          "parse_mode": "Markdown"
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "node-skip-summary",
      "name": "Telegram: Completion (No Summary)",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        960,
        420
      ],
      "parameters": {
        "operation": "sendMessage",
        "chatId": "={{ $env.TELEGRAM_CHAT_ID }}",
        "text": "=Tarea completada (sin memorizacion).\n\nTask ID: {{ $('MySQL: SELECT Task + Agent Memory Config').item.json.id }}\nAgente: {{ $('MySQL: SELECT Task + Agent Memory Config').item.json.agent_id }}\nModelo: {{ $('MySQL: SELECT Task + Agent Memory Config').item.json.model_used }}",
        "additionalFields": {
          "parse_mode": "Markdown"
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Webhook: Receive Task ID": {
      "main": [
        [
          {
            "node": "MySQL: SELECT Task + Agent Memory Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MySQL: SELECT Task + Agent Memory Config": {
      "main": [
        [
          {
            "node": "IF: Generate Summary?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF: Generate Summary?": {
      "main": [
        [
          {
            "node": "HTTP: Proxy Summarize Task",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram: Completion (No Summary)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP: Proxy Summarize Task": {
      "main": [
        [
          {
            "node": "HTTP: ChromaDB Add to Collection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP: ChromaDB Add to Collection": {
      "main": [
        [
          {
            "node": "MySQL: INSERT task_memories_meta",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MySQL: INSERT task_memories_meta": {
      "main": [
        [
          {
            "node": "Telegram: Send Completion Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

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

Post-Task Processing. Uses mySql, httpRequest, telegram. Webhook trigger; 8 nodes.

Source: https://github.com/ceshorma/IA-Orchestator/blob/1281ff80a7fece1544815e63620ffef0d4c4e88a/workflows/post-task.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

qualiopi. Uses airtable, telegram, emailSend, httpRequest. Webhook trigger; 51 nodes.

Airtable, Telegram, Email Send +3
Slack & Telegram

PsyCardv2. Uses executeCommand, telegram, readBinaryFile, googleDrive. Webhook trigger; 41 nodes.

Execute Command, Telegram, Read Binary File +2
Slack & Telegram

[](https://www.linkedin.com/in/mosaab-yassir-lafrimi/)[](https://t.me/joevenner)

HTTP Request, Redis, S3 +1
Slack & Telegram

How it works • Webhook triggers from content creation system in Airtable • Downloads media (images/videos) from Airtable URLs • Uploads media to Postiz cloud storage • Schedules or publishes content a

Airtable, Telegram, HTTP Request
Slack & Telegram

I wanted to avoid the rush at end of month to log expenses. I tried existing expense apps but found them either too expensive for what they offer, or frustrating with inconsistent extraction results.

HTTP Request, Telegram