Back to the guides

PRACTICAL SOFTWARE GUIDE

n8n sub-workflows: define input, output and waiting contracts

Treat a reusable workflow like an internal interface: declare required inputs, returned output and whether the caller must wait.

SOURCE-BASED ANALYSIS · NO HANDS-ON RATING

Write the boundary before extracting logic

n8n's Execute Sub-workflow node can call another workflow and map inputs declared by its Workflow Input Trigger. The parent can pass all items into one execution or run the sub-workflow separately for each item. It can also wait for completion or continue without waiting. These choices change error handling, ordering and what output is available to later parent nodes.

Create a contract fixture

Assume a fictional reusable sub-workflow normalizes a customer record. Declare a source ID and email as required strings, an optional region and one normalized output object. Test a valid item, a missing required value, a type mismatch and two items submitted together.

FixtureExecution modeExpected result
Valid itemOnce with all itemsOne normalized output
Missing source IDDeclared contractRejected or explicit null policy
Two independent itemsOnce per itemTwo traceable sub-executions
Long background taskDo not wait only by policyParent continues without dependent output

Align waiting with downstream dependencies

If a later parent step needs the sub-workflow's result, enable waiting and define the output from the sub-workflow's last node. If the work is intentionally asynchronous, the parent must not act as though completion has already occurred. Record a correlation ID so the two executions can be reconciled.

  1. Name the reusable outcome and its owner.
  2. Declare required, optional and typed inputs.
  3. Select all-items or per-item execution deliberately.
  4. Choose waiting behavior from downstream needs.
  5. Run the four synthetic fixtures.
  6. Trace parent and sub-execution IDs.
  7. Version the contract before changing shared inputs.

Prevent hidden coupling

Removing a requested input can deliver null to the sub-workflow, while automatic type conversion can conceal a source mismatch. Accept the interface when invalid input fails visibly, successful output is attributable and changes do not silently break other parent workflows. This guide does not claim a production execution.

Sources and verification

Official documentation checked on 2026-10-29. Worked examples are hypothetical planning exercises, not measured product benchmarks.

Continue your evaluation

Practical guides for this topic

Put your tools to work.

Need help choosing or setting up your tools? Tell Koldia what you want to improve.

Discuss your project