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
| Parameter | Type | Description |
|---|---|---|
id | string | The station ID |
Request Body (optional)
| Field | Type | Description |
|---|---|---|
config_overrides | object | Per-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"
}
}
| Field | Type | Description |
|---|---|---|
status | string | Always "success" |
work_record_id | string | ID of the created work record (can be used to poll status) |
job_id | string | pg-boss job ID for the queued execution |
What happens after calling this endpoint
- A work record is created with
status: "pending" - An
executeStationjob is queued - The job freezes the station's config, with the run's
config_overrides, as the work record'sconfig_snapshot, freezes the line's location on it, and queues it - 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
| Code | Description |
|---|---|
400 | Station is disabled or archived, or config_overrides is not an object |
401 | Invalid or missing API credentials |
403 | API key lacks stations:create permission |
404 | Station 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
- Get Work Record — check execution status
- Station Object — full field reference
- Work Record Object — statuses, retries and how a run is queued and claimed