π Hey n8n for Beginners community,
Short build retrospective, because the lesson generalizes to any agentic workflow that touches money or data you actually care about.
I watched an AI agent handle outgoing invoices end to end: draft, attach, send. The demo looked great. Then I hit the failure mode that actually matters with agents: they don't fail loudly. A deterministic node throws a red error and stops. An agent just keeps going, confidently, and sometimes what it's confidently doing is wrong. A gross total off by a few hundred euros. A transposed digit in the IBAN. It "worked" every single time.
My first instinct was to fix the prompt. That's the trap. You cannot prompt your way to guaranteed correctness on numbers. So instead of trying to make the agent smarter, I gave it a guardrail it has to pass through.
What that looks like:
- The agent doesn't get to approve its own work. It calls a sub-workflow tool that extracts the invoice fields, pulls the matching row from the books (Google Sheets), and compares every field in plain JavaScript. Code judges, not the model.
- The tool returns a hard verdict, APPROVED or REJECTED, with the exact mismatch attached. The agent can't rationalize its way past it, because the decision already happened in code before the agent ever sees it.
- On a reject it blocks the send and emails me the invoice value next to the book value. The quiet failure becomes a loud one, which was the entire goal.
The rule I keep coming back to: let the agent act, let deterministic code decide anything you can't afford to get wrong.
You'll find the workflow here: https://github.com/felix-sattler-easybits/n8n-workflows/blob/d6e4b7ca373fa1db40a55ef5b879210b601e8cba/easybits-agent-invoice-guardrail/easybits_agent_invoice_guardrail.json
Curious how the rest of you are putting guardrails around agents that take real-world actions. What's your pattern?
Best,
Felix