Use this powerful n8n workflow to build a complete support ticket system managed entirely through Telegram, backed by a PostgreSQL database. Perfect n8n templates for custom CRM and operations.
Download this n8n workflow template and start using it instantly.
Markdown-formatted text:
Small business owners needing a simple, consolidated support intake system.
Developers looking for advanced n8n templates utilizing Telegram and database integration.
Teams seeking to automate initial customer service interaction and ticket routing.
Users who want to leverage the core logic of an n8n workflow for custom CRM solutions.
This sophisticated n8n workflow transforms a Telegram bot and a PostgreSQL database into a fully functional, lightweight help desk solution. This complete n8n workflow allows external users to create new support tickets, check the status of existing tickets, and receive automatic notifications upon updates, all via simple Telegram commands.
The system handles four primary commands: /start, /new, /status, and operator-only commands like /update and /list. This n8n automation provides robust data handling, including parsing free-form text, generating unique correlation IDs, and implementing strict security checks to protect update and list functions. It’s an excellent example of leveraging complex n8n node logic and database integration to create reliable n8n templates for operational needs.
The process begins with the 01 Telegram Trigger: Intake + Status n8n trigger, which listens for any message directed to the connected bot. This n8n node immediately passes the incoming command to the 02 Switch: Route by Command node, which acts as the core flow control, splitting the n8n workflow based on the command.
/new): The data flows to the 03a FN: Normalize + Hash Code n8n node, which uses Python to parse the requester's details (Name, Email, Subject) from the message text, generates a UUID correlation ID, and calculates a deduplication key. This standardized data is then sent to the 04a DB: Upsert Ticket Postgres n8n node, which inserts the new record. An acknowledgment is returned via Telegram./status): The workflow parses the correlation ID. IF n8n nodes validate the ID format and presence. The 04b DB: Get Ticket Status Postgres n8n node retrieves the ticket details. Subsequent IF nodes ensure that only the original requester (based on Telegram Chat ID) can view the status before the 05b Telegram: Status Reply node sends the result./update): This critical path is secured by an IF n8n node (03c0 IF: Is Operator) checking if the user is an authorized operator. If authorized and the status is valid, the 04c DB: Update Ticket Status Postgres n8n node updates the record. The workflow then uses multiple Telegram n8n nodes to notify both the operator and the original customer of the change (e.g., Ticket Resolved notification)./list): Secured by the Check Admin IF n8n node, this command triggers the DB: List Tickets Postgres n8n node to fetch recent records, which are then formatted by a JavaScript Code n8n node and sent back to the admin via Telegram.Markdown-formatted text:
tickets, ticketaudit, and workflowerrors tables, along with the custom upsertticket stored function (details are in the Sticky Notes within the n8n template).YOURADMINID (in Check Admin node for /list access).YOUROPERATOR_ID (in 03c0 IF: Is Operator node for /update access).01 Telegram Trigger: Intake + Status n8n trigger is now live, waiting for incoming commands.Markdown-formatted text:
01 Telegram Trigger: Intake + Status (Telegram Trigger n8n node):
Function: Serves as the primary entry point and n8n trigger for the entire system, initiating the flow upon receiving any Telegram message.
Key Configuration: Configured to listen for message updates.
02 Switch: Route by Command (Switch n8n node):
Function: Routes the n8n workflow execution to distinct branches based on the first word of the message text (e.g., /new, /status).
03a FN: Normalize + Hash (Code n8n node - Python):
Function: Parses multi-line input text to extract structured data (Name, Email, Subject), generates a unique UUID correlationid, and computes a SHA-256 dedupekey for data integrity.
04a DB: Upsert Ticket (Postgres n8n node):
Function: Executes a complex SQL query utilizing a custom upsertticket function to atomically insert a new ticket or update an existing one based on the correlation ID.
04b DB: Get Ticket Status (Postgres n8n node):
Function: Retrieves the current status, subject, and timestamps for a specific ticket using its correlation ID, necessary for the /status check functionality.
03c0 IF: Is Operator (IF n8n node):
Function: Acts as a security gate, ensuring that only messages originating from the hardcoded YOUROPERATOR_ID are allowed to proceed to the update logic, restricting the /update command.
04c DB: Update Ticket Status (Postgres n8n node):
Function: Modifies the status column for a given ticket ID, serving as the central action for the operator update flow.
05a Telegram Ack (Telegram n8n node):
* Function: Sends formatted acknowledgment messages back to the user, including the crucial new correlation ID.
Use this powerful n8n workflow to automate UGC ad generation. Trigger creation via Telegram, leverage Google Gemini for scripts, and render videos using Kie.ai's Veo3.1 API.

Deploy an n8n workflow using the Multi-Channel Protocol (MCP) trigger to enable AI agents to perform MailerLite subscriber CRUD operations efficiently using pre-configured n8n nodes.

Use this powerful n8n workflow as an AI Tool to manage Clockify clients, projects, tasks, and time entries automatically. Leverage the n8n node ecosystem for AI task management.

Deploy a powerful, real-time Line chatbot using this advanced n8n workflow. Integrate Groq (Llama 3) for ultrafast AI responses and automate all messaging with this reusable n8n template.

Use this robust n8n workflow to implement instant auto-replies to Line messages using reply tokens and manage proactive push notification broadcasts. Learn how to use the HTTP Request n8n node for custom API integration.

Use this comprehensive n8n workflow template to automatically sync Linear project status and target dates to corresponding Productboard features, ensuring alignment across product and engineering teams. This n8n workflow includes status mapping and Slack notifications.

Automation consultant specializing in n8n workflows that save businesses time and reduce costs. Experienced in designing ticketing systems, email parsers, and integrations with Postgres, Telegram, and APIs. I publish workflows to help teams streamline operations and build internal efficiency.







































