> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.meetgail.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.meetgail.com/_mcp/server.

# Sub Graph

> Packages a group of steps into a single reusable unit inside a workflow.

The Sub Graph node bundles a group of steps into one tidy box on the canvas. The
steps inside run as a unit and hand their final result back to the main
workflow. It keeps a busy workflow readable and groups related work that belongs
together.

## When to use it

* Your workflow is getting crowded and you want to tuck a related set of steps
  into one collapsible unit.
* You have a self-contained piece of logic, like scoring an application, that you
  want to keep separate and easy to follow.
* You want a group of steps to produce one clean result the rest of the workflow
  can read.

## Inputs

| Field       | What it's for                                                     | Example                                      |
| ----------- | ----------------------------------------------------------------- | -------------------------------------------- |
| Description | A short note on what this group of steps does.                    | "Score and classify an application."         |
| Steps       | The steps that run inside the unit, with their own start and end. | Score the applicant, then classify the score |

The steps inside can read values from the main workflow, and the group's final
result becomes available to the steps that come after it.

## Outputs

| Field  | What you get back                                                           |
| ------ | --------------------------------------------------------------------------- |
| Result | Whatever the last step inside the group produced, available to later steps. |

## Example

An agency reuses the same application-scoring logic in more than one place. Those
steps, scoring the applicant and classifying the score, live inside a Sub Graph
named "Score and classify an application." On the canvas it reads as a single
box; the main workflow reads its result and routes accordingly. Grouping the work
keeps the top-level flow easy to follow.

![The Sub Graph node on the canvas, expanded to show its inner start, steps, and end.](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/gail.docs.buildwithfern.com/4359cb8fce7ab7109710f89b154e96262e3a0f92c715c117b65460c56fa4ee79/docs/pages/platform/workflows/assets/logic-and-flow-sub-graph.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260823%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260823T232905Z&X-Amz-Expires=604800&X-Amz-Signature=ebadc840af3e514feb6b1a066d52475ff2b85f6046f9425d1555ff05b346033b&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

End a Sub Graph with a small, clear step like
[Check](/platform/workflows/node-reference/logic-and-flow/check) so it hands back a
clean, labeled result rather than a large block of data.

## Related nodes

#### [For Each](/platform/workflows/node-reference/logic-and-flow/for-each)

Run a group of steps once for every item in a list.

#### [Check](/platform/workflows/node-reference/logic-and-flow/check)

Produce a single labeled outcome to hand back from the group.