OPEN SOURCEAI AGENT EXECUTION ENGINE

Durable execution for AI agent workflows

Relay executes versioned workflow DAGs with leased workers, bounded retries, and replayable events. Operators can inspect every run, node attempt, model call, tool call, and usage record from one console.

Apache-2.0OpenAI Responses APIPostgreSQL durable state
Research briefRUN 7FC1 · LIVE
EXECUTING
Run inputaccepted
Researchgpt-5-mini
Analyzeattempt 1
Validateschema
Synthesizewaiting 2/3
Durable resultpending
EVENT 0041node.startedanalyze · fence 18
PostgreSQL 17source of truth
NATS JetStreamdurable notification
OpenAI Responsesmodel execution
Replayable eventsordered run history
EXECUTION LIFECYCLE

Define, execute, and inspect workflows

Relay manages the lifecycle from an immutable workflow definition to durable node execution. The console exposes the current state and complete event history for each run.

01

Define a workflow

Author immutable DAGs composed of model, tool, transform, and join nodes. Relay validates the topology before any work begins.

Versioned workflows · bounded inputs
02

Execute nodes durably

PostgreSQL records each transition. Leases, fencing tokens, retries, deadlines, and recovery scans coordinate work across failures.

At-least-once · stale work rejected
03

Inspect runs and attempts

Watch the live DAG, inspect every attempt, replay ordered events, track token usage, and cancel active work from one console.

SSE replay · usage records
ARCHITECTURE

PostgreSQL coordinates durable state

PostgreSQL commits workflow state and publishes dispatch records through an outbox. JetStream delivers notifications to replaceable workers, while fencing tokens protect committed results.

REQUEST
Console + APIvalidate · authenticate
1
DURABLE AUTHORITY
PostgreSQLruns · attempts · outbox
2
DISPATCH
JetStreamat-least-once wakeup
3
EXECUTION
Fenced workersOpenAI · MCP tools
fenced completion + ordered event
transactional authorityreplaceable deliveryRead the architecture notes
RELIABILITY CONTRACT

Reliability guarantees and limitations

Relay provides at-least-once execution with duplicate-safe internal state transitions. External systems remain subject to their own delivery and idempotency behavior.

01

PostgreSQL is the source of truth

Run state, attempts, leases, and outbox records are committed transactionally.

02

Fencing rejects stale completions

A worker cannot commit a result after its lease has been reassigned.

03

Deadlines bound failed attempts

Bounded retries and recovery scans identify and reschedule incomplete work.

04

MCP tools require explicit access

Connections use configured allowlists, schemas, and permissions.

External side effects: Calls that modify another system require idempotency keys or compensating actions to handle duplicate execution safely.

OPERATOR CONSOLE

Create and monitor a workflow

Use the console to define a DAG, submit a run, execute model and MCP tool nodes, and review attempts, events, and usage.

Open operator console