Workflows
Workflows are automated sequences of agent actions triggered by a schedule, a manual call, or an inbound webhook. Each run creates a conversation thread.
List workflows
GET /api/workflows
Authorization: Bearer nxr_...Create workflow
POST /api/workflows
Authorization: Bearer nxr_...
Content-Type: application/json
{
"name": "PR review pipeline",
"description": "Auto-review PRs on webhook trigger",
"agent_id": "uuid",
"trigger_type": "webhook",
"prompt_template": "Review PR #{{pr_number}}: {{pr_url}}"
}| Field | Type | Description |
|---|---|---|
name | string | Display name |
agent_id | uuid | Agent that runs the workflow |
trigger_type | string | manual, webhook, schedule |
prompt_template | string | Prompt sent to agent; use {{variable}} placeholders |
Get workflow
GET /api/workflows/{workflow_id}
Authorization: Bearer nxr_...Update workflow
PATCH /api/workflows/{workflow_id}
Authorization: Bearer nxr_...
Content-Type: application/json
{ "prompt_template": "New prompt with {{variable}}" }Delete workflow
DELETE /api/workflows/{workflow_id}
Authorization: Bearer nxr_...Activate / deactivate
POST /api/workflows/{workflow_id}/activate
POST /api/workflows/{workflow_id}/deactivate
Authorization: Bearer nxr_...Trigger manually
POST /api/workflows/{workflow_id}/trigger
Authorization: Bearer nxr_...
Content-Type: application/json
{ "variables": { "pr_number": "42", "pr_url": "https://github.com/..." } }Returns the created run ID. The workflow executes asynchronously.
Webhook trigger (unauthenticated)
Each workflow gets a unique webhook URL. Use it to trigger from external systems (GitHub Actions, GitLab CI, Zapier, etc.):
POST /api/workflows/{workflow_id}/webhook
Content-Type: application/json
{ "pr_number": "42", "pr_url": "https://github.com/..." }The request body is merged into the prompt template variables.
The webhook endpoint is public — no API key required. Treat the workflow ID as a secret, or add IP allowlisting at the nginx layer.
Run history
List runs
GET /api/workflows/{workflow_id}/runs
Authorization: Bearer nxr_...List workflow conversations
Each run creates a conversation. Browse them:
GET /api/workflows/{workflow_id}/conversations
Authorization: Bearer nxr_...Delete conversation
DELETE /api/workflows/{workflow_id}/conversations/{chat_id}
Authorization: Bearer nxr_...