Skip to content

Workflows API

The Workflows API allows you to create, manage, and monitor your AI workflows on the Lumea platform.

Overview

Workflows are the core building blocks of the Lumea platform. A workflow defines a series of operations and tasks that are executed in a specific order to accomplish complex AI processes. This API enables you to programmatically manage your workflows, including creating, updating, and executing them.

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

Workflow Object

FieldTypeDescription
idstringUnique identifier for the workflow
namestringName of the workflow
descriptionstringOptional description of the workflow
versionstringVersion of the workflow
base_workflow_idstringID of the base workflow this was derived from
parametersobjectOptional default parameters for workflow execution

Endpoints

List Workflows

Retrieves a list of all registered workflows.

URL: /workflows

Method: GET

Query Parameters:

ParameterRequiredDescription
nameNoFilter workflows by name

Success Response:

  • Code: 200 OK
  • Content:
json
[
  {
    "id": "workflow123",
    "name": "Data Processing Workflow",
    "description": "Processes data from multiple sources",
    "version": "1.0.0",
    "base_workflow_id": "base123",
    "parameters": {
      "batch_size": 100,
      "threshold": 0.8
    }
  },
  {
    "id": "workflow456",
    "name": "Report Generation",
    "description": "Generates PDF reports",
    "version": "2.1.0",
    "base_workflow_id": "base456",
    "parameters": {
      "include_charts": true,
      "max_pages": 20
    }
  }
]

Refresh Workflows

Initiates a refresh of all workflows in the system. This is an asynchronous operation that launches a worker task.

URL: /workflows/refresh

Method: POST

Success Response:

  • Code: 200 OK
  • Content:
json
{
  "message": "Workflows refresh started"
}

Create Workflow

Creates a new custom workflow based on an existing base workflow.

URL: /workflows

Method: POST

Request Body:

json
{
  "name": "Custom Data Processing",
  "description": "Modified version of data processing workflow",
  "version": "1.0.0",
  "base_workflow_id": "base123",
  "parameters": {
    "batch_size": 200,
    "threshold": 0.9
  }
}
FieldTypeRequiredDescription
namestringYesName of the custom workflow
descriptionstringNoDescription of the workflow
versionstringYesVersion of the custom workflow
base_workflow_idstringYesID of the base workflow to derive from
parametersobjectNoDefault parameters for workflow execution

Success Response:

  • Code: 200 OK
  • Content:
json
{
  "id": "custom123",
  "name": "Custom Data Processing",
  "description": "Modified version of data processing workflow",
  "version": "1.0.0",
  "base_workflow_id": "base123",
  "parameters": {
    "batch_size": 200,
    "threshold": 0.9
  }
}

Error Responses:

  • Code: 400 Bad Request
    • Content: {"detail": "Base workflow not found"}

Delete Workflow

Deletes a custom workflow.

URL: /workflows/{workflow_id}

Method: DELETE

URL Parameters:

ParameterDescription
workflow_idThe unique ID of the workflow

Success Response:

  • Code: 200 OK
  • Content:
json
{
  "message": "Workflow deleted successfully"
}

Error Responses:

  • Code: 400 Bad Request
    • Content: {"detail": "Workflow not found"}
    • Content: {"detail": "Failed to delete workflow"}

Get Workflow

Retrieves details of a specific workflow.

URL: /workflows/{workflow_id}

Method: GET

URL Parameters:

ParameterDescription
workflow_idThe unique ID of the workflow

Success Response:

  • Code: 200 OK
  • Content:
json
{
  "id": "workflow123",
  "name": "Data Processing Workflow",
  "description": "Processes data from multiple sources",
  "version": "1.0.0",
  "base_workflow_id": "base123",
  "parameters": {
    "batch_size": 100,
    "threshold": 0.8
  }
}

Error Response:

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

Update Workflow

Updates properties of an existing workflow.

URL: /workflows/{workflow_id}

Method: PUT

URL Parameters:

ParameterDescription
workflow_idThe unique ID of the workflow

Request Body:

json
{
  "name": "Updated Workflow Name",
  "description": "Updated workflow description",
  "parameters": {
    "batch_size": 150,
    "threshold": 0.85
  }
}
FieldTypeRequiredDescription
namestringNoUpdated name of the workflow
descriptionstringNoUpdated description of the workflow
parametersobjectNoUpdated default parameters for the workflow

Success Response:

  • Code: 200 OK
  • Content:
json
{
  "id": "workflow123",
  "name": "Updated Workflow Name",
  "description": "Updated workflow description",
  "version": "1.0.0",
  "base_workflow_id": "base123",
  "parameters": {
    "batch_size": 150,
    "threshold": 0.85
  }
}

Error Response:

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

Clear Workflow Cache

Clears the cache for a specific workflow.

URL: /workflows/{workflow_id}/cache/clear

Method: POST

URL Parameters:

ParameterDescription
workflow_idThe unique ID of the workflow

Success Response:

  • Code: 200 OK
  • Content:
json
{
  "message": "Cache cleared successfully"
}

Error Responses:

  • Code: 400 Bad Request

    • Content: {"detail": "Error message"}
  • Code: 404 Not Found

    • Content: {"detail": "Workflow not found"}