Parent-Child Workflows
JustWorkflowIt supports parent-child workflow orchestration where a parent workflow can spawn child jobs that execute independently and report results back.
How It Works
Section titled “How It Works”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).
Multi-Child Orchestration
Section titled “Multi-Child Orchestration”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.
Dynamic Fan-Out with forEach
Section titled “Dynamic Fan-Out with forEach”Use forEach to dynamically spawn one child per element in an array:
{ "children": [ { "workflowName": "item-processor", "workflowVersion": { "tag": "$LIVE" }, "forEach": { "arrayPath": "previousStep.output.items" } } ]}Inspecting the Hierarchy
Section titled “Inspecting the Hierarchy”GetJobreturnsparentJobandchildJobsfields showing the full hierarchyListJobswithjobHierarchy: TOP_LEVEL_ONLYfilters out child jobsbillableTransactionUnitson the parent aggregates usage across all descendants