API Routes
HTTP API for managing workflows and instances.
The Workflows fragment exposes HTTP routes for workflow management. Mount the fragment under a base
path (for example /api/workflows) and use that base URL in clients and the CLI.
Base URL
All paths below are relative to the fragment base URL, for example:
https://your-app.example.com/api/workflowsWorkflows
List workflows
GET /workflows
Returns the registered workflow names.
Instances
List instances
GET /workflows/:workflowName/instances
Query parameters:
status(optional):active | paused | errored | terminated | complete | waitingpageSize(optional, default 25, max 100)cursor(optional)
Create an instance
POST /workflows/:workflowName/instances
Body:
{ "id": "optional-id", "params": { "...": "..." } }If the workflow defines a schema, invalid params return WORKFLOW_PARAMS_INVALID.
Create a batch of instances
POST /workflows/:workflowName/instances/batch
Body:
{ "instances": [{ "id": "required-id", "params": { "...": "..." } }] }If the workflow defines a schema, invalid params return WORKFLOW_PARAMS_INVALID.
Get instance details
GET /workflows/:workflowName/instances/:instanceId
Returns status plus metadata including runNumber, params, and current step summary.
Get history
GET /workflows/:workflowName/instances/:instanceId/history
Query parameters:
runNumber(optional; defaults to latest run)pageSize(optional, default 25, max 100)stepsCursor,eventsCursor,logsCursor(optional)includeLogs(optional,true | false)logLevel(optional,debug | info | warn | error)logCategory(optional)order(optional,asc | desc)
Logs are only returned when includeLogs=true.
Pause / resume / restart / terminate
POST /workflows/:workflowName/instances/:instanceId/pause
POST /workflows/:workflowName/instances/:instanceId/resume
POST /workflows/:workflowName/instances/:instanceId/restart
POST /workflows/:workflowName/instances/:instanceId/terminate
Send an event
POST /workflows/:workflowName/instances/:instanceId/events
Body:
{ "type": "event-type", "payload": { "...": "..." } }Authorization hooks
All routes go through authorizeRequest. Dedicated hooks are also available for instance creation,
management actions, and send-event. If you need per-route policies, use those hooks in the fragment
config.