Templates / Route human-in-the-loop approval requests with Slack and Postgres

Route human-in-the-loop approval requests with Slack and Postgres

Ready for 3.0

by Mychel Garzon ✓ · 95 views · created 2026-06-27 · Document Extraction

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

Nodes used (6)

SlackPostgres

What it does

Quick overview This workflow exposes a single webhook that either accepts new approval requests or handles Slack button callbacks, posting interactive Slack Block Kit messages and recording decisions in a PostgreSQL table. How it works 1. Receives a POST request on a webhook endpoint that serves as both the intake API and the Slack interactivity callback URL. 2. Validates the Slack request signature and timestamp when the request includes Slack signature headers. 3. Routes the request by detecting whether it contains a URL-encoded Slack payload (callback) or a custom intake body (new request). 4. For intake requests, builds a Slack Block Kit approval message with Approve/Reject/Flag buttons and posts it to Slack. 5. Stores the request context, Slack channel ID, and message timestamp in PostgreSQL and returns a 200 response with the generated requestId. 6. For Slack button callbacks, immediately returns a 200 response to Slack, looks up the request context in PostgreSQL, and merges it with the callback details. 7. Updates the original Slack message to replace buttons with a static decision status and writes the decision (approved/rejected/flagged) back to PostgreSQL. Setup 1. Create the approvalrequests table in your Postgres or Supabase instance 2. Add your Postgres credentials and your Slack Bot Token (ensure the token has the chat:write scope). 3. In your n8n environment variables, add your Slack App's Signing Secret as SLACKSIGNINGSECRET and your target channel as SLACKCHANNELID. 4. Activate the workflow and copy the Production Webhook URL. 5. Paste this URL into your Slack App under Interactivity & Shortcuts → Request URL. Use this exact same URL as the target POST endpoint for your upstream systems to submit new approvals. Requirements - A Postgres or Supabase database instance. - A Slack App with Interactive Components enabled and a Bot Token. Customization - Modify the "Create Slack Block Message" node to add dynamic fields, amounts, or internal company links to the approval UI. - Extend the final "Determine Next Action Taken" Switch node to trigger CRM updates, email confirmations, or trigger agentic LLM workflows based on the 'approve', 'reject', or 'flag' outcomes.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.