AutomationFlowsSlack & Telegram › Discounts Autopublish Workflow

Discounts Autopublish Workflow

Discounts_AutoPublish_Workflow. Uses httpRequest, telegram, telegramTrigger. Scheduled trigger; 10 nodes.

Cron / scheduled trigger★★★★☆ complexity10 nodesHTTP RequestTelegramTelegram Trigger
Slack & Telegram Trigger: Cron / scheduled Nodes: 10 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
{
  "name": "Discounts_AutoPublish_Workflow",
  "nodes": [
    {
      "parameters": {
        "triggerTimes": [
          {
            "item": {
              "hour": 1
            }
          }
        ]
      },
      "name": "Cron Trigger",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [
        240,
        300
      ],
      "notes": "\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0430\u0441 (hour = 1 => \u043a\u0430\u0436\u0434\u044b\u0435 1 \u0447\u0430\u0441). \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e \u043c\u0438\u043d\u0443\u0442\u0430\u043c/\u0434\u043d\u044f\u043c \u0438 \u0442.\u043f."
    },
    {
      "parameters": {
        "requestMethod": "GET",
        "url": "=https://api.phantombuster.com/USER_ENDPOINT",
        "queryParameters": [
          {
            "name": "apiKey",
            "value": "YOUR_PHANTOM_KEY"
          }
        ],
        "options": {}
      },
      "name": "Get Discounts Posts (Phantombuster)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        460,
        300
      ],
      "notes": "\u0417\u0434\u0435\u0441\u044c \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 endpoint Phantombuster (\u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430), \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0441\u0442\u043e\u0432 \u0441\u043e \u0441\u043a\u0438\u0434\u043a\u0430\u043c\u0438.",
      "credentials": {
        "httpBasicAuth": "<your credential>"
      }
    },
    {
      "parameters": {
        "functionCode": "const results = items[0].json;\n\n// \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c, \u0447\u0442\u043e results \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u043e\u0441\u0442\u043e\u0432 \u0432 \u043f\u043e\u043b\u0435 data.\n// \u041c\u0435\u043d\u044f\u0435\u043c \u043f\u043e\u0434 \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.\n\nconst filtered = [];\n\nif (results.data && Array.isArray(results.data)) {\n  for (const post of results.data) {\n    // \u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430: \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0441\u043b\u043e\u0432\u0430 \"\u0441\u043a\u0438\u0434\u043a\u0430\"\n    if (post.text && post.text.toLowerCase().includes('\u0441\u043a\u0438\u0434\u043a\u0430')) {\n      filtered.push({ json: post });\n    }\n  }\n}\n\nreturn filtered;\n"
      },
      "name": "Filter Discounts (Function)",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        680,
        300
      ],
      "notes": "\u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u043c\u0443 \u0441\u043b\u043e\u0432\u0443 '\u0441\u043a\u0438\u0434\u043a\u0430'. \u041c\u043e\u0436\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442\u044c (AI, sentiment)."
    },
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "=https://YOUR-SUPERBAS-PROJECT.rest.supabase.co/rest/v1/discounts",
        "jsonParameters": true,
        "options": {},
        "bodyParametersJson": "={\n  \"post_id\": $json[\"id\"],\n  \"post_text\": $json[\"text\"],\n  \"image_url\": $json[\"image\"] || null,\n  \"likes\": $json[\"likes\"] || 0,\n  \"comments\": $json[\"comments\"] || 0,\n  \"status\": \"pending\"\n}"
      },
      "name": "Save to SuperBas (Supabase)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        900,
        300
      ],
      "notes": "\u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 discounts (\u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0435\u0451 \u0432 Supabase).",
      "credentials": {
        "httpBasicAuth": "<your credential>"
      }
    },
    {
      "parameters": {
        "chatId": "YOUR_TELEGRAM_CHAT_ID",
        "text": "=\u0421\u043a\u0438\u0434\u043a\u0430 \u043d\u0430\u0439\u0434\u0435\u043d\u0430!\n\u0422\u0435\u043a\u0441\u0442: {{$json[\"text\"]}}\n\n\u041e\u0434\u043e\u0431\u0440\u0438\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e?\n\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 /approve_{{$json[\"id\"]}} \u0438\u043b\u0438 /reject_{{$json[\"id\"]}}",
        "additionalFields": {}
      },
      "name": "Notify Telegram",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1,
      "position": [
        1120,
        300
      ],
      "notes": "\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0432 \u0422\u0435\u043b\u0435\u0433\u0440\u0430\u043c. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 /approve_xxx \u0438\u043b\u0438 /reject_xxx \u0434\u043b\u044f \u043e\u0442\u043a\u043b\u0438\u043a\u0430."
    },
    {
      "parameters": {
        "updateMode": "append",
        "options": {}
      },
      "name": "Wait Telegram Response",
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1,
      "position": [
        1120,
        520
      ],
      "notes": "\u041e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f/\u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0442\u0438\u043f\u0430 /approve_xxx /reject_xxx."
    },
    {
      "parameters": {
        "functionCode": "const text = items[0].json.message.text;\n\n// \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u043a\u0430\u043a\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430: /approve_123 \u0438\u043b\u0438 /reject_123\n// \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c post_id\nconst approveMatch = text.match(/^\\/approve_(\\d+)/);\nconst rejectMatch = text.match(/^\\/reject_(\\d+)/);\n\nif (approveMatch) {\n  return [{ json: { action: 'approve', postId: approveMatch[1] } }];\n} else if (rejectMatch) {\n  return [{ json: { action: 'reject', postId: rejectMatch[1] } }];\n} else {\n  // \u0415\u0441\u043b\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u0440\u0443\u0433\u0430\u044f \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u043c\n  return [];\n}\n"
      },
      "name": "Parse Telegram Command",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        1120,
        700
      ],
      "notes": "\u041f\u0430\u0440\u0441\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 (approve / reject) + postId."
    },
    {
      "parameters": {
        "requestMethod": "PATCH",
        "url": "=https://YOUR-SUPERBAS-PROJECT.rest.supabase.co/rest/v1/discounts?id=eq.{{$json[\"postId\"]}}",
        "jsonParameters": true,
        "options": {},
        "bodyParametersJson": "={\n  \"status\": \"{{$json[\"action\"]}}\"\n}"
      },
      "name": "Update Status in SuperBas",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        1380,
        700
      ],
      "notes": "\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441 \u0432 Supabase (approve/reject)."
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$json[\"action\"]}}",
              "operation": "equal",
              "value2": "approve"
            }
          ]
        }
      },
      "name": "IF Approved?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        1380,
        520
      ],
      "notes": "\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u043e\u0434\u043e\u0431\u0440\u0435\u043d\u0430 \u043b\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f."
    },
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "=https://api.your-auto-post-service.com/publish",
        "jsonParameters": true,
        "options": {},
        "bodyParametersJson": "={\n  \"post_id\": \"={{$json[\"postId\"]}}\",\n  \"message\": \"\u0421\u0443\u043f\u0435\u0440 \u0441\u043a\u0438\u0434\u043a\u0430!\",\n  \"image_url\": \"...\",\n  \"instagram_account\": \"...\"\n}"
      },
      "name": "Publish Post (AutoPost Svc)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        1580,
        520
      ],
      "notes": "\u0417\u0430\u0433\u043b\u0443\u0448\u043a\u0430: \u0442\u0443\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c Buffer / Later / \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 endpoint.\n\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u0441\u0442 (id, \u0442\u0435\u043a\u0441\u0442, \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443) \u043d\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e."
    }
  ],
  "connections": {
    "Cron Trigger": {
      "main": [
        [
          {
            "node": "Get Discounts Posts (Phantombuster)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Discounts Posts (Phantombuster)": {
      "main": [
        [
          {
            "node": "Filter Discounts (Function)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Discounts (Function)": {
      "main": [
        [
          {
            "node": "Save to SuperBas (Supabase)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Notify Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Telegram Response": {
      "main": [
        [
          {
            "node": "Parse Telegram Command",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Telegram Command": {
      "main": [
        [
          {
            "node": "Update Status in SuperBas",
            "type": "main",
            "index": 0
          },
          {
            "node": "IF Approved?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Approved?": {
      "main": [
        [
          {
            "node": "Publish Post (AutoPost Svc)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "id": "DISCOUNTS_AUTOPOST_EXAMPLE"
}

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

Discounts_AutoPublish_Workflow. Uses httpRequest, telegram, telegramTrigger. Scheduled trigger; 10 nodes.

Source: https://gist.github.com/Qwerty55555sa5/2923e82b7506f8da349b5df45caf2021 — 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

Dobby. Uses httpRequest, telegramTrigger, telegram. Scheduled trigger; 18 nodes.

HTTP Request, Telegram Trigger, Telegram
Slack & Telegram

Send A Random Recipe Once A Day To Telegram. Uses airtable, telegram, httpRequest, telegramTrigger. Scheduled trigger; 15 nodes.

Airtable, Telegram, HTTP Request +1
Slack & Telegram

This telegram bot is designed to send one random recipe a day.

Airtable, Telegram, HTTP Request +1
Slack & Telegram

This n8n template demonstrates how to automatically fetch upcoming movie releases from TMDB and let users add selected movies to their Google Calendar directly from Telegram. On a daily schedule, the

HTTP Request, Data Table, Telegram +2
Slack & Telegram

Renta Vehículos Workflow. Uses telegram, telegramTrigger, googleDrive, httpRequest. Scheduled trigger; 10 nodes.

Telegram, Telegram Trigger, Google Drive +2