Skip to main content
A sub-workflow is a workflow used as a single node of another workflow. It has its own memory, sees only the inputs it is given, and passes only its final output back to the parent. Use sub-workflows to:
  • keep model context small: an agent that reads three images does that inside a sub-workflow, and only its short JSON verdict reaches the parent, not the images;
  • group steps that belong together (prepare a brief, load files, run the agent) so the parent graph stays readable;
  • reuse a saved workflow inside others.

Inline sub-workflows

Declare a sub-workflow under arium.ariums and connect it like any node:

Inside a sub-workflow, the parent’s data is input

This is the rule that most often trips people up:
Inside a sub-workflow, select what the parent forwarded with input_filter: [input], not with the parent node’s name. In the example above, input_filter: [load_claim] inside photo_review selects nothing.
The data still carries its origin: in a function’s node_outputs, the forwarded payload is grouped under the node that produced it (load_claim), even though you selected it as input.

Only the last output comes back

The parent receives only the final output of the sub-workflow, the output of the node that ended it. Intermediate outputs (the brief, downloaded images) stay inside. If the parent needs several values, make the last node return them all, for example a function that combines them, or an agent whose parser includes everything.

Referencing a saved workflow

Instead of declaring the body inline, reference a workflow saved in the app by namespace/name, optionally pinned to a version:
The referenced workflow is inlined when the parent is built. input_filter and inherit_variables set at the reference apply. References can nest; a cycle is rejected.

Pattern: one agent, one sub-workflow

For multi-agent reviews, give every agent its own sub-workflow containing:
  1. a brief function that cuts the shared case down to what this agent needs;
  2. file nodes that load the agent’s images or documents (see function nodes);
  3. the agent, with input_filter set to the brief and its files.
The parent then sees one compact JSON verdict per agent, and each model call carries only what that agent needs.