Stepthroughby Ynteractive Start free

Guardian: Put a Refund Limit in Front of Your n8n Refund Step

Practice it step by step

Start the free practice

Take the free module: why it matters, practice and a quick check →

You do every step yourself in a practice copy of Guardian. It checks your work as you go, and “Do it for me” finishes any step you get stuck on. Free, about 15 minutes, and nothing touches your real accounts. Open full screen

Free · Live nown8n Automation ToolkitGuardiann8n~15 min31 stepsIntermediate

Updated . Built against the tool’s current screens and checked step by step. How we check this lesson

A support agent who can refund small orders through n8n saves the owner real time, right up to the refund nobody looked at. In this free lesson you put Guardian (guardian-safety-gate.com) in front of the refund step for a made-up online shop: small refunds go through on their own, the refund that takes the day past 100 waits for a person, and one over 250 or with no valid amount is denied. You use a refund sample that Guardian's founder built and tested himself in our Guardian org on 27 November 2026, with made-up orders and a stub instead of a real refund, and you can download both workflows and both policies. The 24-hour total needs Guardian's Starter plan, so those results come from our org on the Business plan; the free-plan policy works on any plan. This is my own lesson, not an official Guardian course.

At a glance

QuestionAnswer
What you buildA business case for a small online shop whose support agent can refund orders through n8n: small refunds go through on their own, the one past 100 in 24 hours waits for the owner, and one over 250 is denied. Uses a refund sample tested by Guardian, with downloads.
ToolsGuardian
TimeAbout 15 minutes, 31 steps in 10 parts
LevelIntermediate
CostFree. The 24-hour total rule needs Guardian’s Starter plan or above; the free-plan policy works on any plan.
Ways to learn itPractice it step by step

The 10 parts, in short

  1. A support desk that can refund: Meet the support desk, Put a price on it, Write the cap down, Meet Guardian.
  2. Get the files: The free-plan policy, The 24-hour total policy, The two workflows.
  3. Paste the policy: Create a policy for payment.refund, Paste it in Rules JSON (Advanced), Every rule runs, the strictest wins.
  4. The Guardian check in n8n: Prepare Guardian check, The Guardian check, One Guardian credential per org, Real go-ahead? is required, and 2 more steps.
  5. Three refunds of 40: Two refunds of 40 go through, The third one waits, What the 24-hour total counts, Now the free plan.
  6. On the free plan: One refund at a time.
  7. Approve, lower or refuse: Lower it, then approve, Raise it: Guardian accepts, the workflow refuses, Past the ceiling: refused.
  8. The approvals workflow: Publish it, never press Execute, Compare with the original request, Claim it once, then refund.
  9. Read the record: EXECUTED means reached, not paid, A retry with the same Idempotency Key is not a second refund.
  10. What it saves, what it does not do: What this saves you, What it does not do.

Start here first: n8n: What Is n8n? Build Your First Workflow (module 1 of n8n Automation Toolkit)

In the course: Part 9 · n8n Automation Toolkit (Module 111 of the full course)

Guardian Policies page in the Stepthrough org: Payment refund free (payment.refund.free), Payment Refund (payment.refund) and Client Email Gate (email.send), each Enabled
Guardian Policies page in the Stepthrough org: Payment refund free (payment.refund.free), Payment Refund (payment.refund) and Client Email Gate (email.send), each Enabled

The business case: let small refunds go through, make the big ones ask

Picture Lena Ortiz, who runs Kettle & Kiln, a made-up online shop that sells handmade mugs and a coffee subscription. Her support agent refunds broken orders through an n8n workflow, and she checks every refund by hand: about 80 a month at 4 minutes each, so about 5 hours a month. If she stops checking, one refund typed as 400 instead of 40 goes straight back to a card. These are example numbers, so use your own.

Her cap in three lines: small refunds go through on their own, up to 100 in total in any 24 hours; the refund that goes past that waits for her; and one refund over 250, or one with no valid amount, is denied. Guardian decides; the workflow moves the money.

Step 1: paste a policy for payment.refund

In Guardian, create a policy with the action type payment.refund, open the JSON tab under Rules and paste policy_refund_free.json into Rules JSON (Advanced). It works on any plan, including free: a single refund above 100 waits for a person, above 250 is denied, and one without a valid amount is denied. On the Starter plan or above you can paste policy_refund_sample.json instead, which waits once the refunds that went through on their own in the last 24 hours, plus this one, would go over 100. A free org refuses to save that rule.

Every rule runs and the strictest result wins: denied over waiting for a person over going through. A new org has no policy, and an action with no policy is denied by default.

Step 2: the Guardian check and the required IF

Import refund_with_guardian.json into n8n. Prepare Guardian check always sends every field a rule reads, because by default Guardian skips a rule when its field is missing, and sends an amount that is not a number above 0 as amount 0 with amount_valid false. It also builds one Idempotency Key per refund request: refund-<order_id>-<refund_request_id>.

Guardian check has three outputs: Allowed, Denied and Needs approval. Between Allowed and the refund sits an IF called Real go-ahead?, and it is required: it lets an item through only with decision ALLOW, a record ID and no repeat. An outside tester found that on node versions up to 1.0.11, if a Guardian credential can't be read, an item can leave the Allowed output with no decision and no record. Keep one clearly named Guardian credential per Guardian org.

Step 3: three refunds of 40

With the 24-hour total policy in our org on the Business plan, three refunds of 40 against a limit of 100: the first two went through on their own, and the third waited with "sum 80 + current 40 = 120 exceeds limit 100 in 24h". The total counts only refunds that went through on their own; approved refunds are not added, so after approving the third, a fourth refund of 40 waited again at 80 + 40.

With the free-plan policy, 40 went through, 150 waited, and 300 and "forty" were denied.

Step 4: approvals and edits

Waiting refunds are approved in the Guardian dashboard. A reviewer can lower a refund with Edit & Approve, and the approvals workflow refunds the lower amount. Guardian checks an edit against the rules, not against the original request, so it accepts a raised amount that still only needs approval: the approvals workflow's own check, Compare with the original request, must refuse any edit that raises the amount. Publish the approvals workflow, never press Execute in it, and keep one approvals workflow per action type per org.

In the audit log, EXECUTED means Guardian was told the step was reached, not that money moved. Check refunds in your payment provider.

Links

  • Guardian: the approval and audit layer this lesson uses.

Try it yourself, free

Reading the steps is a start. Doing them is how it sticks. The interactive module walks you through every click in a practice copy of Guardian, checks each step, and never touches your real accounts.

Start “Guardian: Put a Refund Limit in Front of Your n8n Refund Step”

Step by step: Guardian: Put a Refund Limit in Front of Your n8n Refund Step

All 31 steps of the interactive module, in order. In the module you watch each one, then do it yourself in a practice copy that checks your work.

1. A support desk that can refund

  1. Meet the support desk. Lena Ortiz runs Kettle & Kiln (made up), an online shop that sells handmade mugs and a monthly coffee subscription. Sam answers support, and Sam's refund requests run through an n8n workflow that refunds the customer. Most refunds are small: a mug that arrived broken, about 40. The risk is the refund nobody looked at. Click Sam's refund jobs.

    Meet Lena. She runs a small online shop that sells mugs and a coffee subscription. Sam answers support, and refunds run through an n8n workflow. Most are small. A broken mug, about forty. The risk is the refund nobody looked at.

  2. Put a price on it. Right now Lena checks every refund herself: about 80 refund requests a month, 4 minutes each for Lena to check, so about 5 hours a month. If she stops checking, the risk is a refund typed as 400 instead of 40, or a run of refunds nobody looked at. Money that has gone back to a card is hard to get back. These are example numbers, so swap in your own. Click the cost.

    Right now, Lena checks every refund herself. Eighty a month, four minutes each. That's about five hours a month. And if she stops, one refund typed as four hundred instead of forty goes straight out. Use your own numbers here.

  3. Write the cap down. Lena wants a cap, not a second job. Her three lines: small refunds go through on their own, up to 100 in total in any 24 hours; the refund that goes past that waits for her; and one refund over 250, or one with no valid amount, is denied. All amounts in this lesson are in EUR. Click the three lines.

    Lena wants a cap, not a second job. Small refunds go through on their own, up to a hundred in any twenty-four hours. The one that goes past that waits for her. And one refund over two hundred and fifty, or with no valid amount, is denied.

  4. Meet Guardian. Guardian (guardian-safety-gate.com) checks the refund before your workflow makes it, and answers one of three ways: it goes through, it waits for a person, or it is denied. Guardian decides; your workflow moves the money. Guardian never touches your payment provider. This lesson uses a refund sample that Guardian's founder built and tested himself in our own Guardian org on 27 November 2026, with made-up orders and a stub instead of a real refund. Click the Guardian card.

    Guardian checks the refund before your workflow makes it. It goes through, it waits for a person, or it's denied. Guardian decides. Your workflow moves the money. This lesson uses a sample Guardian's founder built and tested himself.

2. Get the files

  1. The free-plan policy. There are four files, and you can download all of them under Do it for real, along with a TEST version of the main workflow. Two are policies for the action type payment.refund. policy_refund_free.json works on any plan, including free: a single refund above 100 waits for a person, above 250 is denied, and one with no valid amount is denied. This is the one to use in your own org. Click the free-plan policy.

    There are four files. Two of them are policies. The free one works on any plan. A single refund above a hundred waits for a person. Above two fifty, it's denied. And a refund with no valid amount is denied. Use this one in your own org.

  2. The 24-hour total policy. policy_refund_sample.json has Lena's real cap: it adds up the refunds that went through on their own in the last 24 hours, plus this one, and if that goes over 100, this one waits. It needs Guardian's Starter plan or above; in a free org Guardian refuses to save it, and Guardian's notes say paid plans aren't open yet. So the 24-hour results in this lesson come from our org on the Business plan, and no step depends on it. Click the 24-hour total policy.

    The second policy has Lena's real cap. It adds up the last twenty-four hours, plus this refund, and over a hundred, this one waits. It needs Guardian's Starter plan. A free org won't save it. So the twenty-four hour results here come from our org on the Business plan.

  3. The two workflows. The other two are n8n workflows. Refund with Guardian is the main one: a sample refund, one Guardian check, then three ways out. Refund with Guardian, approvals makes the refund once a person approves it. In both, the refund step is a stub that only prints what it would refund, so nothing moves money until you put your own payment step there. Click the workflows.

    The other two files are n8n workflows. The main one checks each refund. The approvals one makes the refund once a person says yes. In both, the refund step is a stub. Nothing moves money until you put your own payment step there.

3. Paste the policy

  1. Create a policy for payment.refund. In your Guardian org, create a policy with the action type payment.refund. That is the exact name the workflow sends with every check. A new org has no policy, and an action with no policy is denied by default, so until this policy exists every refund is denied. This is the real Policies page in our Stepthrough org: Payment refund free (payment.refund.free, the free policy the founder tested), Payment Refund (payment.refund) and an older email.send gate, each Enabled. In your org, click New Policy; here, click the payment.refund action type to open the one we use.

    In Guardian, create a policy for the action type payment dot refund. It's the exact name the workflow sends. A new org has no policy, and an action with no policy is denied by default. So until this exists, every refund is denied.

  2. Paste it in Rules JSON (Advanced). The editor shows What action does this policy apply to? payment.refund, with Recognized action type. Note the setting below it: If a rule's field is missing from the payload, Skip rule (default) — action may be allowed silently. Under Rules, open the JSON tab and paste the whole of policy_refund_free.json (or policy_refund_sample.json, on Starter or above) into Rules JSON (Advanced). Paste it as it is: every rule reads a field by its exact name, such as amount and amount_valid. Click the JSON tab.

    Under Rules, open the JSON tab, and paste the whole free policy into Rules JSON, Advanced. Each rule reads a field by its exact name.

  3. Every rule runs, the strictest wins. Our org's Rules JSON (Advanced) holds the 24-hour policy (policy_refund_sample.json), marked Valid JSON, and Policy Preview reads it back: Require Approval when the 24-hour total of amount exceeds 100, Deny when amount > 250, Allow when amount_valid is "true", Deny for anything else. Guardian runs every rule on every refund, and the strictest answer wins: denied beats waiting for a person, and waiting beats going through. So a refund of 300 trips both the waiting rule and the deny rule, and it is denied. By default, Guardian skips a rule when the field it reads is missing, which is why the workflow always sends every field. Click the rules.

    Guardian runs every rule, and the strictest answer wins. Denied beats waiting, and waiting beats going through. And by default, if a field is missing, Guardian skips that rule. That's why the workflow always sends every field.

4. The Guardian check in n8n

  1. Prepare Guardian check. Import refund_with_guardian.json into n8n. Refund request holds one sample refund: replace it with your own trigger later. Prepare Guardian check builds exactly what Guardian checks. An amount that isn't a number above 0 (missing, text or zero) goes out as amount: 0 with amount_valid: false, and the third rule denies it. It also builds the Idempotency Key, refund-<order_id>-<refund_request_id>: one refund request, one Idempotency Key. This canvas is drawn from the workflow file. Click Prepare Guardian check.

    Import the main workflow. Prepare Guardian check builds what Guardian checks. An amount that isn't a real number goes out as zero, with amount valid set to false, and a rule denies it. It also builds one Idempotency Key per refund request.

  2. The Guardian check. Guardian check is the Guardian node, with Action Type payment.refund, Payload from Prepare Guardian check and Idempotency Key. It has three outputs: Allowed, Denied and Needs approval. Its On Error setting is Continue, so if Guardian can't be reached or answers with an error, the item goes to Denied with decision ERROR instead of stopping the run. Click Guardian check.

    Guardian check is the Guardian node, set to payment dot refund. It has three outputs. Allowed, denied, and needs approval. If Guardian can't be reached, the item goes to denied, with an error, instead of stopping the run.

  3. One Guardian credential per org. Install the Guardian node first: on n8n Cloud, search the nodes panel for Guardian, pick the verified node and Install; self-hosted, use Settings > Community Nodes and n8n-nodes-guardian. Create an API key in the Guardian dashboard, scoped to the project you test in, and a credential named Guardian API key with Base URL https://api.guardian-safety-gate.com. Keep one clearly named Guardian credential per Guardian org: when a credential is deleted, n8n switches the node to another Guardian credential if there is one, without asking, and a key from another org checks against that org's rules. Click the credential.

    Install the Guardian node, and create a credential named Guardian API key. Keep one clearly named Guardian credential per Guardian org. If a credential is deleted, n8n switches the node to another Guardian credential, if there is one, without asking. And a key from another org checks against that org's rules.

  4. Real go-ahead? is required. Between Allowed and the refund sits an IF called Real go-ahead?. It is a required step, not a nice-to-have. It lets an item through only when the decision is ALLOW, there is a record ID, and it is not a repeat. Anything else goes to Alert: no real go-ahead. An outside tester found that on node versions up to 1.0.11, if a Guardian credential can't be read, an item can leave the Allowed output with no decision and no record. Without this IF, that item would reach the refund. Click Real go-ahead?.

    Between Allowed and the refund sits an IF, called Real go-ahead. It's required. It only lets through a real allow, with a record ID, that isn't a repeat. An outside tester found that on node versions up to one point oh point eleven, if a credential can't be read, an item can leave the allowed output with no decision and no record. This IF stops it.

  5. Denied or error?. The Denied output goes to another IF, Denied or error?. A Guardian ERROR (Guardian unreachable, a wrong key, or a used Idempotency Key with another amount) goes to Alert: Guardian error, so someone looks at it. A rule's DENY, or a repeat of an earlier request, ends in Not refunded (denied or repeat). Click Denied or error?.

    The denied output goes to another IF. A Guardian error goes to an alert, so someone looks at it. A rule's deny, or a repeat, ends in Not refunded.

  6. Waiting for a person. Needs approval ends in Waiting for a person. Nothing is refunded here: the refund waits in the Guardian dashboard, and once someone approves it, the separate approvals workflow makes it. To try a case, change order_id, refund_request_id and amount in Refund request and press Execute workflow. Use a new refund_request_id for each new refund. Click Waiting for a person.

    Needs approval ends in Waiting for a person. Nothing is refunded here. The refund waits in the Guardian dashboard, and the approvals workflow makes it once someone says yes.

5. Three refunds of 40

  1. Two refunds of 40 go through. Here is the test, with the 24-hour total policy in our org on the Business plan on 27 November 2026: three refunds of 40 against a limit of 100 per 24 hours. t1 and t2 both went through on their own and ended at Refund (stub) with 40. Each record ID is from our org's audit log. Run them in this order: the total starts from whatever went through in the last 24 hours. Click t1.

    Here's the test, on the twenty-four hour policy in our org on the Business plan. Three refunds of forty, and a limit of a hundred. The first two went straight through.

  2. The third one waits. The third refund of 40 waited for a person. The record shows the sum: "sum 80 + current 40 = 120 exceeds limit 100 in 24h". After it was approved, the approvals workflow reached the stub with 40. That is Lena's cap, working: two small refunds alone, the third one asks. Click t3.

    The third refund waited. The record shows the sum. Eighty, plus forty, is a hundred and twenty. Over the limit. Once approved, it went through. That's Lena's cap, working.

  3. What the 24-hour total counts. Read this one carefully. The total counts only refunds that went through on their own. Approved refunds are not added. After t3 was approved, a fourth refund of 40 waited again at "sum 80 + current 40 = 120", not 160. The total also counts every allowed check in the same project and action type over the last 24 hours, so it can't group by customer; it counts an allowed check even if your refund step then failed; and the sum in the reason is the one at the moment of the decision, not a live counter. Click t7.

    Read this one carefully. The total only counts refunds that went through on their own. Approved ones aren't added. So after approving the third, a fourth refund waited again at eighty plus forty. It can't group by customer. And it counts an allowed check, even if your refund step then failed.

  4. Now the free plan. If your org is on the free plan, you can't save the 24-hour rule, so you use the free policy instead. Click Free-plan results.

    On the free plan, you use the free policy instead.

6. On the free plan

  1. One refund at a time. Guardian's founder tested the free policy in our org too, under its own action type, payment.refund.free. 40 went through on its own, 150 waited for a person, and 300 and "forty" were denied. In your own org, create the free policy for payment.refund, the action type the workflow files send. The free policy looks at one refund at a time: it has no 24-hour total, so three refunds of 40 would all go through. Click the results.

    On the free policy, forty went through, a hundred and fifty waited, and three hundred, and forty written as a word, were denied. It looks at one refund at a time, with no daily total.

7. Approve, lower or refuse

  1. Lower it, then approve. A waiting refund is approved in the Guardian dashboard. A refund of 150 is waiting. Use Edit & Approve: in the Edit Payload & Approve dialog, set "amount": 100 and approve. The approvals workflow ends at Refund approved amount (stub) with 100, and it keeps original_amount: 150. When you edit the JSON in the dashboard, change only the number and keep the commas. This approval view uses descriptive labels, not a screenshot. Click Edit & Approve.

    A refund of a hundred and fifty is waiting. Use Edit and Approve, lower it to a hundred, and approve. The approvals workflow refunds a hundred. Change only the number, and keep the commas.

  2. Raise it: Guardian accepts, the workflow refuses. Now raise one instead: 150 to 200. Guardian accepts the edit, because it checks an edit against your rules, not against the original request, and 200 still only asks for approval. So the approvals workflow's own check must refuse any edit that raises the amount. In the test it did: it ended at Not refunded: edit outside the request ("amount raised from 150 to 200"), and the record stays approved and not executed. Click the raised edit.

    Now raise one, to two hundred. Guardian accepts it. It checks an edit against your rules, not against the original request. So your approvals workflow has to refuse an edit that raises the amount. In the test, it did.

  3. Past the ceiling: refused. Change one to 400 and the dashboard refuses it, because 400 breaks the 250 ceiling. The Edit Payload & Approve dialog shows only "Edited payload cannot be approved" and doesn't name the rule; a normal check's record does name it, under Matched rules. Nothing runs. Reject works the same way: nothing runs, and the audit log shows the rejection. Click the refused edit.

    Change one to four hundred, and the dashboard refuses it. It's over the ceiling. Nothing runs. And if you reject a refund, nothing runs either.

8. The approvals workflow

  1. Publish it, never press Execute. Import refund_approvals.json. It starts at Guardian Approval Trigger, for each approval of a payment.refund. Publish it and never press Execute in it: a test run in the editor can switch off its approval registration (node versions up to 1.0.11). Keep one approvals workflow per action type per org: while one is on, a second one is refused. This canvas is drawn from the workflow file. Click Guardian Approval Trigger.

    Import the approvals workflow. Publish it, and never press Execute in it. A test run can switch off its approval registration. And keep one approvals workflow per action type, per org. A second one is refused.

  2. Compare with the original request. Read the approved refund reads what was approved, plus the original if a reviewer edited it. Compare with the original request is the workflow's own check, not Guardian's: an edit may lower the amount, never raise it, and may not change the order or the currency. Edit within the request? sends a raised edit to Not refunded: edit outside the request. Keep this check whenever you change the workflow. Click Compare with the original request.

    Compare with the original request is your workflow's own check. An edit may lower the amount, never raise it, and it can't change the order or the currency. Keep this check.

  3. Claim it once, then refund. Guardian enforce (claim once) claims the approval one time, and Real go-ahead? (approval) lets through only a claimed go-ahead. Then Refund approved amount (stub) runs. Your own payment step goes here, and it must read the amount from payloadJson, the approved version, which carries any edit. In the main workflow, your payment step reads the amount from Prepare Guardian check. Click Guardian enforce (claim once).

    Guardian enforce claims the approval once. Then the refund step runs. Your payment step goes here, and it reads the approved amount, including any edit.

9. Read the record

  1. EXECUTED means reached, not paid. In Guardian's audit log, a refund that reached the stub says EXECUTED. That means Guardian was told the step was reached, not that money moved. Guardian has no access to your payment provider, shop or helpdesk. From your refund, it stores only what the workflow sends: order_id, amount, amount_valid, currency, reason_code, requested_by and the Idempotency Key. Around it, Guardian keeps its own record of the decision: the reasons and each rule's verdict, who approved, rejected or edited it, the original and the edited version with their fingerprints, and the times. Check the refund itself in your payment provider. This is the real record for t1 (84a1b808) in our org: Decision ALLOW, Status DECIDED, and EXECUTION CONFIRMED: "Guardian recorded this confirmation — the actual action was performed by your connected system (n8n, backend, or agent)." Click EXECUTION CONFIRMED.

    In the audit log, a refund that reached the refund step says executed. That means Guardian was told the step was reached. Not that money moved. Check the refund itself in your payment provider.

  2. A retry with the same Idempotency Key is not a second refund. Running t1 again with the same Idempotency Key got the earlier decision back, with no second go-ahead: it ended at Not refunded (denied or repeat) with duplicateBlocked: true, and the audit log shows a row "Execution Skipped" with the status "Already Executed (Idempotent)" on the same record, 84a1b808. The same Idempotency Key with another amount is refused and goes to the alert, with no new record. If your refund step fails after a go-ahead, the retry is blocked too, and Guardian can't tell whether that first refund went through: a person first checks the payment provider, then refunds it by hand if needed. On the same record, the IDEMPOTENCY KEY box shows refund-ORD-1001-R1-t1 and says "Duplicate requests with this key will return the same intent without creating new records." Click the Idempotency Key.

    Run the same refund again with the same Idempotency Key, and Guardian gives back the earlier decision. No second go-ahead. The log shows execution skipped, with the status already executed. The same Idempotency Key with another amount is refused. And if your refund step fails after the go-ahead, a person checks the payment provider first, then refunds by hand if needed.

10. What it saves, what it does not do

  1. What this saves you. Click What this saves you.
  2. What it does not do. Guardian checks only the step that sits after it. Whoever can edit the workflow can remove the check, and a refund made anywhere else is not seen. If Guardian can't read its past decisions for the 24-hour total (a database error), that one rule lets the refund through, while the other rules still run, so the 250 ceiling still applies. Click What it does not do.

    Guardian only checks the step right after it. Anyone who can edit the workflow can remove the check. And a refund made anywhere else isn't seen.

Screenshots

Frequently asked questions

Does Guardian make the refund?
No. Guardian decides and records. Your n8n workflow makes the refund, and in the sample files the refund step is a stub that only prints what it would refund.
Does the 24-hour total work on the free plan?
No. The 24-hour total rule needs the Starter plan or above, and a free org refuses to save it. Use the free-plan policy, which looks at one refund at a time.
Are approved refunds added to the 24-hour total?
No. The total counts only refunds that went through on their own.

Start this module free

More in n8n Automation Toolkit

All 31 modules in n8n Automation Toolkit

More Guardian tutorials

Plain-English definitions, each with an example from a free lesson.

The full AI glossary

Browse related tutorials