Run Station

POST /api/v1/stations/:id/run

Triggers execution of a station — the API equivalent of clicking the "Run" button in the UI. Creates a work record and queues the run. No body is required.

Path Parameters

ParameterTypeDescription
idstringThe station ID

Request Body (optional)

FieldTypeDescription
config_overridesobjectPer-run config, shallow-merged over the station's config when the run is queued. Stored on the work record as config_overrides

Example Request

curl -X POST "https://orchestrator.assemblyline.sh/api/v1/stations/st_xyz789/run" \
  -H "api-key: al_xxxxxxxxxxxx" \
  -H "api-secret: xxxxxxxxxxxxxxxx"

With overrides:

curl -X POST "https://orchestrator.assemblyline.sh/api/v1/stations/st_xyz789/run" \
  -H "api-key: al_xxxxxxxxxxxx" \
  -H "api-secret: xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "config_overrides": { "source_dir": "samples/2024-01" } }'

Response

Returns the work record ID and job ID with status 201 Created:

{
  "data": {
    "status": "success",
    "work_record_id": "ZkeZBhQT9c6P",
    "job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
}
FieldTypeDescription
statusstringAlways "success"
work_record_idstringID of the created work record (can be used to poll status)
job_idstringpg-boss job ID for the queued execution

What happens after calling this endpoint

  1. A work record is created with status: "pending"
  2. An executeStation job is queued
  3. The job freezes the station's config, with the run's config_overrides, as the work record's config_snapshot, freezes the line's location on it, and queues it
  4. A factory session at that location claims the run (status: "running") and runs the station's handler

Use GET /api/v1/work-records/:id to check execution progress.

Errors

CodeDescription
400Station is disabled or archived, or config_overrides is not an object
401Invalid or missing API credentials
403API key lacks stations:create permission
404Station not found

Error Responses

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Station is disabled"
  }
}
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Station not found"
  }
}

Use Cases

  • Fan-out: Station P1's handler discovers N workpieces and triggers N independent P2 runs via this endpoint
  • External triggers: CI/CD pipelines or external systems trigger station execution
  • Scripting: Batch-trigger several stations

See Also