🧬 OrchestKit · Workflow Patterns Explainer

How Claude Code dynamic workflows work, the 6 patterns ork uses to shape them, and the one rule for picking the right one. ork taxonomy β€” not a CC standard

1 Β· What a dynamic workflow actually is

A workflow is a JS harness Claude writes on the fly (CC v2.1.154+, ultracode). It runs in the background and orchestrates subagents deterministically β€” loops, conditionals, fan-out β€” instead of leaving coordination to one model's improvisation. You watch it with /workflows.

// the three core primitives (CC documents these β€” the mechanics)
agent(prompt, {schema, model, agentType, isolation})  // one subagent β†’ returns its result
parallel([ ()=>agent(a), ()=>agent(b) ])               // BARRIER β€” awaits ALL, then continues
pipeline(items, stage1, stage2)                        // NO barrier β€” each item flows independently

// pick model per agent Β· force structured output with a schema Β· isolate with a git worktree

βš–οΈ parallel vs pipeline β€” the choice that matters most: use parallel() only when stage N genuinely needs all of stage N-1 (dedup, early-exit, cross-item compare). Otherwise pipeline() β€” item A can be in stage 3 while item B is still in stage 1, so wall-clock = slowest single chain, not sum-of-slowest-per-stage.

2 Β· The 6 patterns (click one β€” ork's taxonomy for naming multi-agent shapes)

Select a pattern above.

3 Β· The selection rule β€” pick the pattern that structurally prevents your failure

Failure mode (single-context Claude)Pattern that fixes it
🎯 Goal drift β€” loses the objective over many turnsFan-out-synthesize (one focused goal per agent)
πŸͺž Self-preferential bias β€” favors its own work when judgingAdversarial verification (blind refuter)
😴 Agentic laziness β€” declares done on partial progressLoop-until-done + /goal
πŸ“Š Hard-to-score β€” taste/ranking degrades at scaleTournament (pairwise)

4 Β· A real run (this very session)

The verification that produced this PR was a workflow β€” 4 verifiers in parallel() then an adversarial critic. It dogfooded pattern #2 (the critic caught a mis-versioned release-notes draft no single agent flagged).

phase('Verify')
const [align, quality, integ, notes] = await parallel([
  ()=> agent('verify the patterns doc vs current CC', {agentType:'claude-code-guide'}),
  ()=> agent('quality-review the 2 new files',         {agentType:'Explore'}),
  ()=> agent('integration + status sweep (git/gh)',    {agentType:'general-purpose'}),
  ()=> agent('draft release notes 8.22.0..HEAD',       {agentType:'general-purpose'}),
])
phase('Critique')
const critic = await agent(`find what the 4 reports MISSED: ${JSON.stringify({align,quality,integ,notes})}`)
// β†’ critic caught: notes were titled 8.22.0 but the real delta is 8.23.0 βœ…

5 Β· ork β‰  CC /workflows β€” complementary, not competing

CC /workflowsork skills (agent-orchestration etc.)
scalelarge-N (tens–hundreds)bounded (≀8)
modebackground, fire-and-forgetforeground, shared-memory
use whenbroad sweep, you check back latertight coordination in one invocation

ork does not wrap /workflows inside a skill (forced fit). The dynamic-workflow-patterns.md reference tells you when to reach for the Workflow tool directly. Only swarm-migrate genuinely overlaps.