Keep the first version small
Start with one provider, one model, one agent, and one output. Add schemas, tools, prompts, resources, and parallelism only when the workflow needs them.Keep secrets out of instructions
Do not interpolate secrets into model instructions unless the external provider explicitly needs that value. Provider keys and MCP tokens belong in provider or MCP configuration.Prefer structured outputs
Split fan-out and aggregation
Use separate steps when a workflow needs to process many items and then produce one final result.analyze_task runs once per task, and those iterations may run in parallel. The final summarize_project agent aggregates the array produced by agent.analyze_task.
Continue context only when needed
Usecontext: agent.previous when the next agent should continue the previous message history. Use structured references when you only need data.