Limai Docs
API ReferenceProjects

Workflows

Manage automated workflows within a project

List Workflows

GET/api/v1/projects/{projectId}/workflows

Returns all workflows in a project with optional status filtering.

Parameters

NameTypeInRequiredDescription
projectIdstringpathYesThe project ID
statusstringqueryNoFilter by status: ACTIVE, PAUSED, or DISABLED

Request

const res = await fetch(
"https://app.limai.io/api/v1/projects/proj_abc123/workflows",
{
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
  },
}
);
const workflows = await res.json();

Response

Response200
[
  {
    "id": "wf_001",
    "name": "Invoice Processing",
    "description": "Process invoices on extraction",
    "status": "ACTIVE",
    "triggerTypes": [
      "DOCUMENT_EXTRACTED"
    ],
    "ingestEmailAddress": null,
    "deploymentRoutes": [
      {
        "deploymentId": "dep_001",
        "deploymentName": "Invoice Extractor"
      }
    ],
    "executionCount": 42,
    "createdAt": "2025-01-01T00:00:00.000Z",
    "updatedAt": "2025-01-15T00:00:00.000Z"
  }
]

Create Workflow

POST/api/v1/projects/{projectId}/workflows

Creates a new workflow with trigger types and deployment routes.

Parameters

NameTypeInRequiredDescription
projectIdstringpathYesThe project ID
namestringbodyYesWorkflow name (must be unique within project)
descriptionstringbodyNoWorkflow description
agentPromptstringbodyYesInstructions for the workflow agent
triggerTypesstring[]bodyYesTrigger types: DOCUMENT_EXTRACTED, DOCUMENT_REVIEWED, EMAIL_RECEIVED
deploymentIdsstring[]bodyNoDeployment IDs to route to
connectionIdstringbodyNoIntegration connection ID

Request

const res = await fetch(
"https://app.limai.io/api/v1/projects/proj_abc123/workflows",
{
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "Invoice Processing",
    agentPrompt: "Process extracted invoice data and validate totals",
    triggerTypes: ["DOCUMENT_EXTRACTED"],
    deploymentIds: ["dep_001"],
  }),
}
);

Response

Response201
{
  "id": "wf_new",
  "name": "Invoice Processing",
  "description": null,
  "status": "ACTIVE",
  "agentPrompt": "Process extracted invoice data and validate totals",
  "triggerTypes": [
    "DOCUMENT_EXTRACTED"
  ],
  "ingestEmailAddress": null,
  "connectionId": null,
  "deploymentRoutes": [
    {
      "deploymentId": "dep_001",
      "deploymentName": "Invoice Extractor"
    }
  ],
  "createdAt": "2025-01-15T10:30:00.000Z",
  "updatedAt": "2025-01-15T10:30:00.000Z"
}

Get Workflow

GET/api/v1/projects/{projectId}/workflows/{workflowId}

Returns detailed information about a specific workflow including its files and execution count.

Parameters

NameTypeInRequiredDescription
projectIdstringpathYesThe project ID
workflowIdstringpathYesThe workflow ID

Request

const res = await fetch(
"https://app.limai.io/api/v1/projects/proj_abc123/workflows/wf_001",
{
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
  },
}
);
const workflow = await res.json();

Response

Response200
{
  "id": "wf_001",
  "name": "Invoice Processing",
  "description": null,
  "status": "ACTIVE",
  "agentPrompt": "Process extracted invoice data",
  "triggerTypes": [
    "DOCUMENT_EXTRACTED"
  ],
  "ingestEmailAddress": null,
  "connectionId": null,
  "connection": null,
  "deploymentRoutes": [
    {
      "deploymentId": "dep_001",
      "deploymentName": "Invoice Extractor"
    }
  ],
  "files": [],
  "executionCount": 42,
  "createdAt": "2025-01-01T00:00:00.000Z",
  "updatedAt": "2025-01-15T00:00:00.000Z"
}

Update Workflow

PATCH/api/v1/projects/{projectId}/workflows/{workflowId}

Update workflow properties including name, prompt, trigger types, deployment routes, and status.

Parameters

NameTypeInRequiredDescription
projectIdstringpathYesThe project ID
workflowIdstringpathYesThe workflow ID
namestringbodyNoWorkflow name
descriptionstringbodyNoWorkflow description
agentPromptstringbodyNoUpdated agent instructions
triggerTypesstring[]bodyNoUpdated trigger types
deploymentIdsstring[]bodyNoUpdated deployment IDs (replaces all existing routes)
statusstringbodyNoWorkflow status: ACTIVE, PAUSED, or DISABLED

Request

const res = await fetch(
"https://app.limai.io/api/v1/projects/proj_abc123/workflows/wf_001",
{
  method: "PATCH",
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ status: "PAUSED" }),
}
);

Response

Response200
{
  "id": "wf_001",
  "name": "Invoice Processing",
  "status": "PAUSED",
  "updatedAt": "2025-01-15T12:00:00.000Z"
}

Delete Workflow

DELETE/api/v1/projects/{projectId}/workflows/{workflowId}

Permanently deletes a workflow.

Parameters

NameTypeInRequiredDescription
projectIdstringpathYesThe project ID
workflowIdstringpathYesThe workflow ID

Request

const res = await fetch(
"https://app.limai.io/api/v1/projects/proj_abc123/workflows/wf_001",
{
  method: "DELETE",
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
  },
}
);

Response

Response200
{
  "success": true
}