Technical paper · RAILS

The Graph Is Deterministic, Even When the Nodes Are Not.

How Agent Builder makes enterprise AI agents reliable by compiling visual workflows into deterministic state machines, in which the stochastic model is one bounded, typed node among many.

  • agent orchestration
  • determinism
  • state machines
  • LangGraph
  • workflow compilation
  • node catalog
  • containment middleware
  • resumable execution
RAILS technical paper cover

Core thesis

A workflow can be deterministic even when its nodes are not.You do not get reliable agents by making the model predictable;you get them by building a harness whose control flow, contracts, and side effects are predictable, and placing the model inside it as one bounded node.

Abstract

The reliability problem with enterprise AI agents is usually misdiagnosed. The instinct is to blame the model: it is stochastic, so the agent is unpredictable. But the unpredictability that blocks production is rarely the model picking a slightly different word; it is the agent taking a different path, calling a tool it should not have, looping without end, or producing an output a downstream system cannot consume. That is a property of how the agent is orchestrated, not of the model s sampling.

We describe RAILS (Reliable Agent Execution via Layered State-machines), the execution architecture of FlowX.AI s Agent Builder, and argue a thesis in the spirit of containment engineering: a workflow can be deterministic even when its nodes are not.

Agent Builder defines an agent as an explicit graph of typed nodes and edges, compiles it by topological sort into a LangGraph state machine of parallel execution phases, and runs it phase by phase with checkpointed, resumable state. Control flow is deterministic by construction: a Condition node branches on a Python expression, an Orchestrator routes via structured output into a fixed set of branches, an Aggregator merges parallel results by declared rules. The stochastic model is confined to specific node types, wrapped by middleware that caps calls, retries, falls back, and times out, and bracketed by guardrail and privacy nodes. The result is that the parts of the system that must be predictable, the control flow, the I/O contracts, the side effects, are predictable, while generation is placed deliberately and observed.

We present the compilation pipeline, a determinism gradient over the full catalog of thirty-eight node types across eight categories, the containment middleware, the multi-agent patterns, and an illustrative regulated claims workflow, and we show why determinism is an architectural property to be engineered, not a model property to be hoped for.

Series

Part of the FlowX.AIpaper series.

Each paper names a framework and shows it running in production — governance, reliability, memory, and measurement, engineered rather than hoped for.