AutomationFlowsSlack & Telegram › Automate Telegram Channel Posts Using Postgres (module "cross-posting")

Automate Telegram Channel Posts Using Postgres (module "cross-posting")

ByAndrew @boanse on n8n.io

This template is ideal for users managing Telegram channels who want to automate the process of posting messages, including text and images, directly from an bot.

Event trigger★★★★★ complexity47 nodesTelegram TriggerPostgresTelegram
Slack & Telegram Trigger: Event Nodes: 47 Complexity: ★★★★★ Added:

This workflow corresponds to n8n.io template #3614 — we link there as the canonical source.

This workflow follows the Telegram → Telegram Trigger 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
{
  "id": "3m4RmGRaROTWw0HS",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "TG-Bot-Module-Cross_Posting-v1-db-sell-full",
  "tags": [
    {
      "id": "EwFGeL3ePPNgm0R7",
      "name": "telegram",
      "createdAt": "2025-02-10T18:10:47.435Z",
      "updatedAt": "2025-02-10T18:10:47.435Z"
    },
    {
      "id": "XPad0ERjSdqfxG52",
      "name": "module",
      "createdAt": "2025-03-31T08:11:00.151Z",
      "updatedAt": "2025-03-31T08:11:00.151Z"
    },
    {
      "id": "2ocrWSzdKoCOU2AC",
      "name": "sell",
      "createdAt": "2025-04-19T15:39:51.859Z",
      "updatedAt": "2025-04-19T15:39:51.859Z"
    }
  ],
  "nodes": [
    {
      "id": "a7bca41e-ffae-4fbb-99ed-1326834ddd5d",
      "name": "Variables TG",
      "type": "n8n-nodes-base.set",
      "position": [
        80,
        -140
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "61767f36-0f76-4a96-ab15-56aa3bc37881",
      "name": "Initialization",
      "type": "n8n-nodes-base.set",
      "position": [
        320,
        -140
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "0b89e490-8518-471b-aa8c-f097a28ff83d",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -140,
        -140
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "0bc07dff-a624-4c29-8327-0b7bff57c150",
      "name": "Select Channels",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1480,
        -140
      ],
      "parameters": {},
      "typeVersion": 2.6
    },
    {
      "id": "1c902af0-1f96-46c0-94db-ece5b937955d",
      "name": "Is Admin?",
      "type": "n8n-nodes-base.if",
      "position": [
        540,
        -140
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "de2d68d1-1c60-4ac6-916d-38a9ea334320",
      "name": "Add Channel",
      "type": "n8n-nodes-base.postgres",
      "onError": "continueErrorOutput",
      "position": [
        1480,
        -740
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "cdae9e24-c42f-4f2d-ae30-2c7940031490",
      "name": "Get Bot Status",
      "type": "n8n-nodes-base.postgres",
      "position": [
        760,
        -340
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "2cd05fd6-b798-4017-8e36-88fd83143f50",
      "name": "Define flow",
      "type": "n8n-nodes-base.switch",
      "position": [
        980,
        -460
      ],
      "parameters": {},
      "typeVersion": 3.2,
      "alwaysOutputData": false
    },
    {
      "id": "f335a4e1-aa19-4122-abcb-fa2a660c7cdf",
      "name": "Commands",
      "type": "n8n-nodes-base.switch",
      "position": [
        1260,
        -1220
      ],
      "parameters": {},
      "retryOnFail": false,
      "typeVersion": 3.2
    },
    {
      "id": "6682aef5-5b37-4b48-babf-556e582d7101",
      "name": "Channel Exists",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        -740
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "7a36302d-4a37-49e2-82d6-7e2bcb6f38d2",
      "name": "Request Add Channel",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        -1540
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "c72ed6b3-8d6b-4b48-a97a-7dad06d18682",
      "name": "Request Delete Channel",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        -1340
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "2757870e-e7fe-4c7c-9fe6-97cc56155ec4",
      "name": "Request New Delete Channel",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        -540
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 1.2
    },
    {
      "id": "e93c1544-670d-4334-a32f-cde3fb323b33",
      "name": "Request New Add Channel",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        -940
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "6ee36bc2-8cf2-41ee-a7f6-5e1b49c7ea4f",
      "name": "Channel Not Exists",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        -340
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "83fcaa57-ed1b-4aa7-99e3-f81d7226e4d3",
      "name": "Delete Channel",
      "type": "n8n-nodes-base.postgres",
      "onError": "continueRegularOutput",
      "position": [
        1480,
        -540
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "e8f24107-14db-4b04-8c4e-84e3cc78ab7e",
      "name": "Get Channels ",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1480,
        -1140
      ],
      "parameters": {},
      "typeVersion": 2.5,
      "alwaysOutputData": true
    },
    {
      "id": "ef44ee6a-b8e3-4919-a8ec-048744444b45",
      "name": "Add Divide Channels",
      "type": "n8n-nodes-base.summarize",
      "position": [
        1700,
        -1140
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "427f077c-fe69-4b33-867b-657dd60fea18",
      "name": "Channels",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        -1140
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 1.2
    },
    {
      "id": "d660dfa0-a708-45ba-ad02-a3984015a2c6",
      "name": "Define Type",
      "type": "n8n-nodes-base.switch",
      "position": [
        540,
        -380
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "3a9175c0-ed95-44ff-bd31-ff8413d88d3b",
      "name": "Get Channels  ",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1260,
        -340
      ],
      "parameters": {},
      "typeVersion": 2.5,
      "alwaysOutputData": true
    },
    {
      "id": "13e83abd-4baf-4ab7-b07b-85120bda8939",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        1480,
        -340
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "b89da002-4ddc-4518-8211-ebf0ad69f197",
      "name": "Upsert bot status on START",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2140,
        -1740
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "d216d87f-6669-4d79-bee1-9798b1e89eb2",
      "name": "Buttons",
      "type": "n8n-nodes-base.switch",
      "position": [
        980,
        -1940
      ],
      "parameters": {},
      "typeVersion": 3.2,
      "alwaysOutputData": false
    },
    {
      "id": "fea2d8b6-4d06-4c06-96e1-cf9649bad22e",
      "name": "Update bot status on ADD CHANNEL",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2140,
        -1540
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "a27124ca-3270-4fb3-87a6-6a9cacd5a0a0",
      "name": "Update bot status on DELETE CHANNEL",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2140,
        -1340
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "13d55ebf-5a73-4a02-9ec2-94fb223b2a46",
      "name": "Success Send Post",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        -140
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 1.2
    },
    {
      "id": "1ed13ae9-6aff-4b5a-8350-115ba6f7d067",
      "name": "Update bot status on START ",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1260,
        -140
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "e5f6c9fa-a040-4f5f-afaf-f6a961d45179",
      "name": "Welcome Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        -1740
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "2fcc98fc-a040-4687-ba65-3ce4a633b287",
      "name": "Update bot status on POST TEXT REQUEST",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2140,
        -1940
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "76242590-48c7-4c30-b022-5c116ae10d9c",
      "name": "Request Post Text",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        -1940
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "5fc877af-d50e-4125-a880-deaa77b5dc34",
      "name": "Request Post Image Text",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        -2140
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "7ffa1597-50a0-4cb6-bedf-f364fb3c6ac9",
      "name": "Update bot status on POST IMAGE REQUEST TEXT",
      "type": "n8n-nodes-base.postgres",
      "position": [
        2140,
        -2140
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "4515b82a-e42f-4c36-a808-831702862d0e",
      "name": "Update bot status on POST IMAGE REQUEST IMAGE",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1260,
        60
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "cd08a0b8-1af2-4a16-8859-33408fa41f0d",
      "name": "Select Channels ",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1480,
        260
      ],
      "parameters": {},
      "typeVersion": 2.6
    },
    {
      "id": "0b778c0a-0966-4bef-8300-0b50fb608131",
      "name": "Request Post Image Image",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        60
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "d3edced1-3957-49ab-a844-e1b5d267a3fb",
      "name": "Success Send Post Image",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2140,
        260
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 1.2
    },
    {
      "id": "ce28cb11-8ffe-490d-9ec0-0a22c4556172",
      "name": "Update bot status on START  ",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1260,
        260
      ],
      "parameters": {},
      "typeVersion": 2.5
    },
    {
      "id": "ff3156da-186e-4799-91fc-19707648112a",
      "name": "If1",
      "type": "n8n-nodes-base.if",
      "position": [
        1700,
        260
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "4b4d39fb-ff75-47cf-ac6d-f4e655568bf7",
      "name": "Send Posts (4922)",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1700,
        -140
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "91146a01-ffe7-4df1-8929-5158623c91f0",
      "name": "Send Posts Image (4922)",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        260
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "6f13b321-742c-467e-957f-d3e69cd43c2c",
      "name": "Send Posts Image (4922) ",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1920,
        460
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "14b56b60-90ab-4acc-8641-b3ef0a7a1014",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        200
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "6a100ae0-0f27-4620-9df7-3b7d122b8020",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -420
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "36cae884-0392-4ab9-96e2-9b00fdd3c7a5",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -140
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "2b56999f-cacc-49d0-9f1a-6c5f8bb22cc3",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        200
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "c8df3d2c-cb65-46e3-b905-8405684ddafd",
      "name": "Upsert bot status on START ",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1920,
        -2320
      ],
      "parameters": {},
      "typeVersion": 2.5
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "744c1004-cb2f-4097-80be-76a6768db0f6",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Delete Channel",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Channel Not Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "Send Posts Image (4922)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Posts Image (4922) ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Buttons": {
      "main": [
        [
          {
            "node": "Upsert bot status on START ",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Request Post Image Text",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Request Post Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Commands": {
      "main": [
        [],
        [
          {
            "node": "Welcome Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Request Add Channel",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Request Delete Channel",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Channels ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Admin?": {
      "main": [
        [
          {
            "node": "Define Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Channel": {
      "main": [
        [
          {
            "node": "Request New Add Channel",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Channel Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Define Type": {
      "main": [
        [
          {
            "node": "Get Bot Status",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Buttons",
            "type": "main",
            "index": 0
          }
        ],
        [],
        [
          {
            "node": "Get Bot Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Define flow": {
      "main": [
        [
          {
            "node": "Commands",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Channel",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Channels  ",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update bot status on START ",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update bot status on POST IMAGE REQUEST IMAGE",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update bot status on START  ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Variables TG": {
      "main": [
        [
          {
            "node": "Initialization",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Channels ": {
      "main": [
        [
          {
            "node": "Add Divide Channels",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete Channel": {
      "main": [
        [
          {
            "node": "Request New Delete Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Bot Status": {
      "main": [
        [
          {
            "node": "Define flow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Channels  ": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initialization": {
      "main": [
        [
          {
            "node": "Is Admin?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Channels": {
      "main": [
        [
          {
            "node": "Send Posts (4922)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Welcome Message": {
      "main": [
        [
          {
            "node": "Upsert bot status on START",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Channels ": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Variables TG",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Request Post Text": {
      "main": [
        [
          {
            "node": "Update bot status on POST TEXT REQUEST",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Posts (4922)": {
      "main": [
        [
          {
            "node": "Success Send Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Divide Channels": {
      "main": [
        [
          {
            "node": "Channels",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Request Add Channel": {
      "main": [
        [
          {
            "node": "Update bot status on ADD CHANNEL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Request Delete Channel": {
      "main": [
        [
          {
            "node": "Update bot status on DELETE CHANNEL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Request Post Image Text": {
      "main": [
        [
          {
            "node": "Update bot status on POST IMAGE REQUEST TEXT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Posts Image (4922)": {
      "main": [
        [
          {
            "node": "Success Send Post Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Posts Image (4922) ": {
      "main": [
        [
          {
            "node": "Success Send Post Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update bot status on START ": {
      "main": [
        [
          {
            "node": "Select Channels",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update bot status on START  ": {
      "main": [
        [
          {
            "node": "Select Channels ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update bot status on POST IMAGE REQUEST IMAGE": {
      "main": [
        [
          {
            "node": "Request Post Image Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

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

About this workflow

This template is ideal for users managing Telegram channels who want to automate the process of posting messages, including text and images, directly from an bot.

Source: https://n8n.io/workflows/3614/ — 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 template is for developers and automation specialists looking to create a Telegram bot that enables users to select items from a predefined list and save their choices to a Postgres database.

Telegram, Postgres, Telegram Trigger
Slack & Telegram

This workflow is for Telegram bot developers or marketers who want to verify user subscriptions to specific Telegram channels and optionally reward them with downloadable files.

Telegram, Postgres, Google Drive +1
Slack & Telegram

This workflow is ideal for businesses or individuals who want to run Telegram-based giveaways that require users to subscribe to certain channels in order to participate.

Telegram, Postgres, Telegram Trigger
Slack & Telegram

Template was created in n8n v1.90.2 Chat Trigger node Telegram Trigger node Redis node Postgres node Execute Sub-workflow If node, Code node, Edit Fields (Set), Extract From File Community nodes: n8n-

Telegram Trigger, Chat Trigger, Telegram +3
Slack & Telegram

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Telegram Trigger, n8n, Telegram +4