Skip to main content

Telegram bot for item multi select and saving to Postgres (Module "Checkbox")

Workflow preview

Workflow preview
100%
Telegram bot for item multi select and saving to Postgres (Module "Checkbox") 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 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 Po...

Best for

  • Support Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

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

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
Telegram bot for item multi select and saving to Postgres (Module "Checkbox")
Workflow name
Telegram bot for item multi select and saving to Postgres (Module "Checkbox")

Who is this for?

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.

What problem is this workflow solving?

It provides a simple and efficient way to collect structured user input via Telegram and store it in a Postgres database, useful for inventory selection, order systems, or preference tracking.

What this workflow does

  • Displays a list of selectable options from a Postgres shop_list table in Telegram
  • Saves the user’s selection back to the database
  • Automatically deletes messages at each step to keep the chat clean

Setup

1. Create the required tables in Postgres
  • Replace "n8n" in the provided SQL script with the appropriate schema name for your database
  • Run the script to create the shop_list table
2. Add necessary credentials in n8n
  • Telegram: Connect your Telegram bot using the Bot Token
  • Postgres: Add your Postgres DB credentials to allow the workflow to read/write data

How to customize this workflow to your needs

  • Modify the shop_list table to include your specific options.
  • Adjust the Telegram messages and logic to match your use case.

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 - Send

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

Block 2 - Update message_id

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

Block 3 - Get message_id

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

Block 4 - Get Shop List

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

Block 5 - Add Shop List Choice

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

Block 6 - Get Shop List Choice

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

Block 7 - Update Shop List Choice

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

Block 8 - Edit

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

Block 9 - Convert statuses

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - Convert statuses and antistatuses

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - Variables TG

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

Block 12 - Initialization

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

Block 13 - Telegram Trigger

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

Block 14 - Welcome Message

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

Block 15 - Start?

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

Block 16 - Define Type

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

Block 17 - Switch

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

Block 18 - Results

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

Block 19 - Get Shop List Choices

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

Block 20 - New?

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

Block 21 - Add Order

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

Block 22 - Get Order

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

Block 23 - Get Order

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

Block 24 - Union Number with Text

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

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

3. Summary Table

Workflow Telegram bot for item multi select and saving to Postgres (Module "Checkbox")
Complexity advanced
Nodes 46
Categories Support Chatbot
Author Andrew
Published 21 Apr 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3648/3648.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 Telegram bot for item multi select and saving to Postgres (Module "Checkbox") do?

Who is this for? 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 Po...

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 Support Chatbot use case.