Skip to content

Runs API

The Runs API allows you to execute, monitor, and manage individual workflow runs on the Lumea platform.

Overview

Workflow runs are instances of workflows that are executed with specific input parameters. This API enables you to start new workflow runs, monitor their status, retrieve logs, and manage execution.

Note: Each customer receives a custom deployment with a unique API endpoint. The endpoints described in this documentation should be prefixed with your organization's specific API URL provided during onboarding.

Data Models

WorkflowRun Object

FieldTypeDescription
idstringUnique identifier for the workflow run
workflow_idstringID of the workflow being executed
statusstringCurrent status of the run (pending, running, completed, failed, stopped)
inputsobjectInput parameters provided for this workflow run
queue_idstringOptional queue ID if run was added to a queue
created_atstringTimestamp when the run was created
updated_atstringTimestamp when the run was last updated
stateobjectCurrent internal state of the workflow run (included only when requested)

Endpoints

Start Workflow Run

Initiates a new workflow run, either immediately or by adding it to a queue.

URL: /runs

Method: POST

Request Body:

json
{
  "workflow_id": "workflow123",
  "worker_task_type": "short_running",
  "inputs": {
    "parameter1": "value1",
    "parameter2": 100
  },
  "queue_id": "queue123"
}
FieldTypeRequiredDescription
workflow_idstringYesID of the workflow to execute
worker_task_typestringNoType of worker to use (defaults to "short_running")
inputsobjectNoInput parameters for the workflow
queue_idstringNoQueue ID to add the run to (for deferred execution)

Success Response:

  • Code: 200 OK
  • Content:
json
{
  "id": "run123",
  "workflow_id": "workflow123",
  "status": "pending",
  "inputs": {
    "parameter1": "value1",
    "parameter2": 100
  },
  "queue_id": "queue123",
  "created_at": "2023-06-01T12:00:00Z",
  "updated_at": "2023-06-01T12:00:00Z"
}

Get Workflow Run

Retrieves details of a specific workflow run.

URL: /runs/{run_id}

Method: GET

URL Parameters:

ParameterDescription
run_idThe unique ID of the workflow run

Query Parameters:

ParameterRequiredDescription
includeNoComma-separated list of fields to include (e.g., "state")

Success Response:

  • Code: 200 OK
  • Content:
json
{
  "id": "run123",
  "workflow_id": "workflow123",
  "status": "running",
  "inputs": {
    "parameter1": "value1",
    "parameter2": 100
  },
  "queue_id": null,
  "created_at": "2023-06-01T12:00:00Z",
  "updated_at": "2023-06-01T12:01:00Z"
}

Error Response:

  • Code: 400 Bad Request
    • Content: {"detail": "Error message"}

Stop Workflow Run

Stops a running workflow execution.

URL: /runs/{run_id}/stop

Method: POST

URL Parameters:

ParameterDescription
run_idThe unique ID of the workflow run

Success Response:

  • Code: 200 OK
  • Content:
json
{
  "message": "Run stopped successfully"
}

Error Responses:

  • Code: 400 Bad Request
    • Content: {"detail": "Run not found"}
    • Content: {"detail": "Error message"}

List Workflow Runs

Retrieves a list of workflow runs with optional filtering.

URL: /runs

Method: GET

Query Parameters:

ParameterRequiredDescription
statusNoFilter runs by status
workflow_idNoFilter runs by workflow ID
queue_idNoFilter runs by queue ID
limitNoMaximum number of runs to return
offsetNoNumber of runs to skip for pagination
includeNoComma-separated list of fields to include (e.g., "state")

Success Response:

  • Code: 200 OK
  • Content:
json
[
  {
    "id": "run123",
    "workflow_id": "workflow123",
    "status": "completed",
    "inputs": {
      "parameter1": "value1",
      "parameter2": 100
    },
    "queue_id": null,
    "created_at": "2023-06-01T12:00:00Z",
    "updated_at": "2023-06-01T12:05:00Z"
  },
  {
    "id": "run456",
    "workflow_id": "workflow456",
    "status": "pending",
    "inputs": {
      "parameter1": "value2",
      "parameter2": 200
    },
    "queue_id": "queue123",
    "created_at": "2023-06-01T12:10:00Z",
    "updated_at": "2023-06-01T12:10:00Z"
  }
]

Error Response:

  • Code: 400 Bad Request
    • Content: {"detail": "Error message"}

Get Workflow Run Logs

Retrieves logs for a specific workflow run.

URL: /runs/{run_id}/logs

Method: GET

URL Parameters:

ParameterDescription
run_idThe unique ID of the workflow run

Query Parameters:

ParameterRequiredDescription
levelNoFilter logs by level (e.g., "info", "error")
after_idNoReturn only logs after the specified log ID

Success Response:

  • Code: 200 OK
  • Content:
json
[
  {
    "id": "log123",
    "run_id": "run123",
    "level": "info",
    "message": "Workflow execution started",
    "timestamp": "2023-06-01T12:00:10Z"
  },
  {
    "id": "log124",
    "run_id": "run123",
    "level": "info",
    "message": "Processing input data",
    "timestamp": "2023-06-01T12:00:15Z"
  }
]

Error Responses:

  • Code: 400 Bad Request
    • Content: {"detail": "Error message"}
  • Code: 404 Not Found
    • Content: {"detail": "Log item not found"}