Skip to content

Sub graphs

A sub graph is an ordinary workflow file that another workflow imports. implementation [import="subgraphs/implementation.dot"] declares a placeholder. Before validation, Orbital replaces the placeholder with the imported graph, so the editor, the validator and the run snapshot all see one flattened graph.

Move a repeated sequence into its own file with its own version, entry and terminals. Validate it alone first. It has to be a complete graph, not a fragment.

Imported node IDs acquire the placeholder’s prefix, so implementation.check is the imported check node. Incoming edges reach the imported entry. Imported terminals become exits, and the parent’s outgoing edges replace them.

With one exit, the parent can use a bare outgoing edge. With several, each outgoing edge names one: exit="merged". Bind every exit exactly once. Outputs and probe fact names keep their original names, which is what lets a parent condition read a value the sub graph produced.

A parent continuation carries exit, fidelity and loop_restart. Conditions, weights and repair-budget actions belong to the imported seam, not to the parent’s edge out of the placeholder.

A placeholder can carry a class for stylesheet selection. It cannot override the prompt, harness or other execution settings of the nodes inside. Imported graph-level settings describe that graph’s standalone use and are not merged into the parent, so shared configuration belongs in the parent’s profiles or stylesheet.

Relative imports and prompt files resolve from the file that names them. Import cycles are errors, and an unresolved import fails loading and names the placeholder rather than producing a runnable partial graph.

Include every imported file and sidecar with relative paths intact. The ticket workflow distributes a parent graph, two sub graphs and every prompt as one archive. Follow how to use re-usable workflows to build your own.