---
title: "SubFlows"
description: "Use SubFlows when:"
canonical_url: "https://docs.superdurable.io/design-patterns/subflows/"
source: "docs/content/design-patterns/subflows.mdx"
locale: "en"
---

> Index of every page for AI agents: https://docs.superdurable.io/llms.txt

# SubFlows

Use SubFlows when:

1. Each piece of work needs its own history, retries, and lifecycle.
2. You need more concurrent work than the concurrency limit of one Flow allows.

## Choose a pattern

- [Basic parent Flow](https://docs.superdurable.io/design-patterns/subflows/basic.md) — Start a runtime-sized group and wait for every SubFlow.
- [Wait for half](https://docs.superdurable.io/design-patterns/subflows/wait-for-half.md) — Wait for half of the SubFlows, then let each unfinished Step stop its own child.
- [Advanced: long-lived parent](https://docs.superdurable.io/design-patterns/subflows/long-lived-parent.md) — Keep a fixed worker pool alive and accept requests through an RPC that publishes to a Channel.
- [Advanced: short-lived parent](https://docs.superdurable.io/design-patterns/subflows/short-lived-parent.md) — Drain queued requests, then complete when no SubFlow is running and the Channel is empty, without losing a request that arrives at the end.
- [Advanced: multiple parents with partitioning](https://docs.superdurable.io/design-patterns/subflows/partitioning.md) — Spread requests across several parent Flows, so total SubFlow concurrency grows with the number of parents.
- [Advanced: back pressure for high availability](https://docs.superdurable.io/design-patterns/subflows/back-pressure.md) — When an overloaded parent rejects a request, submit it through a Flow that retries until a parent accepts it.
- [Cancel with Child Flows](https://docs.superdurable.io/design-patterns/subflows/cancel-case.md) — Stop the child Flows a Flow started when the Flow is canceled.
- [Child Flows with Business Identity](https://docs.superdurable.io/design-patterns/subflows/child-flows-with-business-identity.md) — Start child jobs as top-level Flows named by their own business number, and record how each one ended.

The first four pages are parent Flow shapes. Partitioning and back pressure build on them.

## Next

- [Basic parent Flow](https://docs.superdurable.io/design-patterns/subflows/basic.md)
- [SubFlow](https://docs.superdurable.io/concepts/primitives/subflow.md)
- [Parallel Steps](https://docs.superdurable.io/design-patterns/parallel.md)
