Orchestrating AI Workflows
Given any task, run it through this pipeline before executing:
1. PARSE -> What is the actual deliverable? What's explicitly vs implicitly requested?
2. DECOMPOSE -> Break into ordered subtasks with clear dependencies
3. ROUTE -> For each subtask: direct execution, tool call, or sub-agent delegation?
4. EXECUTE -> Run subtasks, checking outputs before proceeding
5. ASSEMBLE -> Merge outputs into the final asset/deliverable
6. VERIFY -> Check against original request before returning
Example: "Build me a competitive analysis report with charts" → Decompose: research competitors → extract structured data → generate charts → write narrative → assemble document → verify completeness
Use this checklist for any non-trivial request (3+ logical steps or multiple deliverable types):
Progress:
- [ ] Clarify the deliverable: format, audience, constraints, success criteria
- [ ] Decompose into subtasks; identify dependencies (sequential vs parallel)
- [ ] Assign each subtask a routing method (self, tool, subagent)
- [ ] Execute subtasks in dependency order
- [ ] Validate each subtask output before feeding to the next
- [ ] Assemble final asset
- [ ] Run verification pass against original requirements
1. Parse
Identify: explicit requirements, implicit requirements (format conventions, quality bar), and constraints (length, tone, tech stack). If the request is genuinely ambiguous on a decision that changes the approach, state your assumption explicitly rather than asking — proceed with the most reasonable interpretation.
2. Decompose
Break the goal into the smallest set of subtasks that are each independently verifiable. Prefer a linear chain unless subtasks are truly independent (then parallelize). Write the plan as a short numbered list before executing it.
3. Route
For each subtask, pick the cheapest sufficient method:
- Direct reasoning/generation — for synthesis, writing, analysis within context
- Tool call — for anything requiring external data, computation, or file I/O
- Sub-agent/sub-task delegation — for large independent chunks of work that would otherwise bloat context (e.g., "research X thoroughly" before writing)
Don't over-delegate trivial steps; don't under-delegate steps that need isolated context.
4. Execute
Run subtasks in order. After each one, check the output is usable (right shape, right content) before moving to the next — don't chain a full pipeline on an unverified intermediate result.
5. Assemble
Combine subtask outputs into the target format (document, code, dataset, report). Normalize style/voice/formatting across combined pieces so the result reads as one coherent asset, not a stitched patchwork.
6. Verify
Re-read the original request and confirm every explicit requirement is met. Check format, completeness, and internal consistency (e.g., numbers in charts match numbers in text).
Example 1: Input: "Summarize these 5 documents and turn it into a slide deck outline." Output:
- Plan: extract key points per doc → merge/de-duplicate themes → structure into slide outline (title, 3-5 bullets/slide) → verify slide count matches scope.
- Execute each step, checking the merged theme list before building the outline.
- Final asset: a slide-by-slide outline with speaker notes, verified against all 5 source documents for coverage.
Example 2: Input: "Analyze this dataset and generate a report with visualizations." Output:
- Plan: load/clean data → compute key stats → decide which 3-4 visualizations best answer the implicit question → generate charts → write narrative referencing exact figures → assemble report.
- Route: cleaning/stats/charts → tool calls (code execution); narrative → direct generation.
- Verify: every chart is referenced in the text, all stats are consistent between sections.
- Always produce a visible plan before executing multi-step work — it's cheap and catches misunderstanding early.
- Validate intermediate outputs; a bad step early on compounds if unchecked.
- Keep subtask granularity coarse enough to be efficient, fine enough to be verifiable.
- State assumptions explicitly instead of stalling on ambiguity.
- Prefer the simplest routing (direct execution) unless context size, isolation, or specialized tooling justifies delegation.
- Match final output formatting to what was asked (code vs prose vs structured doc) — don't over- or under-deliver format.
- Skipping decomposition on "simple-looking" requests that actually have hidden multi-step structure.
- Chaining every subtask output blindly without checking correctness first.
- Over-delegating trivial subtasks to sub-agents, wasting overhead and losing context coherence.
- Assembling final output as disconnected fragments instead of a unified, consistently styled asset.
- Declaring completion without re-checking the original request line by line.