Nest workflows to keep each agent’s context small and reuse building blocks
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;
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.
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.
Instead of declaring the body inline, reference a workflow saved in the app by namespace/name, optionally pinned to a version:
ariums: - name: claims/photo-review@2 # saved workflow, version 2 input_filter: [load_claim] inherit_variables: trueworkflow: start: load_claim edges: - from: load_claim to: [photo-review] # edges use the local name: the last part, without @version - from: photo-review to: [decide] end: [decide]
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.
For multi-agent reviews, give every agent its own sub-workflow containing:
a brief function that cuts the shared case down to what this agent needs;
file nodes that load the agent’s images or documents (see function nodes);
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.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Wavefront AI | Rootflo","colors":{"primary":"#3B82F6","light":"#60A5FA","dark":"#1E40AF"},"logo":{"light":"https://mintcdn.com/rootfloai/AiHxIkh9KtGYiz8E/logo/light.png?fit=max\u0026auto=format\u0026n=AiHxIkh9KtGYiz8E\u0026q=85\u0026s=b493e8fe23f59899d246e2ca32396012","dark":"https://mintcdn.com/rootfloai/AiHxIkh9KtGYiz8E/logo/dark.png?fit=max\u0026auto=format\u0026n=AiHxIkh9KtGYiz8E\u0026q=85\u0026s=cc952b50a8b76554187f5472425ec816"},"favicon":"https://mintcdn.com/rootfloai/ESOMPNB1NNLp7sKF/favicon.png?fit=max\u0026auto=format\u0026n=ESOMPNB1NNLp7sKF\u0026q=85\u0026s=bcf18853f4828199e6cb71af384a8748","navbar":{"links":[{"href":"https://rootflo.ai","label":"Website"}],"primary":{"type":"button","label":"Contact us","href":"mailto:sales@rootflo.ai?subject=Partnership%20Inquiry\u0026body=Hi%2C%0A%0AI%20would%20like%20to%20know%20more%20about%20your%20Wavefront%20Enterprise%20AI%20Platform.%0A%0AThanks%2C%0A%0A"}},"footer":{"socials":{"x":"https://x.com/rootflo_ai","github":"https://github.com/rootflo/wavefront","linkedin":"https://linkedin.com/company/rootflo","discord":"https://discord.gg/BPXsNwfuRU"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/rootflo/flo-ai"},{"anchor":"Discord","icon":"comments","href":"https://discord.gg/BPXsNwfuRU"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"rootfloai","hasAudioNarration":false,"actualSubdomain":"rootfloai","customDomains":["wavefront.rootflo.ai"],"gitSource":{"type":"github","owner":"rootflo","repo":"wavefront","deployBranch":"develop","contentDirectory":"documentation","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ad873e433c6f36d82f3b613","collectionId":"c73d5747-f7b7-442a-8b52-1b1ffc5e612b","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ad873e433c6f36d82f3b613"},"entitlements":{},"buildId":"6ad873e433c6f36d82f3b613","clientVersion":"0.0.4076","searchFilterCounts":[{"language":"default","tag":"Wavefront","count":38},{"language":"default","tag":"FloAI","count":13},{"language":"default","tag":"Getting started","count":8},{"language":"default","tag":"Workflows","count":7},{"language":"default","tag":"Core Features","count":5},{"language":"default","tag":"Models and agents","count":5},{"language":"default","tag":"Data, files and configuration","count":5},{"language":"default","tag":"Run and integrate","count":5},{"language":"default","tag":"Advanced","count":4},{"language":"default","tag":"Guides","count":4}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"wavefront/sub-workflows","slug":"/wavefront/sub-workflows","pageMetadata":{"title":"Sub-workflows","description":"Nest workflows to keep each agent's context small and reuse building blocks","icon":"layer-group","href":"/wavefront/sub-workflows"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Nest workflows to keep each agent’s context small and reuse building blocks\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`A `,_jsx(_components.strong,{children:`sub-workflow`}),` is a workflow used as a single node of another workflow. It has its `,_jsx(_components.strong,{children:`own memory`}),`, sees only the inputs it is given, and passes `,_jsx(_components.strong,{children:`only its final output`}),` back to the parent.`]}),`\n`,_jsx(_components.p,{children:`Use sub-workflows to:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`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;`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`group steps`}),` that belong together (prepare a brief, load files, run the agent) so the parent graph stays readable;`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`reuse`}),` a saved workflow inside others.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`inline-sub-workflows`,children:`Inline sub-workflows`}),`\n`,_jsxs(_components.p,{children:[`Declare a sub-workflow under `,_jsx(_components.code,{children:`arium.ariums`}),` and connect it like any node:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`40`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`40`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`arium`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` function_nodes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`load_claim`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` function_name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`datasource_execute_query`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` prefilled_params`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`datasource_id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u003cid>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`query_id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`claim_detail`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`decide`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` function_name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`trigger_message_processor`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` input_filter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`photo_review`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# the sub-workflow's final output`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` prefilled_params`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`message_processor_id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u003cfunction-id>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` ariums`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`photo_review`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # a node of the parent`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` inherit_variables`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # the sub-workflow sees the run's variables`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` input_filter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`load_claim`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# what the parent forwards into it`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` function_nodes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`brief`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` function_name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`trigger_message_processor`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` input_filter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`input`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# the forwarded messages`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` prefilled_params`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`message_processor_id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u003cbrief-function-id>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` agents`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`photo_inspector`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` input_filter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`brief`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` role`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Damage inspector`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` job`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Describe the damage visible in the photos.`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` model`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`provider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`rootflo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`model_id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u003cllm-config-id>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` workflow`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` start`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`brief`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` edges`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`brief`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` to`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`photo_inspector`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` end`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`photo_inspector`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` workflow`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` start`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`load_claim`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` edges`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`load_claim`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` to`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`photo_review`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`photo_review`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` to`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`decide`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` end`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`decide`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Key`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`name`})}),_jsxs(_components.td,{children:[`The node’s name in the parent; the parent’s edges and `,_jsx(_components.code,{children:`input_filter`}),`s use it`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`input_filter`})}),_jsx(_components.td,{children:`Which parent outputs are forwarded into the sub-workflow`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`inherit_variables`})}),_jsx(_components.td,{children:`Pass the run’s variables into the sub-workflow`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`agents`}),`, `,_jsx(_components.code,{children:`function_nodes`}),`, `,_jsx(_components.code,{children:`routers`}),`, `,_jsx(_components.code,{children:`ariums`}),`, `,_jsx(_components.code,{children:`iterators`}),`, `,_jsx(_components.code,{children:`workflow`})]}),_jsx(_components.td,{children:`The sub-workflow itself, exactly as in a top-level workflow`})]})]})]}),`\n`,_jsxs(Heading,{level:`2`,id:`inside-a-sub-workflow-the-parent’s-data-is-input`,children:[`Inside a sub-workflow, the parent’s data is `,_jsx(_components.code,{children:`input`})]}),`\n`,_jsx(_components.p,{children:`This is the rule that most often trips people up:`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Inside a sub-workflow, select what the parent forwarded with `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`input_filter: [input]`})}),`, `,_jsx(_components.strong,{children:`not`}),` with the parent node’s name. In the example above, `,_jsx(_components.code,{children:`input_filter: [load_claim]`}),` inside `,_jsx(_components.code,{children:`photo_review`}),` selects `,_jsx(_components.strong,{children:`nothing`}),`.`]})}),`\n`,_jsxs(_components.p,{children:[`The data still carries its origin: in a function’s `,_jsx(_components.code,{children:`node_outputs`}),`, the forwarded payload is grouped under the node that produced it (`,_jsx(_components.code,{children:`load_claim`}),`), even though you selected it as `,_jsx(_components.code,{children:`input`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`only-the-last-output-comes-back`,children:`Only the last output comes back`}),`\n`,_jsxs(_components.p,{children:[`The parent receives `,_jsx(_components.strong,{children:`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.`]}),`\n`,_jsx(Heading,{level:`2`,id:`referencing-a-saved-workflow`,children:`Referencing a saved workflow`}),`\n`,_jsxs(_components.p,{children:[`Instead of declaring the body inline, reference a workflow saved in the app by `,_jsx(_components.code,{children:`namespace/name`}),`, optionally pinned to a version:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`ariums`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`claims/photo-review@2`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # saved workflow, version 2`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` input_filter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`load_claim`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` inherit_variables`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`workflow`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` start`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`load_claim`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` edges`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`load_claim`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` to`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`photo-review`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# edges use the local name: the last part, without @version`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`photo-review`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` to`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`decide`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` end`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`decide`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The referenced workflow is inlined when the parent is built. `,_jsx(_components.code,{children:`input_filter`}),` and `,_jsx(_components.code,{children:`inherit_variables`}),` set at the reference apply. References can nest; a cycle is rejected.`]}),`\n`,_jsx(Heading,{level:`2`,id:`pattern-one-agent-one-sub-workflow`,children:`Pattern: one agent, one sub-workflow`}),`\n`,_jsx(_components.p,{children:`For multi-agent reviews, give every agent its own sub-workflow containing:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`a `,_jsx(_components.strong,{children:`brief`}),` function that cuts the shared case down to what this agent needs;`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`file nodes`}),` that load the agent’s images or documents (see `,_jsx(_components.a,{href:`/wavefront/function-nodes#datasource_download_file`,children:`function nodes`}),`);`]}),`\n`,_jsxs(_components.li,{children:[`the `,_jsx(_components.strong,{children:`agent`}),`, with `,_jsx(_components.code,{children:`input_filter`}),` set to the brief and its files.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`The parent then sees one compact JSON verdict per agent, and each model call carries only what that agent needs.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Sub-workflows","description":"Nest workflows to keep each agent's context small and reuse building blocks","icon":"layer-group","href":"/wavefront/sub-workflows"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Inline sub-workflows","slug":"inline-sub-workflows","depth":2,"children":[]},{"title":"Inside a sub-workflow, the parent’s data is input","slug":"inside-a-sub-workflow-the-parent’s-data-is-input","depth":2,"children":[]},{"title":"Only the last output comes back","slug":"only-the-last-output-comes-back","depth":2,"children":[]},{"title":"Referencing a saved workflow","slug":"referencing-a-saved-workflow","depth":2,"children":[]},{"title":"Pattern: one agent, one sub-workflow","slug":"pattern-one-agent-one-sub-workflow","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"rootfloai","siteName":"Wavefront AI | Rootflo","title":"Sub-workflows - Wavefront AI | Rootflo","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-21T08:12:26.715Z","originalFileLocation":"wavefront/sub-workflows.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Nest workflows to keep each agent\u0026#x27;s context small and reuse building blocks\">\u003cmeta data-mint-head name=\"application-name\" content=\"Wavefront AI | Rootflo\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/rootfloai/vhaXyiJ6Z3XlfH3z/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/rootfloai/vhaXyiJ6Z3XlfH3z/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/rootfloai/vhaXyiJ6Z3XlfH3z/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/rootfloai/vhaXyiJ6Z3XlfH3z/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/rootfloai/vhaXyiJ6Z3XlfH3z/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/rootfloai/vhaXyiJ6Z3XlfH3z/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/rootfloai/vhaXyiJ6Z3XlfH3z/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/rootfloai/vhaXyiJ6Z3XlfH3z/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/rootfloai/vhaXyiJ6Z3XlfH3z/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Sub-workflows - Wavefront AI | Rootflo\">\u003cmeta data-mint-head property=\"og:description\" content=\"Nest workflows to keep each agent\u0026#x27;s context small and reuse building blocks\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Wavefront AI | Rootflo\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://wavefront.rootflo.ai/wavefront/sub-workflows\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://rootfloai.mintlify.site/_mintlify/api/og/v2?division=Workflows\u0026amp;title=Sub-workflows\u0026amp;description=Nest+workflows+to+keep+each+agent%27s+context+small+and+reuse+building+blocks\u0026amp;theme=bcaf035d0ae7f9c56e224f26\u0026amp;signature=09f398798ca66ca2c88be1178964307a65bfa46fe4d6ae424509777adcc0b28f\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Sub-workflows - Wavefront AI | Rootflo\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Nest workflows to keep each agent\u0026#x27;s context small and reuse building blocks\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://rootfloai.mintlify.site/_mintlify/api/og/v2?division=Workflows\u0026amp;title=Sub-workflows\u0026amp;description=Nest+workflows+to+keep+each+agent%27s+context+small+and+reuse+building+blocks\u0026amp;theme=bcaf035d0ae7f9c56e224f26\u0026amp;signature=09f398798ca66ca2c88be1178964307a65bfa46fe4d6ae424509777adcc0b28f\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/rootfloai/vhaXyiJ6Z3XlfH3z/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Wavefront AI | Rootflo\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3B82F6\">\u003clink data-mint-head rel=\"canonical\" href=\"https://wavefront.rootflo.ai/wavefront/sub-workflows\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/wavefront/sub-workflows.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://wavefront.rootflo.ai/#organization\",\"name\":\"Wavefront AI | Rootflo\",\"url\":\"https://wavefront.rootflo.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/rootfloai/AiHxIkh9KtGYiz8E/logo/light.png?fit=max\u0026auto=format\u0026n=AiHxIkh9KtGYiz8E\u0026q=85\u0026s=b493e8fe23f59899d246e2ca32396012\"}},{\"@type\":\"WebSite\",\"@id\":\"https://wavefront.rootflo.ai#website\",\"name\":\"Wavefront AI | Rootflo\",\"url\":\"https://wavefront.rootflo.ai\",\"publisher\":{\"@id\":\"https://wavefront.rootflo.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://wavefront.rootflo.ai/wavefront/sub-workflows#webpage\",\"url\":\"https://wavefront.rootflo.ai/wavefront/sub-workflows\",\"name\":\"Sub-workflows\",\"description\":\"Nest workflows to keep each agent's context small and reuse building blocks\",\"dateModified\":\"2026-10-21T08:12:26.715Z\",\"isPartOf\":{\"@id\":\"https://wavefront.rootflo.ai#website\"},\"breadcrumb\":{\"@id\":\"https://wavefront.rootflo.ai/wavefront/sub-workflows#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://wavefront.rootflo.ai/wavefront/sub-workflows#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Workflows\",\"item\":\"https://wavefront.rootflo.ai/wavefront/workflows\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Sub-workflows\",\"item\":\"https://wavefront.rootflo.ai/wavefront/sub-workflows\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://wavefront.rootflo.ai/wavefront/sub-workflows#article\",\"headline\":\"Sub-workflows\",\"name\":\"Sub-workflows\",\"description\":\"Nest workflows to keep each agent's context small and reuse building blocks\",\"url\":\"https://wavefront.rootflo.ai/wavefront/sub-workflows\",\"mainEntityOfPage\":{\"@id\":\"https://wavefront.rootflo.ai/wavefront/sub-workflows#webpage\"},\"dateModified\":\"2026-10-21T08:12:26.715Z\",\"publisher\":{\"@id\":\"https://wavefront.rootflo.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://wavefront.rootflo.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Wavefront AI | Rootflo\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Wavefront AI | Rootflo","nav":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/rootflo/flo-ai"},{"anchor":"Discord","icon":"comments","href":"https://discord.gg/BPXsNwfuRU"}]},"tabs":[{"tab":"Wavefront","groups":[{"group":"Getting started","pages":[{"title":"Project Overview","href":""},{"title":"How Wavefront fits together","icon":"sitemap","href":"/wavefront/overview"},{"title":"Concepts","icon":"book","href":"/wavefront/concepts"},{"title":"Tour of the Wavefront Console","icon":"map","href":"/wavefront/console-tour"},{"title":"Quickstart","icon":"rocket","href":"/wavefront/quickstart"}]},{"group":"Models and agents","pages":[{"title":"LLM Repository","icon":"brain","href":"/wavefront/llm-configs"},{"title":"Agents","icon":"robot","href":"/wavefront/agents"},{"title":"Structured output","icon":"brackets-curly","href":"/wavefront/structured-output"},{"title":"Tools","icon":"wrench","href":"/wavefront/tools"},{"title":"Images, documents and video","icon":"photo-film","href":"/wavefront/media"}]},{"group":"Workflows","pages":[{"title":"Workflows","icon":"diagram-project","href":"/wavefront/workflows"},{"title":"How a workflow runs","icon":"list-ol","href":"/wavefront/workflow-execution-model"},{"title":"Passing data between nodes","description":"input_filter, how agents and function nodes receive inputs, node_outputs, variables and prefilled parameters","icon":"arrow-right-arrow-left","href":"/wavefront/workflow-data-flow"},{"title":"Sub-workflows","icon":"layer-group","href":"/wavefront/sub-workflows"},{"title":"Routing and iteration","description":"Choose the next step with routers, and repeat a step for each item with ForEach","icon":"code-branch","href":"/wavefront/routing-and-iteration"},{"title":"Function nodes","icon":"cubes","href":"/wavefront/function-nodes"},{"title":"Versions","icon":"code-compare","href":"/wavefront/versions"}]},{"group":"Functions","pages":[{"title":"Functions","icon":"function","href":"/wavefront/functions"}]},{"group":"Data, files and configuration","pages":[{"title":"Datasources","icon":"database","href":"/wavefront/datasources"},{"title":"Dynamic queries","icon":"magnifying-glass","href":"/wavefront/dynamic-queries"},{"title":"File storage","icon":"folder-open","href":"/wavefront/file-storage"},{"title":"Configurations","icon":"sliders","href":"/wavefront/configurations"},{"title":"Audit trail","icon":"clipboard-list","href":"/wavefront/audit-trail"}]},{"group":"Run and integrate","pages":[{"title":"Running workflows","icon":"play","href":"/wavefront/running-workflows"},{"title":"Integrating an application","icon":"plug","href":"/wavefront/integrating-an-app"},{"title":"Users and access","icon":"users","href":"/wavefront/users-and-access"},{"title":"Chatbots","icon":"comments","href":"/wavefront/chatbots"},{"title":"Deploying from git","icon":"code-branch","href":"/wavefront/deploy-as-code"}]},{"group":"Guides","pages":[{"title":"Guide: verify a document against submitted data","icon":"file-circle-check","href":"/guides/document-verification"},{"title":"Guide: configurable rules and scoring","icon":"scale-balanced","href":"/guides/rules-and-scoring"},{"title":"Guide: a chat assistant beside a record","icon":"message-bot","href":"/guides/record-chat-assistant"},{"title":"Guide: a review dashboard and work lists","icon":"chart-column","href":"/guides/review-dashboard"}]},{"group":"Patterns and troubleshooting","pages":[{"title":"Patterns and best practices","icon":"lightbulb","href":"/wavefront/patterns"},{"title":"Troubleshooting","icon":"bug","href":"/wavefront/troubleshooting"}]},{"group":"Operations","pages":[{"title":"Architecture","icon":"server","href":"/operations/architecture"},{"title":"Environment and configuration","icon":"gear","href":"/operations/environment"},{"title":"Running several apps","icon":"boxes-stacked","href":"/operations/multi-app"},{"title":"Upgrades","icon":"arrow-up-right-dots","href":"/operations/upgrades"}]}]},{"tab":"FloAI","pages":[{"title":"FloAI","href":"/flo-ai"}]}]},"basePath":"","title":"Sub-workflows - Wavefront AI | Rootflo","buildId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","deploymentId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","dynamics":[],"chunks":[]}