Skip to main content

Automate Telegram channel posts using Postgres (Module "Cross-Posting")

Workflow preview

Workflow preview
100%
Automate Telegram channel posts using Postgres (Module "Cross-Posting") preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Who is this for? 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. What problem is t...

Best for

  • Social Media automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.set, n8n-nodes-base.telegramtrigger, n8n-nodes-base.postgres, n8n-nodes-base.if, n8n-nodes-base.switch, n8n-nodes-base.telegram, n8n-nodes-base.summarize, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Andrew.

Original n8n.io source

1.1 Workflow description

Title
Automate Telegram channel posts using Postgres (Module "Cross-Posting")
Workflow name
Automate Telegram channel posts using Postgres (Module "Cross-Posting")

Who is this for?

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.

What problem is this workflow solving?

Manually posting content to multiple Telegram channels can be time-consuming and inconsistent. This workflow automates that process, enabling efficient and consistent content delivery to one or more channels.

What this workflow does

This workflow connects to a Postgres database to retrieve post content and automatically sends text or image posts to designated Telegram channels where the bot is an admin. It supports scheduling and content customization through the database.

Setup

1. Create the necessary tables in your Postgres database
  • Open the SQL script provided in the workflow.
  • Replace "n8n" with your actual schema name.
  • Run the script in your database to set up the required tables.
2. Add credentials
  • Telegram: Create and connect a bot, ensuring it has admin access to the target channels.
  • Postgres: Connect your Postgres instance using valid credentials.

How to customize this workflow to your needs

  • Modify the SQL script to match your specific table or schema naming conventions.
  • Adjust the content format or post frequency directly from your database.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Variables TG

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 2 - Initialization

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Telegram Trigger

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1.1

Block 4 - Select Channels

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 5 - Is Admin?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 6 - Add Channel

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 7 - Get Bot Status

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 8 - Define flow

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 9 - Commands

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 10 - Channel Exists

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 11 - Request Add Channel

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 12 - Request Delete Channel

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 13 - Request New Delete Channel

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 14 - Request New Add Channel

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 15 - Channel Not Exists

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 16 - Delete Channel

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 17 - Get Channels

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 18 - Add Divide Channels

Type / Role
n8n-nodes-base.summarize - summarize
Config choices
Version 1.1

Block 19 - Channels

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 20 - Define Type

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 21 - Get Channels

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 22 - If

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 23 - Upsert bot status on START

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 24 - Buttons

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Showing the first 24 of 47 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Automate Telegram channel posts using Postgres (Module "Cross-Posting")
Complexity advanced
Nodes 47
Categories Social Media
Author Andrew
Published 19 Apr 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3614/3614.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automate Telegram channel posts using Postgres (Module "Cross-Posting") do?

Who is this for? 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. What problem is t...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Social Media use case.