Setting the file. One moment.
Subchapter 32.1
references/compositional-workflows.mdMarkdown2 KBView on GitHub
For complex workflows, you may decompose work into supporting sub-workflows and a main workflow. This is part of an approved build task, not a reason to create a new plan.
Use this pattern when a workflow is large, has reusable chunks, or benefits from independent testing. Simple workflows should stay in one workflow.
build-workflow and isSupportingWorkflow: true.executeWorkflowTrigger (version 1.1) with
an explicit input schema.workflowId in the main workflow’s
executeWorkflow node with source: 'database'.build-workflow and without isSupportingWorkflow; this is the build task’s
final deliverable outcome.Example supporting workflow trigger:
const inputTrigger = trigger({
type: 'n8n-nodes-base.executeWorkflowTrigger',
version: 1.1,
config: {
parameters: {
inputSource: 'workflowInputs',
workflowInputs: {
values: [
{ name: 'city', type: 'string' },
{ name: 'units', type: 'string' },
],
},
},
},
});Example main-workflow reference:
const getWeather = node({
type: 'n8n-nodes-base.executeWorkflow',
version: 1.2,
config: {
name: 'Get Weather Data',
parameters: {
source: 'database',
workflowId: { __rl: true, mode: 'id', value: 'SUPPORTING_WORKFLOW_ID' },
mode: 'once',
workflowInputs: {
mappingMode: 'defineBelow',
value: { city: expr('{{ $json.city }}'), units: 'metric' },
},
},
},
});Replace SUPPORTING_WORKFLOW_ID with the real ID returned by the supporting
build-workflow call. If a supporting workflow uses mocked credentials or
placeholders, route setup before publishing or relying on it.