Import
Defaults
All functions accept optionalbaseUrl and apiKey:
| Parameter | Default |
|---|---|
baseUrl | http://127.0.0.1:7331 |
apiKey | undefined (no auth header) |
apiKey is provided, it is sent as Authorization: Bearer <token>.
Functions
runWorkflow
Start a new workflow run.| Parameter | Type | Required | Description |
|---|---|---|---|
workflowPath | string | Yes | Path to .tsx workflow file on the server |
input | unknown | Yes | Workflow input data |
runId | string | No | Custom run ID |
baseUrl | string | No | Server URL |
apiKey | string | No | Auth token |
resume
Resume a paused or failed run.| Parameter | Type | Required | Description |
|---|---|---|---|
workflowPath | string | Yes | Path to .tsx workflow file |
runId | string | Yes | Run ID to resume |
baseUrl | string | No | Server URL |
apiKey | string | No | Auth token |
POST /v1/runs with resume: true.
approve
Approve a node waiting for human approval.| Parameter | Type | Required | Description |
|---|---|---|---|
runId | string | Yes | Run ID |
nodeId | string | Yes | Node ID |
iteration | number | No | Loop iteration (default: 0) |
note | string | No | Approval note |
baseUrl | string | No | Server URL |
apiKey | string | No | Auth token |
deny
Deny a node waiting for human approval.| Parameter | Type | Required | Description |
|---|---|---|---|
runId | string | Yes | Run ID |
nodeId | string | Yes | Node ID |
iteration | number | No | Loop iteration (default: 0) |
note | string | No | Denial reason |
baseUrl | string | No | Server URL |
apiKey | string | No | Auth token |
streamEvents
Stream lifecycle events via SSE. ReturnsAsyncIterable<SmithersEvent>.
| Parameter | Type | Required | Description |
|---|---|---|---|
runId | string | Yes | Run ID |
baseUrl | string | No | Server URL |
apiKey | string | No | Auth token |
GET /v1/runs/:runId/events. Keep-alive comments are filtered. Completes when the stream closes.
getStatus
Get run status and summary.getFrames
List render frames for a run.| Parameter | Type | Required | Description |
|---|---|---|---|
runId | string | Yes | Run ID |
tail | number | No | Max frames (default: 20) |
baseUrl | string | No | Server URL |
apiKey | string | No | Auth token |
cancel
Cancel a running workflow.listRuns
List all runs. Requires serverdb.
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | number | No | Max runs (default: server default of 50) |
status | string | No | Filter by status |
baseUrl | string | No | Server URL |
apiKey | string | No | Auth token |