n8n Guardian Gates: How Approval Workflows Prevent Agents from Sending the Wrong Invoice
An agent that drafts 60 client emails a month will eventually send one with the wrong amount. You cannot unsend an email to a customer. The standard workaround is to check every draft by hand, which turns a 10-minute automation into a 3-hour review session. The better pattern is a policy gate that separates draft generation from irreversible send actions. Let the agent read data, sort records,…
Small offices often draft 60 client emails per month, but inevitably one email contains the wrong amount. Undoing an email sent to a customer is impossible. Instead of manually checking every draft, a better solution is to implement a policy gate that separates draft generation from irreversible send actions. This ensures that the agent can read data, sort records, and compose text, while any action that affects a customer or deletes a record is blocked until a human approves it.
Using n8n and a third-party approval service called Guardian, you can enforce this policy. Guardian acts as a gate in front of the irreversible send action, returning one of three responses: Allowed, Needs approval, or Denied. The workflow continues to the send action only if Guardian returns Allowed, or pauses at the approval step if Guardian returns Needs approval or Denied.
To implement the approval gate, place a Guardian node between draft generation and the send action. The approval flow involves triggering the workflow with a schedule or webhook, having the agent draft the email using an LLM node, then sending the payload to the Guardian API for policy evaluation. The workflow branches based on Guardian's response, allowing the email to be sent if Allowed, pausing for approval if Needs approval, or denying and logging the action if Denied.
The Guardian policy is defined in JSON rules that match on payload fields. For client emails, the policy might include conditions for client vs. internal recipients and actions like send, delete, or update. The payload sent to Guardian should include all necessary information for a human reviewer without requiring additional queries to the CRM or accounting system.
If an approval request remains unanswered for 24 hours, Guardian supports timeout policies to auto-deny, auto-approve (for low-stakes actions), or escalate to a manager. In n8n, handle expiration by listening for Guardian's timeout webhook and logging the event, with the option to retry the approval request with a different reviewer if needed.
If a failure occurs after approval, such as a send action error, the approval token should be single-use. If the send fails, log the error and do not retry without a new approval to prevent accidental double-sends. State management is crucial—store drafts in the Guardian payload, an n8n database, or an external store like S3 or Redis, depending on draft size and scalability requirements. Finally, ensure observability by setting up logging and monitoring for workflow performance and approval outcomes.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.