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)
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 turns | Fan-out-synthesize (one focused goal per agent) |
| πͺ Self-preferential bias β favors its own work when judging | Adversarial verification (blind refuter) |
| π΄ Agentic laziness β declares done on partial progress | Loop-until-done + /goal |
| π Hard-to-score β taste/ranking degrades at scale | Tournament (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 /workflows | ork skills (agent-orchestration etc.) | |
|---|---|---|
| scale | large-N (tensβhundreds) | bounded (β€8) |
| mode | background, fire-and-forget | foreground, shared-memory |
| use when | broad sweep, you check back later | tight 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.