Create Secure Human-in-the-Loop Approval Flows with Postgres and Telegram
π Human-in-the-Loop Approval Flow (n8n + Postgres + Telegram)
π₯ Whoβs it for
Teams that need a manager approval step before a ticket or request can change status. Great for internal ops, IT requests, or any workflow where βa human must sign off.β
β‘ What it does
π¨ Manager receives approval/reject link
π Link is signed with HMAC + expiry (secure & tamper-proof)
ποΈ Postgres updates the ticket status
π Audit trail records every decision
π² Telegram notifies both manager and requester
β° Expired or invalid links trigger alerts and logs
π Requirements
n8n instance (self-hosted)
Postgres database (with tickets, ticket_audit, workflow_errors)
Telegram bot token
One environment variable set: SECRET_KEY
βοΈ How to set up
Set SECRET_KEY in .env
Create Postgres tables (SQL provided)
Add Telegram + Postgres credentials in n8n
Import the workflow JSON
Test by opening an approval/reject link in your browser
π¨ How to customize
Change who the βmanagerβ is (currently hardcoded in the Code node).
Swap Telegram for Slack or email notifications.
Extend the audit schema to include more metadata (IP, username).
Related Templates
Track Expenses by Parsing Telegram Transaction Messages to Google Sheets
Overview This n8n workflow template automatically parses incoming Telegram transaction messages and logs structured dat...
Automated Work Attendance with Location Triggers
his workflow automates time tracking using location-based triggers. How it works Trigger: It starts when you enter or e...
Send Daily Weather Forecasts from OpenWeatherMap to Telegram with Smart Formatting
π€οΈ Daily Weather Forecast Bot A comprehensive n8n workflow that fetches detailed weather forecasts from OpenWeatherMap...
π Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments