Skip to content

Parent-Child Workflows

JustWorkflowIt supports parent-child workflow orchestration where a parent workflow can spawn child jobs that execute independently and report results back.

Use the /justworkflowit/runChildJob step executor to spawn a child workflow:

{
"name": "runEtlPipeline",
"integrationDetails": {
"type": "/justworkflowit/runChildJob",
"config": {
"children": [
{
"id": "etl-child",
"workflowName": "etl-pipeline",
"workflowVersion": { "tag": "$LIVE" }
}
]
},
"inputDefinition": { "$ref": "#/definitions/emptyDef" },
"outputDefinition": { "$ref": "#/definitions/childResult" }
},
"transitionToStep": "processResults"
}

The parent step waits for the child job to complete before advancing. If the child fails, the parent step also fails (and can be resumed).

Spawn multiple concurrent children from a single step:

{
"name": "fanOut",
"integrationDetails": {
"type": "/justworkflowit/runChildJob",
"config": {
"children": [
{ "id": "child-a", "workflowName": "processor-a", "workflowVersion": { "tag": "$LIVE" } },
{ "id": "child-b", "workflowName": "processor-b", "workflowVersion": { "tag": "$LIVE" } }
]
},
"inputDefinition": { "$ref": "#/definitions/emptyDef" },
"outputDefinition": { "$ref": "#/definitions/childResult" }
},
"transitionToStep": "aggregate"
}

For sequential children, use separate /justworkflowit/runChildJob steps connected via transitionToStep.

Use forEach to dynamically spawn one child per element in an array:

{
"children": [
{
"workflowName": "item-processor",
"workflowVersion": { "tag": "$LIVE" },
"forEach": { "arrayPath": "previousStep.output.items" }
}
]
}
  • GetJob returns parentJob and childJobs fields showing the full hierarchy
  • ListJobs with jobHierarchy: TOP_LEVEL_ONLY filters out child jobs
  • billableTransactionUnits on the parent aggregates usage across all descendants