The initial wave of Agentic AI relied heavily on the ReAct (Reason + Act) framework. In ReAct, the LLM is the absolute orchestrator: it sits in an unconstrained while(True) loop, deciding what to think, what tool to call, and when to stop.
While mathematically elegant, ReAct is an operational nightmare. It suffers from infinite loops, tool hallucination, and catastrophic failure if the model loses track of its internal state. Flow Engineering is the architectural response to this chaos.
Flow Engineering is the practice of removing the orchestration responsibility from the LLM and placing it into a deterministic, code-defined State Machine or Directed Acyclic Graph (DAG).
Instead of one massive prompt instructing the model to "solve the problem," the problem is decomposed into a strict graph of cognitive nodes. The LLM only executes the logic within a specific node, and standard software engineering (Python/Go) routes the state to the next node.
The most famous example of Flow Engineering is the AlphaCodium architecture (originally designed for competitive programming). It completely discards the ReAct loop in favor of a rigid, multi-stage flow:
Why this works: At no point is the LLM asked to "manage" the process. It is only ever asked to perform a micro-task (e.g., "rank these 3 strategies"). The Python orchestration layer handles the persistence and state transitions.
Modern agent frameworks (like LangGraph or Temporal workflows) are built entirely around Flow Engineering.
The core of a flow is the State object. It is a strictly typed schema (e.g., a Pydantic model) that is passed from node to node.
class AgentState(BaseModel):
original_query: str
extracted_entities: List[str] = []
draft_document: Optional[str] = None
verification_errors: List[str] = []
State, call an LLM (or API) to perform a specific task, and return a mutation to the State.State and return the name of the next node to execute. (e.g., if state.verification_errors: return "FixerNode" else: return "End").Flow Engineering and TestTimeComputeScaling represent two ends of the agentic spectrum:
For 95% of enterprise use cases (RAG pipelines, data extraction, code review bots), unconstrained ReAct is dead. Flow Engineering—treating agents as state machines with LLM-powered nodes—provides the observability, debugging capability, and reliability required for production systems.