Templates / Production AI Playbook: Deterministic Steps & AI Steps (4 of 5)

Production AI Playbook: Deterministic Steps & AI Steps (4 of 5)

Needs changes

by Elvis Sarvia ✓ · 271 views · created 2026-03-04 · Engineering, AI Chatbot

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 11 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects Guardrails and OpenAI Chat Model.

How it runs

Trigger: When an HTTP POST request hits its webhook URL.

  1. Extract Text (Code): runs custom JavaScript code
  2. Input Guardrails (Guardrails): uses Guardrails, with model: Input Guardrails LLM
  3. AI - Generate Response (AI Agent): runs an AI agent, with model: OpenAI Chat Model
  4. Respond - Input Blocked (Respond to Webhook): sends the response back to the webhook caller
  5. Output Guardrails (Guardrails): uses Guardrails, with model: Output Guardrails LLM
  6. Respond - Safe Output (Respond to Webhook): sends the response back to the webhook caller
  7. Respond - Flagged Output (Fallback) (Respond to Webhook): sends the response back to the webhook caller

Services it uses

GuardrailsOpenAI Chat Model

Before you upgrade to n8n 3.0

1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:

  • AI Agent v1 (old agent modes) in AI - Generate Response (v1.7): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Removed in 3.0Replace with
AI Agent v1 (old agent modes)
AI - Generate Response (v1.7)
Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.

Nodes used (6)

From the author

Protect your workflows with n8n's native Guardrails node, placed before and after your AI step. The input guardrails catch jailbreak attempts and PII before they reach your model. The output guardrails scan AI responses for NSFW content and secret keys before…

Excerpt from Elvis Sarvia'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.