Skip to main content

6. The API

Access

All endpoints are under /api/ and are published through API Management, called the gateway. The gateway checks the caller's Entra token and role before the engine sees the request. Page 15 lists the roles. The engine's controllers hold no logic; each endpoint calls one service method.

Endpoints

Metadata endpoints

Callers: the pipeline, developers.

EndpointAction
POST /api/metadata/workflowRegister a definition. Rejects on failed checks.
PUT /api/metadata/workflowRegister several.
GET /api/metadata/workflow/{name}?version=Read one. Latest version when omitted.
GET /api/metadata/workflowList all.
DELETE /api/metadata/workflow/{name}/{version}Remove a version. Rejected if runs exist.
POST, PUT, GET, DELETE /api/metadata/taskdefsThe same for task definitions.
POST, GET /api/metadata/instructionsRegister and read instruction texts.

Workflow endpoints

Callers: applications, operators, the pipeline, the UI.

EndpointAction
POST /api/workflow/{name}Start a run. Body below. Returns the run id.
GET /api/workflow/{id}The run with all tasks, inputs, outputs. Reads the archive for old runs.
GET /api/workflow/{id}/statusStatus only.
GET /api/workflow/search?name=&status=&from=&to=&correlationId=&freeText=Search runs.
GET /api/workflow/{name}/correlated/{correlationId}Runs sharing a correlation id.
PUT /api/workflow/{id}/pause, .../resumePause and resume.
DELETE /api/workflow/{id}?reason=Terminate.
POST /api/workflow/{id}/retry, .../restart, .../rerunPage 13.
PUT /api/workflow/{id}/skiptask/{ref}Skip a task with a given output.
POST /api/workflow/{id}/messagesSend a message to a running run.
POST /api/workflow/{id}/signalSend a message and wake the run.
POST /api/workflow/testRun a definition with mocked task outputs. Used in the pipeline.
PUT, POST /api/workflow/bulk/{pause, resume, restart, retry, terminate}The same operation over a list of ids.

Start request body:

{ "name": "engagement_approval", "version": 3,
"input": { "engagement_id": 42 },
"correlationId": "engagement-42",
"priority": 50,
"taskToDomain": { "parse_pdf": "au" },
"idempotencyKey": "engagement-42-approval",
"idempotencyStrategy": "RETURN_EXISTING" }
FieldMeaning
versionOptional. Latest when omitted.
correlationIdYour own id for finding runs later.
priority0 to 99. Copied to worker queue messages.
taskToDomainRoutes named task types to a domain's worker pool. * applies to all. Page 9.
idempotencyKey, idempotencyStrategyWith FAIL, a second start with the same key returns 409. With RETURN_EXISTING, it returns the first run's id.

Task endpoints

Callers: workers, the Teams bridge, external systems.

EndpointAction
GET /api/tasks/poll/{type}?workerId=&domain=Take one waiting task. 204 when none.
GET /api/tasks/poll/batch/{type}?count=&timeout=Take up to count; waits up to timeout ms, maximum 5000.
POST /api/tasksPost a result. Body: {taskId, workflowId, status, outputData, logs, callbackAfterSeconds}.
POST /api/tasks/{workflowId}/{ref}/{status}Complete a task by name. Body becomes the output. Used for HUMAN and WAIT.
POST /api/tasks/{taskId}/logAppend a log line.
GET /api/tasks/{taskId}Read a task.
GET /api/tasks/searchSearch tasks.
GET /api/tasks/queue/sizesWaiting and dead-lettered counts per queue.
GET /api/tasks/queue/polldata?taskType=Last poll time per worker, to see whether a type has a live worker.
GET /api/tasks/external-storage-locationA short-lived upload URL for large outputs.

Event and schedule endpoints

Callers: the pipeline, operators.

EndpointAction
POST, PUT, GET, DELETE /api/eventManage event handlers. Page 11.
GET /api/event/executions?handler=What each handler did with each message.
POST, PUT, GET, DELETE /api/scheduleManage schedules. Page 11.

Admin endpoints

Callers: operators, monitoring.

EndpointAction
GET /healthChecks Azure SQL, Durable Task Scheduler, Service Bus, Blob.
GET /api/admin/configNon-secret settings.
GET /api/admin/envNon-secret configuration keys.
GET /api/admin/queuesActive, scheduled, and dead-lettered counts per queue.
POST /api/admin/requeue/{type}Move dead-lettered messages back to the queue.
POST /api/admin/repair/{id}Re-queue a run's open worker tasks.