Dillo Flows
Approvals & decisions, template v1

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.

Starts when: A form or system you name sends it. Produces: Decision returned. Steps: 5
Sample run — illustrative, not a record of a real run
requestId
REQ-0001
kind
Purchase
amountCents
72000
summary
Sample request — replacement laptops
1Sort by the check2A person decides3A person decides4Paths join5The result

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.

Request · SummaryRequest · Amount

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.

Request · SummaryRequest · Amount

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.

Request · ID

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.

FieldWhat to put in itExample
Senior review overRequests above this amount (in cents) go to the senior approver.50000
Senior approverThe role or person who decides big requests.Operations lead
Standard approverThe role or person who decides ordinary requests.Team lead

Set it up

  1. Fill in the fields below.
  2. Name the connections it needs — by name only.
  3. Look at the trigger preview: what would start a run, counted before anything is armed.
  4. Review the steps, the rules, and every place a person is asked.
  5. Create it — then run it once yourself, and read the run's record.
Creating never arms the trigger. The flow is created switched off: no runs start for things that already match. Arming is a separate tap on the created flow, after you have seen the preview count.

Use this template

Requests above this amount (in cents) go to the senior approver.

The role or person who decides big requests.

The role or person who decides ordinary requests.

Sign in to preview what this trigger would match in your space.

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": []
      }
    }
  }
}

All templates   See the system: Link Map