Agents vs Workflows: Why Not Both? — Sam Bhagwat, Mastra.ai
Aug 1, 2025 · 15:37
Sam Bhagwat, co-founder of Mastra and author of 'Principles of AI Agents', argues that the debate between agents and workflows is misguided—developers should combine both. He criticizes OpenAI's anti-workflow stance as 'being that guy' and LangChain's graph/node/edge APIs as harmful, advocating for fluent syntax over graph theory. Bhagwat defines agents as turn-based games and workflows as rules-engine dependency chains, noting that nondeterminism makes workflow tracing 10x more important in AI engineering. He demonstrates composition patterns: agents can be steps, workflows can be tools, and nested workflows handle dynamic tool injection. He recommends starting with agent power, then adding workflow control for reliability—e.g., breaking one LLM call into 12 for medical PDFs. Bhagwat concludes that practice trumps theory in this young field.