ReferenceAPI ReferenceRuns

Runs

A run represents a single execution of a pipeline. When you trigger a pipeline (manually, via schedule, or through a trigger), RAT creates a run, dispatches it to the runner, and tracks its lifecycle from pending through success or failed.


Endpoints

MethodEndpointDescription
GET/api/v1/runsList all runs
POST/api/v1/runsTrigger a new pipeline run
GET/api/v1/runs/{id}Get run details
POST/api/v1/runs/{id}/cancelCancel a running pipeline
GET/api/v1/runs/{id}/logsGet run logs (SSE or JSON)

Run Statuses

StatusDescription
pendingRun has been created and is queued for execution
runningPipeline is actively executing
successPipeline completed successfully, branch merged
failedPipeline failed (SQL error, quality test failure, etc.)
cancelledRun was manually cancelled

List Runs

GET /api/v1/runs

Returns a paginated list of runs, optionally filtered by pipeline, namespace, layer, status, or date range.

Query Parameters

ParameterTypeDefaultDescription
namespacestringFilter by namespace
layerstringFilter by layer
pipelinestringFilter by pipeline name
statusstringFilter by status (pending, running, success, failed, cancelled)
fromstringFilter runs created after this ISO 8601 timestamp
tostringFilter runs created before this ISO 8601 timestamp
sortstringcreated_atSort field
orderstringdescSort direction (asc, desc)
limitinteger50Items per page (max 200)
offsetinteger0Number of items to skip

Request

curl "http://localhost:8080/api/v1/runs?namespace=default&layer=silver&pipeline=orders&status=running"

Response — 200 OK

{
  "runs": [
    {
      "id": "run-uuid",
      "namespace": "default",
      "layer": "silver",
      "pipeline": "orders",
      "status": "success",
      "trigger": "manual",
      "started_at": "2026-02-12T14:00:00Z",
      "finished_at": "2026-02-12T14:00:05Z",
      "duration_ms": 4500,
      "rows_written": 12340,
      "created_at": "2026-02-12T14:00:00Z"
    }
  ],
  "total": 42
}

Response Fields

FieldTypeDescription
runsarrayList of run objects
runs[].idstringRun UUID
runs[].namespacestringPipeline namespace
runs[].layerstringPipeline layer
runs[].pipelinestringPipeline name
runs[].statusstringCurrent run status
runs[].triggerstringHow the run was triggered: manual, schedule:hourly, webhook, etc.
runs[].started_atstring|nullISO 8601 timestamp when execution began
runs[].finished_atstring|nullISO 8601 timestamp when execution completed
runs[].duration_msinteger|nullTotal execution time in milliseconds
runs[].rows_writteninteger|nullNumber of rows written to the target table
runs[].created_atstringISO 8601 creation timestamp
totalintegerTotal number of matching runs

Create Run

POST /api/v1/runs

Triggers a new pipeline run. The run is created in pending status and dispatched to the runner for execution.

Request Body

FieldTypeRequiredDescription
namespacestringYesPipeline namespace
layerstringYesPipeline layer
pipelinestringYesPipeline name
triggerstringNoTrigger source (default: manual)

Request

curl -X POST http://localhost:8080/api/v1/runs \
  -H "Content-Type: application/json" \
  -d '{
    "namespace": "default",
    "layer": "silver",
    "pipeline": "orders",
    "trigger": "manual"
  }'

Response — 202 Accepted

{
  "run_id": "abc123",
  "status": "pending"
}

The response uses 202 Accepted (not 201 Created) because the run has been queued but not yet executed. Use GET /api/v1/runs/{id} or GET /api/v1/runs/{id}/logs (SSE) to track execution progress.

Error Responses

StatusCodeDescription
400INVALID_ARGUMENTMissing required fields, invalid namespace/layer/name
404NOT_FOUNDPipeline not found

Get Run

GET /api/v1/runs/{id}

Returns the full details for a single run.

Path Parameters

ParameterTypeDescription
idstringRun UUID

Request

curl http://localhost:8080/api/v1/runs/abc123

Response — 200 OK

{
  "id": "abc123",
  "namespace": "default",
  "layer": "silver",
  "pipeline": "orders",
  "status": "success",
  "trigger": "manual",
  "started_at": "2026-02-12T14:00:00Z",
  "finished_at": "2026-02-12T14:00:05Z",
  "duration_ms": 4500,
  "rows_written": 12340,
  "error": null,
  "created_at": "2026-02-12T14:00:00Z"
}

Response Fields

FieldTypeDescription
idstringRun UUID
namespacestringPipeline namespace
layerstringPipeline layer
pipelinestringPipeline name
statusstringCurrent run status
triggerstringTrigger source
started_atstring|nullExecution start timestamp
finished_atstring|nullExecution end timestamp
duration_msinteger|nullExecution duration in milliseconds
rows_writteninteger|nullRows written to target table
errorstring|nullError message if the run failed
created_atstringCreation timestamp

Error Responses

StatusCodeDescription
404NOT_FOUNDRun not found

Cancel Run

POST /api/v1/runs/{id}/cancel

Cancels a running pipeline. Only runs in pending or running status can be cancelled.

Path Parameters

ParameterTypeDescription
idstringRun UUID

Request

curl -X POST http://localhost:8080/api/v1/runs/abc123/cancel

Response — 200 OK

{
  "run_id": "abc123",
  "status": "cancelled"
}

Error Responses

StatusCodeDescription
404NOT_FOUNDRun not found
409ALREADY_EXISTSRun is not cancellable (already in a terminal state: success, failed, or cancelled)

Get Run Logs

GET /api/v1/runs/{id}/logs

Returns logs for a pipeline run. Supports two modes: SSE streaming for real-time log tailing, and JSON for fetching all available logs at once.

Path Parameters

ParameterTypeDescription
idstringRun UUID

SSE Streaming Mode

To receive logs in real-time via Server-Sent Events, set the Accept header:

curl -H "Accept: text/event-stream" http://localhost:8080/api/v1/runs/abc123/logs

SSE Event Types

EventData ShapeDescription
log{"timestamp": "...", "level": "...", "message": "..."}A log line from execution
status{"status": "...", "rows_written": N, "duration_ms": N}Run status change
error{"message": "..."}An error occurred during execution

SSE Example

event: log
data: {"timestamp": "2026-02-12T14:00:01Z", "level": "info", "message": "Starting pipeline silver.orders"}

event: log
data: {"timestamp": "2026-02-12T14:00:02Z", "level": "info", "message": "Executing SQL..."}

event: log
data: {"timestamp": "2026-02-12T14:00:04Z", "level": "info", "message": "Writing 12340 rows to Iceberg"}

event: status
data: {"status": "success", "rows_written": 12340, "duration_ms": 4500}

For active runs, the SSE stream keeps the connection open and polls for new logs every 2 seconds until the run reaches a terminal state (success, failed, or cancelled). For completed runs, all logs are sent immediately and the connection is closed.

JSON Mode (Default)

Without the Accept: text/event-stream header, the endpoint returns all available logs as JSON:

curl http://localhost:8080/api/v1/runs/abc123/logs

Response — 200 OK

{
  "logs": [
    {
      "timestamp": "2026-02-12T14:00:01Z",
      "level": "info",
      "message": "Starting pipeline silver.orders"
    },
    {
      "timestamp": "2026-02-12T14:00:02Z",
      "level": "info",
      "message": "Executing SQL..."
    },
    {
      "timestamp": "2026-02-12T14:00:04Z",
      "level": "info",
      "message": "Writing 12340 rows to Iceberg"
    }
  ],
  "status": "success"
}

Response Fields

FieldTypeDescription
logsarrayArray of log entries
logs[].timestampstringISO 8601 timestamp
logs[].levelstringLog level: debug, info, warn, error
logs[].messagestringLog message
statusstringCurrent run status

Error Responses

StatusCodeDescription
404NOT_FOUNDRun not found