Authorize AI agent actions with Postgres, Slack, and PagerDuty alerts
Ready for 3.0What this workflow does
This workflow has 16 nodes and runs when an HTTP POST request hits its webhook URL (plus 2 other triggers). Along the way it connects Postgres.
How it runs
Trigger: When an HTTP POST request hits its webhook URL (plus 2 other triggers).
- Postgres: run a query
- Postgres: run a query
- Code: runs custom JavaScript code
- Code: runs custom JavaScript code
- Code: runs custom JavaScript code
- Postgres: run a query
- Code: runs custom JavaScript code
- If: checks a condition and branches into true / false
- HTTP - Notify Slack (HTTP Request): calls an HTTP API (POST)
- Respond - Decision (Respond to Webhook): sends the response back to the webhook caller
…plus 2 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (9)
- Webhook
n8n-nodes-base.webhook - Schedule Trigger
n8n-nodes-base.scheduleTrigger - Manual Trigger
n8n-nodes-base.manualTrigger - Postgres
n8n-nodes-base.postgres - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - HTTP Request
n8n-nodes-base.httpRequest - Respond to Webhook
n8n-nodes-base.respondToWebhook - No Operation, do nothing
n8n-nodes-base.noOp
From the author
Quick overview This workflow exposes a webhook-based policy-as-code authorization service that evaluates AI agent action requests against prioritized rules stored in Postgres, logs every decision for auditing, and optionally sends Slack and PagerDuty alerts…