> ## Documentation Index
> Fetch the complete documentation index at: https://smithers.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflow Quickstart

> A two-agent sequential smithers-orchestrator workflow where a planner task feeds a briefing task through persisted structured output.

# Workflow Quickstart

<Note>
  Standalone `smithers-orchestrator` quickstart: a planner task feeds a briefing task through persisted workflow output.
</Note>

## Source

```tsx theme={"theme":{"light":"github-light","dark":"github-dark"}}
/** @jsxImportSource smithers-orchestrator */
// workflows/quickstart.tsx
import { createSmithers } from "smithers-orchestrator";
import { ToolLoopAgent as Agent, Output } from "ai";
import { anthropic } from "@ai-sdk/anthropic";
import { z } from "zod";

const planSchema = z.object({
  summary: z.string(),
  steps: z.array(z.string()).min(3).max(8),
});

const briefSchema = z.object({
  brief: z.string(),
  stepCount: z.number().int().min(1),
});

const { Workflow, Sequence, Task, smithers, outputs } = createSmithers({
  plan: planSchema,
  brief: briefSchema,
});

const planAgent = new Agent({
  model: anthropic("claude-sonnet-5"),
  output: Output.object({ schema: planSchema }),
  instructions:
    "You are a planning assistant. Return a concise summary and 3-8 actionable steps.",
});

const briefAgent = new Agent({
  model: anthropic("claude-sonnet-5"),
  output: Output.object({ schema: briefSchema }),
  instructions:
    "You are a concise technical writer. Produce a 5-8 sentence brief.",
});

export default smithers((ctx) => {
  return (
    <Workflow name="quickstart">
      <Sequence>
        <Task id="plan" output={outputs.plan} agent={planAgent}>
          {`Create a short plan for this goal:\n${ctx.input.goal}`}
        </Task>
        <Task
          id="brief"
          output={outputs.brief}
          agent={briefAgent}
          deps={{ plan: outputs.plan }}
        >
          {(deps) => `Goal: ${ctx.input.goal}
Plan summary: ${deps.plan.summary}
Steps: ${JSON.stringify(deps.plan.steps)}

Write a brief based on the plan. The "stepCount" must equal the number of steps.`}
        </Task>
      </Sequence>
    </Workflow>
  );
});
```

## Running

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
bunx smithers-orchestrator up workflows/quickstart.tsx --input '{"goal": "Build a CLI tool for managing dotfiles"}'
```

```
[quickstart] Starting run def456
[plan] Done -> { summary: "Build a dotfile manager CLI", steps: ["Parse config", "Symlink files", "Add backup"] }
[brief] Done -> { brief: "This plan covers 3 steps...", stepCount: 3 }
[quickstart] Completed
```

## Notes

* **Cross-task data flow** -- `deps={{ plan: outputs.plan }}` on `brief` defers it until `plan`'s output is persisted, then passes it to the `(deps) => ...` callback as `deps.plan`.
* **Shared schemas** -- The same Zod schemas back both `createSmithers(...)` and `Output.object({ schema })` (which tells the Vercel AI SDK to enforce the schema on the model's JSON output), keeping task persistence and agent output aligned.
* **Vercel AI SDK** -- `ToolLoopAgent` runs tool-call loops internally until the model stops calling tools, so you don't manage the loop yourself.
