workflows.fit
Back to n8n workflows
n8n templateFreeBy Mohammad

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...

DevelopmentData & StorageCommunicationHITLCore NodesWebhookCodePostgres
Loading interactive preview...

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).