Skip to main content

Documentation Index

Fetch the complete documentation index at: https://smithers.sh/llms.txt

Use this file to discover all available pages before exploring further.

import { Subflow } from "smithers-orchestrator";

type SubflowProps = {
  id: string;
  workflow: Function;
  output: z.ZodObject | Table | string;
  input?: unknown;
  mode?: "childRun" | "inline"; // default "childRun"
  skipIf?: boolean;
  timeoutMs?: number;
  retries?: number;
  retryPolicy?: RetryPolicy;
  continueOnFail?: boolean;
  cache?: CachePolicy;
  dependsOn?: string[];
  needs?: Record<string, string>;
  label?: string;
  meta?: Record<string, unknown>;
};
<Workflow name="parent-flow">
  <Sequence>
    <Subflow
      id="run-child"
      workflow={childWorkflow}
      input={{ repo: "acme/app" }}
      output={outputs.childResult}
      retries={2}
      timeoutMs={300_000}
    />
    <Task id="summarize" output={outputs.finalResult} agent={summarizer}>
      Summarize the child workflow result.
    </Task>
  </Sequence>
</Workflow>

Notes

  • childRun (default) gives the child its own DB row; retry/cache/resume scope it as a unit.
  • inline renders the child tree as siblings in the parent plan, sharing its scope.
  • Subflows compose; children may contain <Subflow> themselves.