Sub-workflow
Run another workflow and wait for it. Set exactly one of type, graph, from_repo or definition.
The child is a run of its own, with its own page and history, and this step waits for it. Its
output is what the child returns: the outputs: block of a child graph.
- Kind:
workflow - Palette: Activities
- Run it on its own: yes
When to use
Section titled “When to use”- A sequence you use from more than one graph, kept in one place.
- A YAML pipeline or graph that lives in a repo, run as one step (
from_repo). - A graph computed at run time (
definition), when the set of steps isn’t known until then. - One child per item, as a
fan_outbody, so each item can be inspected and rerun on its own.
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
definition |
any | no | An inline graph to run as the child, usually computed: {“$expr”: “nodes.<id>.output.graph”}. |
from_repo |
object | no | A pipeline fetched from a repo: {path, repo, credential, ref?}. |
graph |
object | no | A stored graph to run: {name, version?}. |
input |
any | no | Structured input passed to the child. |
outputs |
object | no | Rename what comes out: {output_name: key_in_the_raw_output}. Absent passes the raw output through. |
type |
string | no | A registered workflow type to run. |
Output
Section titled “Output”Not declared: what comes out depends on the configuration.
Example
Section titled “Example”version: hyperspool-graph/v1nodes: - id: notify type: workflow config: graph: { name: notify-customer } input: customer_id: { $expr: "input.customer_id" } order_id: { $expr: "input.order_id" } - id: done type: shell config: run: { $template: "echo sent {{ nodes.notify.output.message_id }}" }edges: - { from: notify, to: done }graph: { name: notify-customer } runs that stored graph’s published version; add
version: 3 to pin one. The child sees input as its run input, and done reads what its
outputs: declared. See Composition.
Running a pipeline or a script
Section titled “Running a pipeline or a script”With type: instead of graph:, the step runs a pipeline or a script inline, and input holds
its body:
type: hyperspool/pipeline/v1:inputis the pipeline’s YAML, as a string.type: hyperspool/script/v1:inputis{ script: "...", interpreter: "bash" }.
Write the pipeline text as a plain string. Wrapped in $template, the graph would also try to
fill the pipeline’s own ${{ }} holes, and fail on the first one that names something only the
pipeline has. Connecting pipelines, graphs and scripts has runnable
examples of both.
See the node reference for every other node.