AYUMAD/AI ~/ai/workflows-and-orchestration 74 notes/

Workflows and orchestration

status evergreenupdated 2026-09-09tags ai-engineering, orchestration, workflows, map-of-content
flowchart LR
  Trigger --> Router
  Router --> Sequential
  Router --> Parallel
  Router --> AgentLoop
  Sequential --> Verify
  Parallel --> Verify
  AgentLoop --> Verify
  Verify -->|pass| Complete
  Verify -->|fail| RetryOrHuman[Retry, compensate, or ask human]

Framework mini-map

Framework Language Best fit Production readiness
LangGraph Python Complex workflows needing fine-grained graph control, durable state, human-in-the-loop. Nodes + edges with built-in persistence and LangGraph Studio. High — v1.0 Oct 2025; Uber, LinkedIn, Klarna, JP Morgan, Cisco.
CrewAI Python Role-based multi-agent with defined roles, goals, and backstories. Two modes: Crews (model-driven) and Flows (event-driven, deterministic). High — commercial AMP Cloud product.
AutoGen / MS Agent Framework Python + .NET AutoGen absorbed into Microsoft Agent Framework (merged with Semantic Kernel). Public preview Oct 2025, v1.0 Apr 2026. High (new MS Framework), low (legacy AutoGen).
OpenAI Agents SDK Python Minimal-abstraction SDK. Primitives: Agents, Handoffs, Guardrails. Built-in tracing, sandbox, MCP integration. High — first-party, actively maintained.
Mastra TypeScript TypeScript-first agents with Mastra Studio UI. Supports OpenAI, Anthropic, Google, xAI. Moderate — newer ecosystem.
Temporal Polyglot Durable execution engine for long-running workflows. Journal every step before executing; engine replays on restart. Used by Stripe, Revolut, Wise. High — battle-tested in financial systems.

See Workflow Patterns for topology selection and Multi-Agent Systems for multi-agent coordination.

Cost awareness across multi-step runs

Multi-step orchestration multiplies LLM cost. A single agent loop at 2k tokens per step across 10 steps is 20k tokens; a supervisor-worker system with 5 parallel subagents each spending 10k tokens hits 50k+ tokens per invocation. Budget controls: per-step and per-run token ceilings, max-retry limits, hard timeouts. Durable execution (Temporal, LangGraph checkpointing) avoids wasted spend by resuming from checkpoints rather than replaying entire runs.

Error recovery

Agent workflows fail non-deterministically. Orchestration must handle: transient LLM API errors (exponential backoff with jitter, never retry 400/401/404), tool failures (circuit breaker to stop calling a failing service), state loss (checkpoint serialization at each step), and unbounded loops (hard cap ~5 iterations with escalation). Durable execution engines provide engine-guaranteed idempotency — the journal is the audit trail. For compensation when partial work has side effects, the saga pattern (compensating transactions) or durable execution (replay from journal) are standard approaches. See Workflow Patterns § Error recovery for the detailed pattern catalog.

Sources and further reading

All links verified 2026-08-27.



← Behavior and Communication Controls · Home · Workflow Patterns →