Relay BYO deployment example
This walkthrough self-hosts ArcFlow Relay beside your own arcflow-server using Docker Compose. Browser clients use site tokens and Origin checks identical to managed Relay.
Primary example: Relay BYO deployment walkthrough.
What this example demonstrates
Bring-your-own (BYO) Relay lets operators run the browser proxy in their VPC while upstream execution stays on arcflow-server. Site configuration (allowed origins, rate limits, upstream runtime keys) loads from ARCFLOW_RELAY_SITES_JSON.
Prerequisites
| Item | Required |
|---|---|
arcflow-server reachable | Default http://localhost:8080 |
| Docker Compose v2 | For compose.yml in example dir |
| Published workflow | e.g. chat workflow on server |
| Frontend | Static app with Relay env vars |
| Tutorial track | Track F (Relay section) |
Step 1: Start upstream server
From repository root:
Step 2: Configure Relay sites JSON
Export upstream URL and site definition (from README.md):
On Linux Docker, replace host.docker.internal with the host gateway IP if needed.
Step 3: Start BYO Relay
Verify health:
Step 4: Point static frontend at BYO Relay
Run Static chat widget walkthrough or your own static bundle against port 8090.
Relay routes
| Method | Path | Purpose |
|---|---|---|
| GET | /health | Liveness |
| POST | /v1/sites/{site_id}/runs | Create run |
| GET | /v1/sites/{site_id}/runs/{run_id} | Poll status |
| GET | /v1/sites/{site_id}/runs/{run_id}/trace | Fetch trace |
Auth: Authorization: Bearer {site_token} plus allowed Origin header on browser requests.
Expected output
Health endpoint returns 200. Browser chat through Relay creates runs on upstream server with site-scoped runtime key. Rate limiting applies per rate_limit_rpm when configured.
Pass criteria:
| Check | Expected |
|---|---|
/health | 200 |
| POST run from allowed origin | 201 with run_id |
| POST from disallowed origin | Rejected at Relay |
| Upstream receives run | Visible in server logs or GET /v1/runs with server key |
Trace events you should see
Retrieve via Relay trace route or server admin tools. Expect standard workflow lifecycle events on published workflow runs (WorkflowStarted, StepCompleted, WorkflowCompleted, optional MemoryRetrieved for RAG sites).
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Relay cannot reach upstream | Wrong ARCFLOW_UPSTREAM_URL from container | Use host gateway or shared Docker network |
| 401 from upstream | upstream_runtime_key mismatch | Match ARCFLOW_SERVER_API_KEY on server |
| 403 Origin | Browser origin not in JSON | Add exact origin string to allowed_origins |
| Inline workflow rejected | allow_inline: false | Publish workflow on server; use runPublished |
Related
| Resource | Link |
|---|---|
| Static chat widget | static-chat-widget.md |
| Static examples index | Static chat widget walkthrough |
| Tutorial track | Track F |