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 OpenAI Token Usage and AI Agent Metrics with Google Sheets Dashboard
What it does Captures token usage and cost from your AI Agent/LLM. Logs model, tokens, cost, tool use, and conversation ...
Lookup IP Geolocation Details with IP-API.com via Webhook
This n8n template enables you to instantly retrieve detailed geolocation information for any given IP address by simply ...
Send Hourly Crypto Market Analysis from Binance to Telegram
π Daily Crypto Market Summary Bot (Binance to Telegram) This workflow fetches 24h price change data from Binance for s...
π Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments