Templates / Guard AI agent Postgres writes using OpenAI, FirstHelm, and Slack approvals

Guard AI agent Postgres writes using OpenAI, FirstHelm, and Slack approvals

Ready for 3.0

by Jason Bullen ✓ · 1 views · created 2026-10-29 · DevOps, AI Chatbot

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

📬 Weekly n8n 3.0 breakage alerts, free

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

  1. Set Write Request Details (Edit Fields (Set)): sets 4 fields: instruction, requested_by, environment…
  2. Log DB Write Request (HTTP Request): calls firsthelm.dev (POST)
  3. OpenAI: uses OpenAI
  4. Validate SQL Against Allowlist (Code): runs custom JavaScript code
  5. If: checks a condition and branches into true / false
  6. Post Constraint Evaluation Request (HTTP Request): calls firsthelm.dev (POST)
  7. Respond to Failed Validation (Respond to Webhook): sends the response back to the webhook caller
  8. Parse Policy Verdict (Code): runs custom JavaScript code
  9. Log Failed Validation Audit (HTTP Request): calls firsthelm.dev (POST)
  10. If: checks a condition and branches into true / false

…plus 14 more steps. See the full node list below.

Services it uses

OpenAIPostgresSlack

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.

Check at runtime on n8n 3.0
  • Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Informational: a static scan can't see the data, so test these on your own instance. Status above is unchanged.

Nodes used (10)

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…

Excerpt from Jason Bullen's description on n8n.io.

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.