# Production space

Every workflow has a back office for operating it once it's live. Open it from **Production** in the left sidebar: a table lists your workflows with their status dot (green Live / yellow Draft / red Error), run counts, and token usage — click a row to enter that agent's production space at `/agents/:id`.

## Going live

An agent serves traffic only while it is **active**. A newly created workflow starts as **Draft** (`is_active = false`) — you must explicitly switch it to **Live**, which runs a readiness check first. The switch is blocked if the graph has an Agent with no instructions, an HTTP node without a URL, a Send Email without a recipient, or a Sub-workflow without a target. Flip the Live/Draft toggle on the **Overview** tab (or in **Settings**). When inactive, published surfaces (API, widget, shared chat) and triggers (schedule, event listener) stop serving the agent.

There is no separate "publish" step anymore — save the workflow in the editor, then activate it and enable the surfaces you need from the **Deploy** tabs.

## The tabs

### Overview

Status at a glance for the last 7 days:

- **Runs (7d)**, **Success rate (7d)**, **p95 latency (7d)**, last update.
- The **Live/Draft** badge and activation toggle.
- **Recent errors** — failed runs with the failing node and error message; click a row to open its full trace.

### Conversations

Chat sessions are **persisted on every surface** — API, widget, and shared chat alike. The tab lists all sessions with:

- A **surface filter** (API / widget / shared chat) and full-text search over messages.
- Click a session to read the full transcript, message by message.

### Traces

Every run of the agent — manual, scheduled, triggered, or chat. Click a run to open its **per-node timeline**: each node's input, output, duration, and error, in execution order. This is the first stop when a production run misbehaves.

The Traces table is also the source of truth for production run exports. It merges durable async runs, manual editor logs, and trace-only published chat/channel runs into one owner-authenticated JSON feed:

- `GET /api/v1/prod/{workflow_ref}/traces?limit=50&offset=0&status=failed` returns run rows with `run_id`, `kind`, `status`, `trigger_kind`, timestamps, duration, `failed_node_id`, error, and token/cost rollups when available.
- `GET /api/v1/prod/{workflow_ref}/traces/{run_id}` returns the run summary plus `node_events` with `node_id`, `node_type`, `label`, `status`, `input_preview`, `output_preview`, error, duration, attempts, and per-node token/cost rollups.
- `GET /api/v1/prod/{workflow_ref}/traces/export?format=json|csv` returns an attachment for file download. The export uses the same list filters (`status`, `limit`, `offset`) and adds `node_limit` to cap embedded node events.

Use **Production > Traces** to download JSON or CSV directly with the current table filter, or call the export endpoint for incident reports and external observability jobs. The JSON attachment contains `export.schema_version`, `workflow`, `filters`, `count`, `node_event_count`, `node_events_truncated`, and `runs[]`; each run carries the same run fields plus sanitized `node_events[]`. CSV flattens run and node columns into one row per node event. The file export is redacted and bounded before it leaves the API: secret-looking keys, tokens, credentials, callback secrets, and sensitive query/header/body values are replaced with `[redacted]`, long previews are truncated, and JSON marks `node_events_truncated` when `node_limit` cuts the payload. `run_id` values prefixed with `log:` are manual execution logs; `chat:` runs may be synthesized from node events when no durable `WorkflowExecution` row exists.

### Metrics

Lightweight APM for the agent:

- **Success rate**, **p50** and **p95 latency** over the selected window.
- **Per-node statistics** — call counts, failure rates, and latency per node, computed from recorded node events. Use it to find the slow or flaky step in the graph.

### Deploy

Three sub-tabs, one per surface — see [Deployment](#/docs/deployment) for the full API reference:

- **API** — enable the published API, generate/revoke agent keys, copy a ready-made `curl` example.
- **Widget** — enable the anonymous embedded chat and copy the **iframe** snippet.
- **Shared chat** — hosted chat page protected by a username/password you define. Visitors keep their **conversation history per browser**: a history sidebar on the chat page lists their previous sessions and lets them resume any of them.

### Settings

- **Status** — the same Live/Draft toggle.
- **Execution timeout** — seconds before a run fails with a Timeout error (blank = unlimited).
- **Surface authentication** — enable/disable each surface and set the shared-chat username and password.

## Gotchas

- The status dot on the Production table turns **red** when the last runs errored — open Traces to see why.
- Deactivating an agent does not delete API keys; re-activating restores them.
- Conversations and traces are kept without a retention limit — search instead of scrolling. Workflow **run results**, however, are purged **30 days** after they reach a terminal state (`completed`/`failed`/`dead`/`cancelled`); the `run_id` stays pollable until then, after which the run-poll endpoints return `404`. Runs that are `awaiting_approval` or still in flight are never purged.

---

*Source: https://agentbuilder.systalink.sn/docs/production — human documentation.*
*Other language: [/docs-md/fr/production.md](/docs-md/fr/production.md).*
*Machine-readable index: [/llms.txt](/llms.txt).*
