Use this secure n8n workflow template to create HMAC-signed, time-limited approval links sent via Telegram. Logs all decisions in a Postgres database. This sophisticated n8n node setup ensures security and auditing for critical operations.
Download this n8n workflow template and start using it instantly.
Security-Conscious Organizations: Teams requiring cryptographically verified, time-limited approval steps. Operations & Audit Teams: Users needing a full audit trail of all manual decisions (approvals, rejections, expirations) logged in a database.* Automation Specialists: Developers looking for a robust, production-ready n8n workflow example demonstrating secure webhook handling and PostgreSQL interaction.
Critical business processes often require a human manager to approve or reject an automated action. This sophisticated n8n workflow solves the inherent security risk of simple approval links by enforcing high standards: HMAC signatures and Time-to-Live (TTL) expiration checks. When a manager clicks the link provided via Telegram, the n8n trigger immediately captures the request. Crucially, the workflow verifies the signature using a hidden SECRET_KEY environment variable. If valid and not expired, the workflow proceeds to update the ticket status in PostgreSQL, logs the transaction in an audit table, and notifies the original user via Telegram. This reliable n8n template ensures that every step is secure, auditable, and logged, providing peace of mind for high-stakes automations.
This secure n8n workflow is initiated by an external click on an approval link.
/approval).exp), and confirms the link has not expired. It determines the ultimate action (approve, reject, expired, or invalid).tickets table (04c DB: Update Ticket Status). A detailed audit record is then inserted into the ticketaudit table. Finally, the ticket owner's chat ID is retrieved, and they are notified via Telegram about the status change.Execute a SQL query1) and sends a confirmation notification via Telegram.04e/04i DB: Insert Audit) and an alert is sent to the administrators via Telegram, ensuring quick detection of security incidents. This detailed logging is a key feature of this reliable n8n workflow.workflowerrors table in Postgres for easy monitoring and debugging.To deploy this powerful n8n workflow template, follow these steps:
SECRETKEY=your-long-random-secret to your n8n deployment's environment file (.env) and restart n8n.tickets, ticketaudit, and workflowerrors tables created in your Postgres instance, as detailed in the sticky notes within the workflow structure.chatid placeholders (used for admin alerts on invalid attempts) with your actual Telegram manager IDs. The user-facing notifications use dynamic expressions like ={{ $json.chat_id }}.This n8n template leverages several powerful n8n node types for security and data handling:
01 Webhook Trigger: Approval Decision (Webhook):
Function: Serves as the entry point, listening for incoming decisions via the URL path /approval.
Key Configuration: Response data set to a simple acknowledgment message.
02 FN: Verify Signature + TTL (Code - Python):
Function: The core security n8n node. It verifies the HMAC signature and checks the Time-To-Live (TTL) of the link against the current time. It relies on the SECRETKEY environment variable.
Key Configuration: Uses standard Python libraries (hashlib, hmac, time, os.getenv) to perform cryptographic checks.
04c DB: Update Ticket Status (Postgres):
Function: Executes an UPDATE SQL command to change the status of the ticket based on the approval action.
Key Configuration: Uses expressions to dynamically inject the correlationid and the newstatus into the SQL query.
04c2 DB: Insert Audit Row / 04e DB: Insert Audit Expired / 04i DB: Insert Audit Invalid (Postgres):
Function: Dedicated Postgres n8n node instances responsible for logging every decision, rejection, expiry, or invalid attempt into the ticketaudit table, ensuring a complete audit trail for this n8n workflow.
05c Telegram: Update Confirmation (Telegram):
Function: Sends notifications to the relevant Telegram chat ID, confirming the action taken (e.g., status updated or rejection noted).
Key Configuration: Uses HTML Parse Mode for formatting the status updates.
Use this powerful n8n workflow to automatically sync lead data from Google Sheets, checking for existing Salesforce accounts and performing an upsert operation on contacts for perfect data hygiene.

Build a powerful Point of Sale (POS) system using n8n. This advanced n8n workflow logs sales to Google Sheets, generates dynamic AI reports via OpenRouter, and sends instant Telegram alerts, using custom HTML/JS interfaces.

Generate and publish highly optimized WordPress blog posts automatically. This powerful n8n workflow uses Perplexity, OpenAI, and Google Trends data for keyword research and content creation.

Automate secure data exchange for WhatsApp Flows using this specialized n8n workflow. Handle decryption and re-encryption with custom n8n node logic for maximum security.

Use this powerful n8n workflow to automatically create new Shopify customers by reading bulk customer data from a Google Sheet. Ideal for store migrations and bulk uploads.

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.







































