Why Convex
Three properties make Convex the right foundation for an agentic orchestration platform:
| Property | What it means for Forge |
|---|---|
| Transactional mutations | Governance gate checks and step state transitions execute atomically. A step cannot be marked โrunningโ unless the concurrency limit passes in the same transaction. |
| Reactive subscriptions | Dashboard state updates in real time without polling. When a step completes or an approval resolves, every connected Burgundy client sees it instantly. |
| Durable workflows | The runs as a @convex-dev/workflow instance. If the Convex process restarts, the interpreter resumes from its last event checkpoint. |
Convex Execution Model
Convex Execution Model
๐ Queriesยท Read-only, reactive, cached
Dashboard subscribes to query results. Convex pushes updates when underlying data changes. Zero polling.
โ๏ธ Mutationsยท Transactional, serializable
State changes execute atomically. Governance checks, step transitions, and budget deductions are mutations.
๐ Actionsยท Side effects, external calls
HTTP dispatch to Bridge, LLM calls for native agents, gateway health checks. Can call mutations for state.
๐ Durable Workflowsยท @convex-dev/workflow
The .lobsterX interpreter runs as a durable workflow. Event-driven dispatch with checkpoint recovery.
๐ Ownership Boundary
Ownership Boundary
Workflow DefinitionsDAG ResolutionGovernance DecisionsBudget EnforcementRun History + AuditAgent Registry
๐ Gateway Owns
Live LLM ExecutionSession StateRuntime EnvironmentAgent WorkspaceCost Reporting
๐ Ownership Table
| Domain | Convex owns | Gateway owns |
|---|---|---|
| Workflow definitions | .lobsterX YAML, workflow versions, deployment configs | โ |
| Run orchestration | DAG resolution, step dispatch, condition evaluation, failure policies | Live LLM execution |
| Governance | 10-gate pipeline, policy evaluation, approval lifecycle | โ |
| Agent registry | Definitions, deployments, trust levels, skill assignments, role bindings | Runtime agent configs (OpenClaw only) |
| Budget and cost | Budget envelopes, spend tracking, cost aggregation, monthly resets | Per-execution token count and cost |
| Audit trail | Governance decisions, step events, approval resolutions, cost events | โ |
| Chat and memory | Channels, sessions, messages, session/channel/long-term memory | โ |
| Factories | Factory definitions, team assignments, blueprints, dev environments | Code execution (via exe.dev) |
๐๏ธ Schema Organization
The 117-table schema is split across individual files inconvex/schema/ and assembled by convex/schema.ts. Tables are grouped by domain:
- Workflow Execution
- Agent & Registry
- Governance & Budget
- Cost & Analytics
| Table | Purpose |
|---|---|
workflows | Workflow metadata (name, description, creator) |
workflowDocuments | Pinned .lobsterX YAML definitions |
workflowVersions | Version history for workflow definitions |
workflowRuns | Active and historical run state |
workflowCheckpoints | Interpreter checkpoint snapshots for rewind/branch |
stepResults | Per-step execution results, outputs, cost |
executionEvents | Granular execution events (tool calls, progress) |
approvals | HITL approval records (pending/approved/rejected) |
deployments | Workflow-to-gateway deployment bindings |
โ๏ธ The Workflow Interpreter
The interpreter (convex/interpreter.ts, 2200+ lines) is the core of Forgeโs execution engine. It runs as a Convex durable workflow and implements a deterministic event loop:
- Parse the pinned
.lobsterXYAML - Resolve the DAG into execution layers (groups of parallelizable steps)
- Dispatch ready steps through the governance pipeline
- Wait for completion events (callbacks from Bridge)
- Advance the DAG, evaluate conditions, handle failures
- Repeat until all steps are resolved or the run fails
The interpreter itself consumes zero LLM tokens. It is purely deterministic orchestration. All LLM execution happens in gateways.
Convex-Native Agents
Forge runs four agent types directly inside Convex using @convex-dev/agents. These agents have persistent threads, tool access, and transactional state management.
| Agent | Role | Key capabilities |
|---|---|---|
| Factory Manager | Overseer of a Factoryโs hybrid workforce | Task creation, worker coordination, budget management, GitHub integration |
| Factory Worker | Fills positions in Factory teams | Code execution via exe.dev, skill-based task completion |
| Task Manager | Project task orchestration | Task decomposition, dependency tracking, sprint management |
| Copilot Analysis | Run analysis and diagnostics | Post-run analysis, error investigation, performance insights |
Convex-native agents do not go through Bridge or the governance gate pipeline. They execute within Convexโs transactional boundary, call tools defined as Convex functions, and persist their conversation threads directly in the Convex agents component.
๐ Scheduled Operations
Convex runs 25+ cron jobs for platform maintenance:| Category | Jobs | Frequency |
|---|---|---|
| Gateway health | Health check all gateways | Every 60 seconds |
| Execution hardening | Workflow watchdog, step timeout enforcer | Every 2 min / 60 sec |
| Approvals | Reminder escalation, auto-reject stale | Every 15 min / daily |
| Cost analytics | Hourly rollup, daily rollup, weekly compaction | Hourly / daily / weekly |
| Budget management | Daily/weekly/monthly envelope resets | On schedule |
| Data retention | Token events (90d), audit events (365d), callback dedup (24h) | Daily / hourly |
| Agent sync | Registry sync for Convex-native and SDK agents | Daily |
| Memory compaction | Session memory compaction, channel-to-LTM promotion | Every 6h / weekly |
๐ Function Model
Convex functions follow a strict access control pattern:- Public Functions
- Internal Functions

