Glossary · Workflow design
Sub-workflow
Also called: child workflow, nested workflow, reusable workflow
A sub-workflow is a workflow that another workflow calls as one of its steps, passing data in and getting a result back, so shared logic is built once and reused.
Sub-workflows are functions for automation. When three workflows all need to "find or create the customer in the CRM, then log the interaction", you can copy those steps three times and fix bugs three times, or build them once as a sub-workflow and call it.
When to extract one
- The same steps appear in more than one workflow. Customer lookup, address normalization, a standard Slack alert format.
- One part changes on its own schedule. Pricing rules owned by finance, while the surrounding workflow is owned by ops.
- A loop body is getting long. "For each line item" plus ten steps is easier to read as "for each line item, run Process line item".
Pitfalls
- Hidden failures. If the child fails, does the parent stop, skip or carry on? Decide explicitly.
- Contract drift. The child expects
email; a parent sendscustomer_email. Treat inputs like an API contract and validate them at the top of the child. - Too much nesting. Two levels is readable. Five is a maze. If you need a diagram to explain the call chain, flatten something.
In Fluxo Flow
The Sub-workflow node runs another workflow in your workspace as a step; the child's output comes back as the node's output. A common pattern is a nightly sync: a cron schedule fetches changed records, a Loop runs a shared "upsert the record" sub-workflow for each one, and an Error Handler posts failures to Slack. Sub-workflows count toward your plan's workflow limit like any other workflow.
Read next
Related terms
- WorkflowA workflow is a repeatable sequence of steps, started by a trigger, that turns an input (a form, an invoice, a new deal) into an outcome, with defined rules for each decision along the way.
- ActionAn action is a workflow step that does something outside the workflow, such as creating a CRM record, sending an email, posting to Slack or calling an API.
- Dead-letter queueA dead-letter queue is a holding place for messages or items that couldn't be processed after all retries, kept aside with their error so a person can inspect, fix and replay them instead of losing them.
- TokenA token is the unit of text a language model reads and writes, usually a word, part of a word or a punctuation mark, and the unit AI providers use to price usage and set context limits.
- Structured outputStructured output is a model response in a predefined, machine-readable format, typically a JSON object matching a schema, so the next steps of a workflow can use the fields directly instead of parsing prose.