Guard AI agent Postgres writes using OpenAI, FirstHelm, and Slack approvals
Ready for 3.0What this workflow does
This AI workflow has 25 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects OpenAI, Postgres and Slack. It also calls firsthelm.dev over HTTP.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Set Write Request Details (Edit Fields (Set)): sets 4 fields: instruction, requested_by, environment…
- Log DB Write Request (HTTP Request): calls firsthelm.dev (POST)
- OpenAI: uses OpenAI
- Validate SQL Against Allowlist (Code): runs custom JavaScript code
- If: checks a condition and branches into true / false
- Post Constraint Evaluation Request (HTTP Request): calls firsthelm.dev (POST)
- Respond to Failed Validation (Respond to Webhook): sends the response back to the webhook caller
- Parse Policy Verdict (Code): runs custom JavaScript code
- Log Failed Validation Audit (HTTP Request): calls firsthelm.dev (POST)
- If: checks a condition and branches into true / false
…plus 14 more steps. See the full node list below.
Services it uses
Other OpenAI + Slack templates (979) · Other OpenAI + PostgreSQL templates (191) · Other PostgreSQL + Slack templates (109)
HTTP calls to: firsthelm.dev
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 (10)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - HTTP Request
n8n-nodes-base.httpRequest - OpenAI
@n8n/n8n-nodes-langchain.openAi - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Postgres
n8n-nodes-base.postgres - Respond to Webhook
n8n-nodes-base.respondToWebhook - Slack
n8n-nodes-base.slack - Wait
n8n-nodes-base.wait
From the author
Quick overview Your agent can propose a SQL write; this workflow makes sure it never runs one it shouldn't. A deterministic allowlist check, a FirstHelm policy gate and a human approval step sit between the model and Postgres. Nothing destructive executes…