Approval router
Each incoming request goes to the right approver for its size: big ones to a senior approver, the rest to the standard approver. The decision is the flow's result, on the record.
- requestId
- REQ-0001
- kind
- Purchase
- amountCents
- 72000
- summary
- Sample request — replacement laptops
Sample result: Sent to the senior approver (over the senior threshold). Approved with a note. Decision returned.
What each step does
Step 1 · Sort by the check
The run takes one of two paths, decided by the check before it — never by guessing.
Step 2 · A person decides
The run stops and asks the person named in your settings. The decision window is 72 hours; if it lapses, the run carries on without a decision, and the lapse is on the record. Rejecting always takes a comment. Runs when the check before it matched.
Step 3 · A person decides
The run stops and asks the person named in your settings. The decision window is 72 hours; if it lapses, the run carries on without a decision, and the lapse is on the record. Rejecting always takes a comment. Runs when the check before it did not match.
Step 4 · Paths join
The two paths join here, and the run continues as one.
Step 5 · The result
This is what the run hands back, written into the run's record where you can read it.
What you'll fill in
These are the only things the template asks of you. Examples teach the shape — they are never values your flow runs on; what you type (or the stated starting value) is what gets used.
| Field | What to put in it | Example |
|---|---|---|
| Senior review over | Requests above this amount (in cents) go to the senior approver. | 50000 |
| Senior approver | The role or person who decides big requests. | Operations lead |
| Standard approver | The role or person who decides ordinary requests. | Team lead |
Set it up
- Fill in the fields below.
- Name the connections it needs — by name only.
- Look at the trigger preview: what would start a run, counted before anything is armed.
- Review the steps, the rules, and every place a person is asked.
- Create it — then run it once yourself, and read the run's record.
Use this template
The definition
The whole mechanism, before you take it. Package checksums: sha256:e7ab352ac72b… · sha256:45381ca36ae5… · sha256:0c19ca76a7a0…. A flow made from this template carries this template's name and version in its record, and exports in the standard bundle with that provenance.
Advanced · the three files, as written
{
"trigger.json": {
"template": {
"slug": "approval-router",
"version": 1,
"name": "Approval router",
"category": "approvals-decisions",
"outcome": "Each incoming request goes to the right approver for its size: big ones to a senior approver, the rest to the standard approver. The decision is the flow's result, on the record.",
"outputName": "Decision returned",
"fits_when": [
"approvals"
],
"needs": []
},
"trigger": {
"type": "webhook.received",
"source": "webhook",
"manifestFields": {
"requestId": "string!",
"kind": "string!",
"amountCents": "int!",
"summary": "string!"
}
},
"inputConvention": "envelope",
"variables": [
{
"name": "seniorThreshold",
"kind": "int",
"label": "Senior review over",
"instruction": "Requests above this amount (in cents) go to the senior approver.",
"example": 50000,
"default": 50000
},
{
"name": "seniorApprover",
"kind": "string",
"label": "Senior approver",
"instruction": "The role or person who decides big requests.",
"example": "Operations lead",
"default": "Senior approver"
},
{
"name": "approver",
"kind": "string",
"label": "Standard approver",
"instruction": "The role or person who decides ordinary requests.",
"example": "Team lead",
"default": "Approver"
}
],
"sample": {
"input": {
"requestId": "REQ-0001",
"kind": "Purchase",
"amountCents": 72000,
"summary": "Sample request — replacement laptops"
},
"output": "Sent to the senior approver (over the senior threshold). Approved with a note. Decision returned."
}
},
"flow.json": {
"name": "Approval router",
"inputConvention": "envelope",
"clefIn": [
{
"ruleset": "request-intake-starter",
"ids": [
"request-has-amount"
]
}
],
"steps": [
{
"type": "branch",
"path": "input.payload.amountCents",
"op": "gt",
"valueFromVariable": "seniorThreshold"
},
{
"type": "human",
"kind": "approval",
"when": "matched",
"prompt": {
"segments": [
{
"text": "Senior review: "
},
{
"field": {
"source": "trigger",
"name": "summary",
"label": "Request · Summary"
}
},
{
"text": " — "
},
{
"field": {
"source": "trigger",
"name": "amountCents",
"label": "Request · Amount"
}
}
]
},
"due": 259200,
"onExpire": "continue"
},
{
"type": "human",
"kind": "approval",
"when": "not-matched",
"prompt": {
"segments": [
{
"text": "Review: "
},
{
"field": {
"source": "trigger",
"name": "summary",
"label": "Request · Summary"
}
},
{
"text": " — "
},
{
"field": {
"source": "trigger",
"name": "amountCents",
"label": "Request · Amount"
}
}
]
},
"due": 259200,
"onExpire": "continue"
},
{
"type": "end"
},
{
"type": "output",
"value": {
"segments": [
{
"text": "Decision recorded for request "
},
{
"field": {
"source": "trigger",
"name": "requestId",
"label": "Request · ID"
}
}
]
}
}
]
},
"rules.json": {
"rulesets": [
{
"name": "request-intake-starter",
"version": 1,
"rules": [
{
"id": "request-has-amount",
"on": "step.payload.amountCents",
"op": "missing",
"action": "block",
"msg": "A request event without an amount cannot be routed."
}
]
}
],
"permissions": {
"approvals": {
"approveBeforeSteps": [
1,
2
],
"rejectRequiresComment": true,
"dueSeconds": 259200,
"onExpire": "continue"
},
"connections": {
"required": [],
"optional": []
}
}
}
}