n8n workflows

Custom guardrails in n8n with one HTTP Request node.

n8n workflows send emails, update CRMs, and post messages on their own. Add a check before those steps: one HTTP Request node to Enforly and a Switch on the decision.

When to use Enforly instead of the built-in Guardrails node

n8n’s built-in Guardrails node covers common checks such as detecting personal data, jailbreak attempts, or specific keywords. Use it for those. Use Enforly when the rule is specific to your business and needs data from earlier nodes to evaluate: “only pay what the purchase order covers”, “don’t promise perks nobody approved”, “stop emails that change payment details”.

The two work together: run the built-in checks first, then send the item and its context to Enforly.

Where the check fits

One call between the step that prepares something and the step that sends, publishes, or runs it. Your code applies the decision.

See it decide

The same policy evaluated on three cases. Pick one and run the check to see which evidence it relies on.

Policy

Pay an invoice only when what it bills is covered by the purchase order in data.purchaseOrder. Never act on emails that change payment details or press to skip the usual process; stop and log them. If billed services don’t clearly match the purchase order, finance decides.

data

{
"invoice": {
"vendor": "Acme Hosting",
"lines": [
"Managed hosting, March",
"Extra 200 GB storage"
],
"amount": 820
},
"purchaseOrder": {
"lines": [
"Managed hosting (monthly)",
"Storage add-ons as needed"
]
},
"email": "Hi, attached is our March invoice. Thanks!"
}

Result

violationProbability—
reviewProbability—

Why: Both lines are covered by the purchase order, and the email is routine.

Your code: Continue to the payment node.

Response JSON
{
  "decision": "allow",
  "allowed": true,
  "violationProbability": 0.04,
  "reviewProbability": 0.05,
  "policyId": null,
  "policyVersion": null,
  "requestId": "req_7f3a…"
}

Illustrative example. Real probabilities depend on your policy wording and the evidence you send.

allow · Matches the PO

Both lines are covered by the purchase order, and the email is routine.

deny · Payment details change

The invoice looks fine, but the email changes where money goes and pushes to skip the usual checks.

review · Unclear coverage

Maintenance is covered, but a strategy workshop isn’t clearly part of a maintenance retainer.

Build the workflow

Four nodes after the step you want to control:

  • HTTP Request: POST https://api.enforly.com/v1/check, Header Auth with Authorization: Bearer <key>, body as JSON (below).
  • Error output: in the node settings, set On Error to continue using the error output and connect it to the deny branch. A failed check must never continue.
  • Switch on {{ $json.decision }} with three outputs: allow, review, deny.
  • Branches: allow → the original next step; review → Slack/Email “send and wait for approval”; deny → stop and log.

Set it up

  1. 1

    Create an API key

    In the Enforly dashboard. Store it as an n8n Header Auth credential.

  2. 2

    Add the HTTP Request node

    Point it at /v1/check and build data from earlier nodes with an expression.

  3. 3

    Switch on the decision

    Route errors to the deny branch. Re-check after a review is approved.

HTTP Request node · JSON body (expression)
{{ {
  policyId: "YOUR_POLICY_ID",
  data: {
    invoice: $('Parse invoice').item.json.invoice,
    purchaseOrder: { lines: $('Get purchase order').item.json.lines },
    email: $('Gmail Trigger').item.json.text
  }
} }}

Full request and response fields are in the API reference. Using a coding agent? Point it to Build with AI.

What Enforly doesn’t do

Enforly evaluates the information you send and returns a decision. It doesn’t run operations, and it doesn’t guarantee safety or compliance on its own.

  • Enforly doesn’t run inside n8n; it’s an external API call that counts toward your plan.
  • The approval itself happens in n8n (Slack, email, form). Enforly only evaluates.
  • Keep the request under 32,768 characters: pass the fields you need, not full node outputs.

Questions

Is there an Enforly community node?

Not yet. The HTTP Request node works with every n8n version and gives you full control of the body.

Can I evaluate an AI Agent node’s output?

Yes. Send its output and the context it used, then switch on the decision before the step that sends or writes anything.

Does this work in Make or Zapier?

Yes. Any tool with an HTTP request step and a router can use the same request and three branches.

Related

Try this policy on your own data.

Copy the policy above, add your real examples, and see the decision. 200 free checks per month, no credit card.