Subflow
Compose workflows by calling other flows as tasks, enabling modular and reusable flow design.
Plugin: subflow
Group: Core / Orchestration
| Task Type |
|---|
dev.bringup.plugin.core.flow.Subflow |
Overview
The Subflow task allows you to invoke another flow as a step within your current flow. This enables:
- Modularity - Break complex workflows into reusable components
- Composition - Build parent flows that orchestrate multiple child flows
- Marketplace reuse - Reference published flows from the Bringup Marketplace
- Input/output passing - Pass data between parent and child flows
Subflows can reference flows in two ways:
- Own flows - By
flowId+namespace(+ optionalrevision) - Marketplace flows - By
marketplaceListingId
Examples
Reference a specific revision
tasks:
- id: stable-process
type: dev.bringup.plugin.core.flow.Subflow
flowId: data-processor
namespace: analytics
revision: 5
inputs:
dataset: "{{ inputs.dataset_id }}"
Properties
Common Task Properties
See Shell > Common Task Properties for id, type, description, disabled, timeout, retry, allow_failure, run_if, and worker_group.
Reference Resolution
When a Subflow task is encountered, the system resolves the reference:
- Own flows: Looked up by
(flowId, namespace, revision)in the user's flow store - Marketplace flows: Looked up by
marketplaceListingIdin the marketplace
The resolved flow's metadata is returned in API responses as subflow_meta:
{
"subflow_meta": {
"resolved": true,
"flow_id": "data-preparation",
"namespace": "ml",
"revision": 3,
"description": "Prepare dataset for ML training",
"link": "/flows/ml/data-preparation",
"expandable": true
}
}
Validation
The Flow Service validates subflow references:
- Existence check - The referenced flow must exist and be accessible
- Circular dependency detection - Prevents infinite recursion (A -> B -> A)
- Input compatibility - Warns if required inputs are missing
Validate all subflow references:
POST /flows/{namespace}/{flow_id}/validate-subflows
Notes
- Either
flowId+namespaceormarketplaceListingIdmust be provided, not both. - Subflow inputs are passed as environment variables to the inlined tasks.
outputSchemais required to access subflow outputs in downstream{{ task_outputs }}expressions.- The transpiler resolves subflows asynchronously and caches results to prevent duplicate lookups.
- Circular references are detected during both validation and transpilation.
- Subflow resolution respects multi-tenant isolation - you can only reference your own flows or public marketplace flows.