Skip to main content
Gloo Forge is built on a four-layer architecture designed around a single principle: Convex is the source of truth, gateways are ephemeral execution surfaces. Every workflow definition, governance decision, run history record, and token spend attribution lives in . Gateways execute work and report back. The connects them.

🏗️ Four-Layer Architecture

System Architecture

BurgundyBurgundy· Operator Dashboard
apps/burgundy — Next.js 15, React 19

85+ routes. Reads from Convex (subscriptions) and Bridge (REST/SSE). All pages are client-rendered.

Agent RegistryWorkflow RunsApprovalsObservability
convex subscriptions (useQuery / useMutation)
bridge rest + sse
ConvexConvex Engine· Source of Truth

117 tables, workflow interpreter, governance engine, native agents

SchemaInterpreterGovernanceConvex-Native Agents
BridgeBridge· Execution Router

Express, SSE, adapter loading

DispatchSSE Streaming
dispatch → adapter interface → results + callbacks
OpenClawOpenClaw

Stateful daemon. Agent configs, MCP, sandboxing, workspace files.

Claude Agent SDKClaude Agent SDK

Claude Agent SDK. Stateless. Native subagent orchestration.

▲ Vercel AI

Vercel AI SDK. Lightweight, structured JSON output.

Gloo AI

Auto-routing, grounded completions, tradition.

Burgundy Burgundy
Convex Convex
Bridge
Gateways

🔀 Dual Execution Model

Forge runs agents through two distinct execution paths depending on the agent type and use case.
The standard path for workflow execution via Bridge to gateway adapters.

Prescriptive Workflow Flow

Interpreter
Governance
Dispatch
Bridge
Adapter
Gateway
Callback

Steps pass through Bridge to gateway runtimes. Full governance pipeline. Stateless per-execution.

Convex-native agents (Factory Manager, Copilot, etc.) do not go through Bridge. They execute directly inside Convex. Routing them through Bridge would add latency and lose transactional guarantees.

📡 Data Flow

Four communication paths connect the layers. Each serves a distinct purpose.
PathProtocolDirectionPurpose
BurgundyConvexWebSocket subscriptionsBidirectionalReal-time reactive queries and mutations. All durable state.
BurgundyBridgeREST + SSEBidirectionalLive gateway state, execution event streaming, agent management.
ConvexBridgeGatewayHTTP dispatchOutboundStep execution requests with governance constraints.
GatewayBridgeConvexHTTP callbacksInboundExecution results, token usage, cost data. 3x retry with backoff.

🔐 Ownership Boundaries

A strict ownership boundary separates what Convex controls from what gateways control.
ConcernOwnerDetails
Workflow definitionsConvex.lobsterX YAML stored in workflowDocuments, pinned at run start
DAG resolutionConvexinterpreter.ts resolves step ordering and parallelism
Governance decisionsConvex10-gate pipeline in governanceEngine.ts
Budget enforcementConvexBudget envelopes, agent spend tracking, monthly resets
Run historyConvexworkflowRuns, stepResults, tokenEvents, auditEvents
Agent registryConvexDefinitions, deployments, skills, trust levels, role bindings
Live executionGatewayLLM calls, tool invocation, file I/O, sandboxed code execution
Session stateGatewayConversation context during a single execution
Cost reportingGatewayToken counts and cost per execution, reported via callback
Convex owns all durable state. Gateways own live execution. If a gateway crashes mid-execution, Convex detects the timeout (enforced every 60 seconds by the step timeout cron) and applies the step’s on_failure policy.

💡 Key Design Decisions

Convex provides three properties that are hard to replicate with traditional stacks:
  1. Transactional mutations ensure that governance decisions and step state changes are atomic. A step cannot be marked “running” unless the concurrency check passes in the same transaction.
  2. Reactive subscriptions push state changes to Burgundy instantly. When a step completes, the dashboard updates without polling.
  3. Durable workflows via @convex-dev/workflow give the interpreter crash recovery. If the Convex process restarts, the interpreter resumes from its last checkpoint.
Bridge exists because gateways are external processes with their own lifecycle. Bridge handles concerns that should not live in Convex:
  • Adapter loading selects the correct runtime implementation at startup.
  • SSE streaming requires long-lived HTTP connections incompatible with serverless functions.
  • Callback retry ensures result delivery even when Convex is temporarily unavailable.
Bridge is not middleware. It does not transform data or apply business logic. It routes.
Different execution runtimes have different strengths. OpenClaw provides persistent agent workspaces and MCP server support. Claude Agent SDK provides native subagent orchestration. Vercel AI SDK offers lightweight structured output. Gloo AI provides intelligent model routing, RAG-grounded completions, and tradition-aware responses. The ExecutionAdapter interface normalizes these differences so the rest of the platform treats gateways uniformly. A single Bridge instance can load multiple adapters simultaneously, routing each dispatch to the correct adapter by provider name.
See also: Convex Engine | Bridge & Adapters | Gateways