Skip to main content

Lightweight support desk with Telegram and Postgres database tracking

Workflow preview

Workflow preview
100%
Lightweight support desk with Telegram and Postgres database tracking preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Telegram ticket intake and status tracking with Postgres Who’s it for Anyone running support requests through Telegram, Email, Webhooks, and so on who needs a lightweight ticketing system without p...

Best for

  • Content Creation automation workflows
  • Ticket Management automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.telegramtrigger, n8n-nodes-base.switch, n8n-nodes-base.code, n8n-nodes-base.postgres, n8n-nodes-base.telegram, n8n-nodes-base.if, 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 Mohammad.

Original n8n.io source

1.1 Workflow description

Title
Lightweight support desk with Telegram and Postgres database tracking
Workflow name
Lightweight support desk with Telegram and Postgres database tracking

Telegram ticket intake and status tracking with Postgres

Who’s it for

Anyone running support requests through Telegram, Email, Webhooks, and so on who needs a lightweight ticketing system without paying Zendesk prices. Ideal for small teams, freelancers, or businesses that want tickets logged in a structured database (Postgres) and tracked automatically. I'm using Telegram since it's the most convenient one.

How it works / What it does

This workflow turns (Telegram) into a support desk:

  1. Receives new requests via a Telegram bot command.
  2. Creates a ticket in a Postgres database with a correlation ID, requester details, and status.
  3. Auto-confirms back to the requester with the ticket ID.
  4. Provides ticket updates (status changes, resolutions) when queried.
  5. Keeps data clean using dedupe keys and controlled input handling.

How to set up

  1. Create a Telegram bot using @BotFather and grab the token.
  2. Connect your Postgres database to n8n and create a tickets table:
CREATE TABLE tickets (
  id BIGSERIAL PRIMARY KEY,
  correlation_id UUID,
  source TEXT,
  external_id TEXT,
  requester_name TEXT,
  requester_email TEXT,
  requester_phone TEXT,
  subject TEXT,
  description TEXT,
  status TEXT,
  priority TEXT,
  dedupe_key TEXT,
  chat_id TEXT,
  created_at TIMESTAMP DEFAULT NOW(),
  updated_at TIMESTAMP DEFAULT NOW()
);
  1. Add your Telegram and Postgres credentials in n8n (via the Credentials tab, not hardcoded).
  2. Import the workflow JSON and replace the placeholder credentials with yours.
  3. Test by sending /new in Telegram and follow the prompts.

Requirements

  • n8n (latest version recommended)
  • Telegram bot token
  • Postgres instance (local, Docker, or cloud)

How to customize the workflow

  • Change database fields if you need more requester info.
  • Tweak the Switch node and Comands for multiple status types.
  • Extend with Slack, Discord, or email nodes for broader notifications.
  • Integrate with external systems (CRM, project management) by adding more branches.

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 - 01 Telegram Trigger: Intake + Status

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

Block 2 - 02 Switch: Route by Command

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

Block 3 - 03a FN: Normalize + Hash

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

Block 4 - 04a DB: Upsert Ticket

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

Block 5 - 05a Telegram Ack

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

Block 6 - 03b FN: Parse Status Command

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

Block 7 - 04b DB: Get Ticket Status

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

Block 8 - 05b Telegram: Status Reply

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

Block 9 - 03b1 IF: Has Correlation ID

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

Block 10 - 05b Telegram: Status Reply (Error)

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

Block 11 - Telegram: Invalid Command

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

Block 12 - 03c FN: Parse Update Command

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

Block 13 - 03c1 IF: Has Correlation ID

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

Block 14 - Send a text message

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

Block 15 - 03c2 IF: Valid Status

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

Block 16 - 05c Telegram: Invalid Status

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

Block 17 - 04c DB: Update Ticket Status

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

Block 18 - 03c0 IF: Is Operator

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

Block 19 - 05c0 Telegram: Unauthorized Update Attempt

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

Block 20 - 04c1 DB: Get Ticket Owner

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

Block 21 - 04b1 IF: Ticket Belongs To User

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

Block 22 - 05b1 Telegram: Unauthorized Status Check

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

Block 23 - 04c1a IF: Resolved or In Progress

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

Block 24 - 05c1a Telegram: Notify Resolved

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

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

3. Summary Table

Workflow Lightweight support desk with Telegram and Postgres database tracking
Complexity advanced
Nodes 45
Categories Content Creation, Ticket Management
Author Mohammad
Published 20 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8789/8789.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 Lightweight support desk with Telegram and Postgres database tracking do?

Telegram ticket intake and status tracking with Postgres Who’s it for Anyone running support requests through Telegram, Email, Webhooks, and so on who needs a lightweight ticketing system without p...

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 Content Creation, Ticket Management use case.