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

Nodes

ccc8d19f-f0b3-4730-899f-8023aeb547e47a48708c-bd3b-409b-837b-b599c5bcd7e62e3e39e3-0e17-4fae-9ac5-9ee31f9711ed5538bde0-49bb-4e2f-8501-dd5ee606606a8299733a-9057-42af-8045-2a3bdf88dde3+1

Created by

AnAndrew

Last edited 39 days ago

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.

New to n8n?

Need help building new n8n workflows? Process automation for you or your company will save you time and money, and it's completely free!