> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.meetgail.com/platform/workflows/node-reference/logic-and-flow/sub-graph/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.](/_fern-img/4359cb8fce7ab7109710f89b154e96262e3a0f92c715c117b65460c56fa4ee79.webp) > **Note** > > 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. > Documentation for Gail, the AI platform for financial services. Learn how to set up GailGPT and Gail Agent to automate customer communications for insurance, banking, and finance.