Approval
Pause for a human to approve or reject before continuing.
While it waits, the run shows under Needs you on the run page and on Today, and
spool approve answers it from a terminal. Approving continues with the form’s values as this
node’s output; rejecting cancels the run, with the reason recorded.
- Kind:
approval - Palette: Flow
- Run it on its own: no, only as part of a graph
When to use
Section titled “When to use”- A person has to say yes before something irreversible: a deploy, a payment, a message to customers.
- A person has to supply something the run can’t know, such as which environment, or a note.
Field types are text, textarea, select (with options), checkbox and number.
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
fields |
array | no | Optional fields the approver fills in. |
outputs |
object | no | Rename what comes out: {output_name: key_in_the_raw_output}. Absent passes the raw output through. |
prompt |
string | no | Message shown to the approver. |
timeout |
string | no | How long to wait before giving up, e.g. “1h”; the output then says timed_out. |
Output
Section titled “Output”The approver’s submission: one key per declared field, plus:
| Field | Type | Description |
|---|---|---|
timed_out |
boolean | True when the deadline won rather than the thing being waited for. |
Example
Section titled “Example”version: hyperspool-graph/v1nodes: - id: build type: shell config: { run: spool output set tag=v1.4.0 } - id: gate type: approval config: prompt: { $template: "Deploy {{ nodes.build.output.tag }}?" } fields: - { name: env, type: select, options: [staging, production] } - { name: note, type: textarea } timeout: 24h - id: deploy type: shell if: "!nodes.gate.output.timed_out" config: run: { $template: "./deploy.sh {{ nodes.gate.output.env }}" }edges: - { from: build, to: gate } - { from: gate, to: deploy }A gate with a timeout that nobody answers succeeds with timed_out: true rather than
failing, so guard what follows it: without the if:, deploy would run on silence. See
Approvals.
See the node reference for every other node.