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...
Template notes
π 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, ticketaudit, workflowerrors) - Telegram bot token - One environment variable set: SECRETKEY
βοΈ How to set up 1. Set SECRETKEY in .env 2. Create Postgres tables (SQL provided) 3. Add Telegram + Postgres credentials in n8n 4. Import the workflow JSON 5. 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).