If you’re running AI workflows in production — a chatbot, a lead qualifier, anything that acts on user input — the happy path skips two things you actually need: nothing dangerous should reach your AI, and nothing duplicated or malformed should reach your downstream systems or your team.
This is a free, self-contained demo that shows both, composed into one flow — no credentials, runs entirely in Code nodes.
What it does (three layers, one execution)
- Security layer (before the AI): screens the inbound message — redacts PII, blocks prompt injection and secrets — before your model ever sees it
- Mock AI: a deterministic stand-in that qualifies the lead, so the whole thing runs with no API key
- Reliability layer (before handoff): de-duplicates the resulting event so the same lead isn’t processed twice or handed to your team as “new”
Try it
Import the workflow below, click Execute Workflow, and read the Composed Handoff Decision node:
- First run: PII redacted → fresh lead → HANDOFF APPROVED
- Run it again: the exact duplicate is caught → HELD AT RELIABILITY
- Swap the input for a prompt-injection (or paste a credit-card number) → STOPPED AT SECURITY, before the AI
Built to be deterministic
- Code nodes only — no LLM calls, no credentials, same input → same decision
- No external dependencies; import and run
The full workflow (free, no credentials) — copy the JSON below and import into n8n:
Feedback welcome — fork it and adapt it. If an input slips past a layer, drop a comment.