Workflows API

Multi-tenant workflow management and execution. Supports workflow CRUD, async execution with persistence, run status tracking, scheduling, and natural language parsing. All authenticated endpoints require a JWT token and are rate-limited to 100 requests per minute per user. Tenant isolation is enforced via customer_id from the JWT.

Health Check

Public endpoint for monitoring service availability. No authentication required.

GET/api/v2/workflows/health

Returns service health status. This endpoint is public and does not require authentication.

Request

cURL
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workflows/health

Response 200

{
  400">class="text-emerald-400">"status": 400">class="text-emerald-400">"ok",
  400">class="text-emerald-400">"service": 400">class="text-emerald-400">"workflows-api-v2",
  400">class="text-emerald-400">"version": 400">class="text-emerald-400">"2.0.0",
  400">class="text-emerald-400">"timestamp": 400">class="text-emerald-400">"2026-03-19T18:00:00.000Z"
}

Natural Language Parsing

Convert a natural language instruction into a structured workflow definition using the unified workflow parser. The parser matches against templates or generates a workflow definition with confidence scoring.

POST/api/v2/workflows/parseAuthenticated

Parse a natural language instruction into a structured workflow definition. The instruction must be at least 5 characters.

Body Parameters

instructionstringrequired

Natural language description of the workflow. Minimum 5 characters.

contextobject

Additional context for parsing. Can include availableTools (array) and organizationId (string).

Request

cURL
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workflows/parse \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY" \
  -H 400">class="text-emerald-400">"Content-Type: application/json" \
  -d '{
    400">class="text-emerald-400">"instruction": 400">class="text-emerald-400">"Every Monday at 9am, pull the latest sales data, generate a summary report, and email it to the sales team.",
    400">class="text-emerald-400">"context": {
      400">class="text-emerald-400">"availableTools": [400">class="text-emerald-400">"salesforce.query", 400">class="text-emerald-400">"email.send"]
    }
  }'

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"workflow": {
    400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"generated",
    400">class="text-emerald-400">"name": 400">class="text-emerald-400">"Weekly Sales Report",
    400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Pull sales data, generate summary, and email to team",
    400">class="text-emerald-400">"steps": [
      {
        400">class="text-emerald-400">"id": 400">class="text-emerald-400">"step_1",
        400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"integration",
        400">class="text-emerald-400">"action": 400">class="text-emerald-400">"salesforce.query",
        400">class="text-emerald-400">"config": {
          400">class="text-emerald-400">"query": 400">class="text-emerald-400">"SELECT Id, Amount, StageName, CloseDate FROM Opportunity WHERE CloseDate = LAST_WEEK"
        }
      },
      {
        400">class="text-emerald-400">"id": 400">class="text-emerald-400">"step_2",
        400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"agent",
        400">class="text-emerald-400">"action": 400">class="text-emerald-400">"generate_report",
        400">class="text-emerald-400">"input_from": 400">class="text-emerald-400">"step_1"
      },
      {
        400">class="text-emerald-400">"id": 400">class="text-emerald-400">"step_3",
        400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"integration",
        400">class="text-emerald-400">"action": 400">class="text-emerald-400">"email.send",
        400">class="text-emerald-400">"input_from": 400">class="text-emerald-400">"step_2"
      }
    ],
    400">class="text-emerald-400">"confidence": 0.87,
    400">class="text-emerald-400">"source": 400">class="text-emerald-400">"ai-generated",
    400">class="text-emerald-400">"valid": true
  },
  400">class="text-emerald-400">"parseTimeMs": 1243
}

Workflow CRUD

Create, retrieve, update, and delete workflow definitions. Workflows are scoped to a tenant via customer_id and ownership is verified on all mutating operations.

GET/api/v2/workflowsAuthenticated

List all workflows for the authenticated user's tenant. Results are ordered by creation date descending.

Query Parameters

statusstring

Filter by status: active or archived.

limitinteger
Default: 50

Maximum number of workflows to return.

offsetinteger
Default: 0

Pagination offset.

Request

cURL
400">curl -X 400">GET 400">class="text-emerald-400">"https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workflows?status=active&limit=10" \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"workflows": [
    {
      400">class="text-emerald-400">"id": 400">class="text-emerald-400">"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      400">class="text-emerald-400">"customer_id": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
      400">class="text-emerald-400">"name": 400">class="text-emerald-400">"Weekly Sales Report",
      400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Automated weekly sales report generation and distribution",
      400">class="text-emerald-400">"definition": 400">class="text-emerald-400">"{\"nodes\": [...], \"inputs\": {}, \"outputs\": {}}",
      400">class="text-emerald-400">"version": 400">class="text-emerald-400">"1.0.0",
      400">class="text-emerald-400">"status": 400">class="text-emerald-400">"active",
      400">class="text-emerald-400">"created_by": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
      400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-02-15T10:00:00.000Z",
      400">class="text-emerald-400">"updated_at": 400">class="text-emerald-400">"2026-03-10T14:30:00.000Z"
    },
    {
      400">class="text-emerald-400">"id": 400">class="text-emerald-400">"b2c3d4e5-f6a7-8901-bcde-f23456789012",
      400">class="text-emerald-400">"customer_id": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
      400">class="text-emerald-400">"name": 400">class="text-emerald-400">"Customer Onboarding",
      400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Automated onboarding sequence for 400">new customers",
      400">class="text-emerald-400">"definition": 400">class="text-emerald-400">"{\"nodes\": [...], \"inputs\": {}, \"outputs\": {}}",
      400">class="text-emerald-400">"version": 400">class="text-emerald-400">"1.0.0",
      400">class="text-emerald-400">"status": 400">class="text-emerald-400">"active",
      400">class="text-emerald-400">"created_by": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
      400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-01-20T08:00:00.000Z",
      400">class="text-emerald-400">"updated_at": 400">class="text-emerald-400">"2026-03-15T16:00:00.000Z"
    }
  ],
  400">class="text-emerald-400">"count": 2
}
POST/api/v2/workflowsAuthenticated

Create a new workflow. The definition must be an object with a nodes array. Returns 409 if a workflow with the same name already exists for this tenant.

Body Parameters

namestringrequired

Display name for the workflow.

descriptionstring

Description of what the workflow does.

definitionobjectrequired

Workflow definition object. Must contain a nodes array defining the workflow steps.

versionstring
Default: 1.0.0

Semantic version string.

Request

cURL
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workflows \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY" \
  -H 400">class="text-emerald-400">"Content-Type: application/json" \
  -d '{
    400">class="text-emerald-400">"name": 400">class="text-emerald-400">"Deploy Notification",
    400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Notify the team when a deployment completes",
    400">class="text-emerald-400">"definition": {
      400">class="text-emerald-400">"nodes": [
        {
          400">class="text-emerald-400">"id": 400">class="text-emerald-400">"step_1",
          400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"condition",
          400">class="text-emerald-400">"action": 400">class="text-emerald-400">"check_status",
          400">class="text-emerald-400">"config": {
            400">class="text-emerald-400">"field": 400">class="text-emerald-400">"$.deployment.status",
            400">class="text-emerald-400">"operator": 400">class="text-emerald-400">"equals",
            400">class="text-emerald-400">"value": 400">class="text-emerald-400">"success"
          }
        },
        {
          400">class="text-emerald-400">"id": 400">class="text-emerald-400">"step_2",
          400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"integration",
          400">class="text-emerald-400">"action": 400">class="text-emerald-400">"slack.post_message",
          400">class="text-emerald-400">"input_from": 400">class="text-emerald-400">"step_1",
          400">class="text-emerald-400">"config": {
            400">class="text-emerald-400">"channel": 400">class="text-emerald-400">"#deployments",
            400">class="text-emerald-400">"message": 400">class="text-emerald-400">"Deployment completed successfully!"
          }
        }
      ],
      400">class="text-emerald-400">"inputs": {},
      400">class="text-emerald-400">"outputs": {}
    }
  }'

Response 201

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"workflow": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"c3d4e5f6-a7b8-9012-cdef-345678901234",
    400">class="text-emerald-400">"customer_id": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    400">class="text-emerald-400">"name": 400">class="text-emerald-400">"Deploy Notification",
    400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Notify the team when a deployment completes",
    400">class="text-emerald-400">"definition": {
      400">class="text-emerald-400">"nodes": [
        {
          400">class="text-emerald-400">"id": 400">class="text-emerald-400">"step_1",
          400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"condition",
          400">class="text-emerald-400">"action": 400">class="text-emerald-400">"check_status",
          400">class="text-emerald-400">"config": {
            400">class="text-emerald-400">"field": 400">class="text-emerald-400">"$.deployment.status",
            400">class="text-emerald-400">"operator": 400">class="text-emerald-400">"equals",
            400">class="text-emerald-400">"value": 400">class="text-emerald-400">"success"
          }
        },
        {
          400">class="text-emerald-400">"id": 400">class="text-emerald-400">"step_2",
          400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"integration",
          400">class="text-emerald-400">"action": 400">class="text-emerald-400">"slack.post_message",
          400">class="text-emerald-400">"input_from": 400">class="text-emerald-400">"step_1",
          400">class="text-emerald-400">"config": {
            400">class="text-emerald-400">"channel": 400">class="text-emerald-400">"#deployments",
            400">class="text-emerald-400">"message": 400">class="text-emerald-400">"Deployment completed successfully!"
          }
        }
      ],
      400">class="text-emerald-400">"inputs": {},
      400">class="text-emerald-400">"outputs": {}
    },
    400">class="text-emerald-400">"version": 400">class="text-emerald-400">"1.0.0",
    400">class="text-emerald-400">"status": 400">class="text-emerald-400">"active",
    400">class="text-emerald-400">"created_by": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-03-19T17:30:00.000Z",
    400">class="text-emerald-400">"updated_at": 400">class="text-emerald-400">"2026-03-19T17:30:00.000Z"
  }
}
GET/api/v2/workflows/:idAuthenticated

Get the full workflow definition. The definition JSON is parsed and returned as an object. Returns 404 if not found or not owned by the tenant.

Path Parameters

iduuidrequired

The workflow ID.

Request

cURL
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workflows/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"workflow": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    400">class="text-emerald-400">"customer_id": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    400">class="text-emerald-400">"name": 400">class="text-emerald-400">"Weekly Sales Report",
    400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Automated weekly sales report generation and distribution",
    400">class="text-emerald-400">"definition": {
      400">class="text-emerald-400">"nodes": [
        {
          400">class="text-emerald-400">"id": 400">class="text-emerald-400">"step_1",
          400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"integration",
          400">class="text-emerald-400">"action": 400">class="text-emerald-400">"salesforce.query"
        },
        {
          400">class="text-emerald-400">"id": 400">class="text-emerald-400">"step_2",
          400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"agent",
          400">class="text-emerald-400">"action": 400">class="text-emerald-400">"generate_report",
          400">class="text-emerald-400">"input_from": 400">class="text-emerald-400">"step_1"
        },
        {
          400">class="text-emerald-400">"id": 400">class="text-emerald-400">"step_3",
          400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"integration",
          400">class="text-emerald-400">"action": 400">class="text-emerald-400">"email.send",
          400">class="text-emerald-400">"input_from": 400">class="text-emerald-400">"step_2"
        }
      ],
      400">class="text-emerald-400">"inputs": {},
      400">class="text-emerald-400">"outputs": {}
    },
    400">class="text-emerald-400">"version": 400">class="text-emerald-400">"1.0.0",
    400">class="text-emerald-400">"status": 400">class="text-emerald-400">"active",
    400">class="text-emerald-400">"created_by": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-02-15T10:00:00.000Z",
    400">class="text-emerald-400">"updated_at": 400">class="text-emerald-400">"2026-03-10T14:30:00.000Z"
  }
}
PATCH/api/v2/workflows/:idAuthenticated

Partially update a workflow. Verifies tenant ownership before applying changes. Status must be 'active' or 'archived'. Returns 400 if no valid fields are provided.

Path Parameters

iduuidrequired

The workflow ID.

Body Parameters

namestring

Updated workflow name.

descriptionstring

Updated description.

definitionobject

Updated workflow definition (must contain nodes array).

versionstring

Updated version string.

statusstring

Set workflow status: active or archived.

Request

cURL
400">curl -X 400">PATCH https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workflows/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY" \
  -H 400">class="text-emerald-400">"Content-Type: application/json" \
  -d '{
    400">class="text-emerald-400">"name": 400">class="text-emerald-400">"Weekly Sales & Marketing Report",
    400">class="text-emerald-400">"status": 400">class="text-emerald-400">"active"
  }'

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"workflow": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    400">class="text-emerald-400">"customer_id": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    400">class="text-emerald-400">"name": 400">class="text-emerald-400">"Weekly Sales & Marketing Report",
    400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Automated weekly sales report generation and distribution",
    400">class="text-emerald-400">"definition": {
      400">class="text-emerald-400">"nodes": [...]
    },
    400">class="text-emerald-400">"version": 400">class="text-emerald-400">"1.0.0",
    400">class="text-emerald-400">"status": 400">class="text-emerald-400">"active",
    400">class="text-emerald-400">"created_by": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-02-15T10:00:00.000Z",
    400">class="text-emerald-400">"updated_at": 400">class="text-emerald-400">"2026-03-19T17:45:00.000Z"
  }
}
DELETE/api/v2/workflows/:idAuthenticated

Delete a workflow and all its execution history (CASCADE). Verifies tenant ownership. Returns 403 if the workflow belongs to a different tenant.

Path Parameters

iduuidrequired

The workflow ID.

Request

cURL
400">curl -X 400">DELETE https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workflows/c3d4e5f6-a7b8-9012-cdef-345678901234 \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"message": 400">class="text-emerald-400">"Workflow deleted successfully"
}
GET/api/v2/workflows/:id/schemaAuthenticated

Get the input/output schema extracted from the workflow definition. Useful for determining what inputs are required before executing.

Path Parameters

iduuidrequired

The workflow ID.

Request

cURL
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workflows/a1b2c3d4-e5f6-7890-abcd-ef1234567890/schema \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"schema": {
    400">class="text-emerald-400">"inputs": {
      400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"object",
      400">class="text-emerald-400">"properties": {
        400">class="text-emerald-400">"date_range": {
          400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"string",
          400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Override the 400">default date range",
          400">class="text-emerald-400">"400">default": 400">class="text-emerald-400">"LAST_WEEK"
        },
        400">class="text-emerald-400">"recipients": {
          400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"array",
          400">class="text-emerald-400">"items": { 400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"string" },
          400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Override 400">default email recipients"
        }
      }
    },
    400">class="text-emerald-400">"outputs": {
      400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"object",
      400">class="text-emerald-400">"properties": {
        400">class="text-emerald-400">"report": { 400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"string" },
        400">class="text-emerald-400">"email_sent": { 400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"boolean" }
      }
    }
  }
}

Workflow Execution

Execute workflows and track their progress. Each execution creates aworkflow_runs record. The workflow engine runs asynchronously and emits WebSocket events for real-time progress tracking. Archived workflows cannot be executed.

POST/api/v2/workflows/:id/executeAuthenticated

Trigger a workflow execution. Creates a run record and begins async execution via the workflow engine. WebSocket events are emitted for execution:started, execution:completed, and execution:failed.

Path Parameters

iduuidrequired

The workflow ID.

Body Parameters

inputsobject

Input parameters for the workflow execution. Defaults to empty object.

Request

cURL
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workflows/a1b2c3d4-e5f6-7890-abcd-ef1234567890/execute \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY" \
  -H 400">class="text-emerald-400">"Content-Type: application/json" \
  -d '{
    400">class="text-emerald-400">"inputs": {
      400">class="text-emerald-400">"date_range": 400">class="text-emerald-400">"LAST_MONTH",
      400">class="text-emerald-400">"recipients": [400">class="text-emerald-400">"ceo@company.com", 400">class="text-emerald-400">"sales-lead@company.com"]
    }
  }'

Response 201

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"run": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"e5f6a7b8-c9d0-1234-ef56-789012345678",
    400">class="text-emerald-400">"workflow_id": 400">class="text-emerald-400">"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    400">class="text-emerald-400">"customer_id": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    400">class="text-emerald-400">"status": 400">class="text-emerald-400">"running",
    400">class="text-emerald-400">"inputs": {
      400">class="text-emerald-400">"date_range": 400">class="text-emerald-400">"LAST_MONTH",
      400">class="text-emerald-400">"recipients": [400">class="text-emerald-400">"ceo@company.com", 400">class="text-emerald-400">"sales-lead@company.com"]
    },
    400">class="text-emerald-400">"outputs": null,
    400">class="text-emerald-400">"error": null,
    400">class="text-emerald-400">"started_at": 400">class="text-emerald-400">"2026-03-19T18:00:00.000Z",
    400">class="text-emerald-400">"finished_at": null
  }
}
GET/api/v2/workflows/:id/runsAuthenticated

Get the execution history for a workflow. Verifies tenant ownership. Results are ordered by started_at descending. Inputs and outputs are parsed from stored JSON.

Path Parameters

iduuidrequired

The workflow ID.

Query Parameters

statusstring

Filter by run status: running, completed, failed, or terminated.

limitinteger
Default: 50

Maximum number of runs to return.

offsetinteger
Default: 0

Pagination offset.

Request

cURL
400">curl -X 400">GET 400">class="text-emerald-400">"https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workflows/a1b2c3d4-e5f6-7890-abcd-ef1234567890/runs?status=completed&limit=5" \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"runs": [
    {
      400">class="text-emerald-400">"id": 400">class="text-emerald-400">"e5f6a7b8-c9d0-1234-ef56-789012345678",
      400">class="text-emerald-400">"workflow_id": 400">class="text-emerald-400">"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      400">class="text-emerald-400">"customer_id": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
      400">class="text-emerald-400">"status": 400">class="text-emerald-400">"completed",
      400">class="text-emerald-400">"inputs": { 400">class="text-emerald-400">"date_range": 400">class="text-emerald-400">"LAST_MONTH" },
      400">class="text-emerald-400">"outputs": { 400">class="text-emerald-400">"report": 400">class="text-emerald-400">"Q1 2026 Sales Summary...", 400">class="text-emerald-400">"email_sent": true },
      400">class="text-emerald-400">"error": null,
      400">class="text-emerald-400">"started_at": 400">class="text-emerald-400">"2026-03-19T18:00:00.000Z",
      400">class="text-emerald-400">"finished_at": 400">class="text-emerald-400">"2026-03-19T18:00:47.000Z"
    },
    {
      400">class="text-emerald-400">"id": 400">class="text-emerald-400">"d4e5f6a7-b8c9-0123-de45-678901234567",
      400">class="text-emerald-400">"workflow_id": 400">class="text-emerald-400">"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      400">class="text-emerald-400">"customer_id": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
      400">class="text-emerald-400">"status": 400">class="text-emerald-400">"completed",
      400">class="text-emerald-400">"inputs": { 400">class="text-emerald-400">"date_range": 400">class="text-emerald-400">"LAST_WEEK" },
      400">class="text-emerald-400">"outputs": { 400">class="text-emerald-400">"report": 400">class="text-emerald-400">"Weekly Sales Summary...", 400">class="text-emerald-400">"email_sent": true },
      400">class="text-emerald-400">"error": null,
      400">class="text-emerald-400">"started_at": 400">class="text-emerald-400">"2026-03-17T09:00:00.000Z",
      400">class="text-emerald-400">"finished_at": 400">class="text-emerald-400">"2026-03-17T09:00:52.000Z"
    }
  ],
  400">class="text-emerald-400">"count": 2
}
GET/api/v2/workflows/:id/runs/:runIdAuthenticated

Get detailed status of a specific workflow run. Inputs and outputs JSON are parsed before returning.

Path Parameters

iduuidrequired

The workflow ID.

runIduuidrequired

The run ID.

Request

cURL
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workflows/a1b2c3d4-e5f6-7890-abcd-ef1234567890/runs/e5f6a7b8-c9d0-1234-ef56-789012345678 \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"run": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"e5f6a7b8-c9d0-1234-ef56-789012345678",
    400">class="text-emerald-400">"workflow_id": 400">class="text-emerald-400">"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    400">class="text-emerald-400">"customer_id": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    400">class="text-emerald-400">"status": 400">class="text-emerald-400">"completed",
    400">class="text-emerald-400">"inputs": {
      400">class="text-emerald-400">"date_range": 400">class="text-emerald-400">"LAST_MONTH",
      400">class="text-emerald-400">"recipients": [400">class="text-emerald-400">"ceo@company.com", 400">class="text-emerald-400">"sales-lead@company.com"]
    },
    400">class="text-emerald-400">"outputs": {
      400">class="text-emerald-400">"report": 400">class="text-emerald-400">"Q1 2026 Sales Summary...",
      400">class="text-emerald-400">"email_sent": true
    },
    400">class="text-emerald-400">"error": null,
    400">class="text-emerald-400">"started_at": 400">class="text-emerald-400">"2026-03-19T18:00:00.000Z",
    400">class="text-emerald-400">"finished_at": 400">class="text-emerald-400">"2026-03-19T18:00:47.000Z"
  }
}
DELETE/api/v2/workflows/:id/runs/:runIdAuthenticated

Terminate a running workflow execution. Returns 400 if the run is already in a terminal state (completed, failed, or terminated).

Path Parameters

iduuidrequired

The workflow ID.

runIduuidrequired

The run ID to terminate.

Request

cURL
400">curl -X 400">DELETE https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workflows/a1b2c3d4-e5f6-7890-abcd-ef1234567890/runs/e5f6a7b8-c9d0-1234-ef56-789012345678 \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"message": 400">class="text-emerald-400">"Workflow run terminated successfully"
}

Workflow Schedules

Manage cron-based schedules for automated workflow execution. Uses the workflow scheduler service. Schedule routes include :scheduleId as a path parameter for update and delete operations.

POST/api/v2/workflows/:id/schedulesAuthenticated

Create a new cron schedule for the workflow. Verifies tenant ownership. Returns 400 for invalid cron expressions.

Path Parameters

iduuidrequired

The workflow ID.

Body Parameters

cron_expressionstringrequired

Standard 5-field cron expression. Example: "0 9 * * 1" for every Monday at 9am.

timezonestring
Default: UTC

IANA timezone identifier.

inputsobject

Inputs to pass to each scheduled execution.

missed_execution_policystring

How to handle missed runs: run_immediately, skip, or queue.

Request

cURL
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workflows/a1b2c3d4-e5f6-7890-abcd-ef1234567890/schedules \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY" \
  -H 400">class="text-emerald-400">"Content-Type: application/json" \
  -d '{
    400">class="text-emerald-400">"cron_expression": 400">class="text-emerald-400">"0 9 * * 1",
    400">class="text-emerald-400">"timezone": 400">class="text-emerald-400">"America/New_York",
    400">class="text-emerald-400">"inputs": { 400">class="text-emerald-400">"date_range": 400">class="text-emerald-400">"LAST_WEEK" },
    400">class="text-emerald-400">"missed_execution_policy": 400">class="text-emerald-400">"run_immediately"
  }'

Response 201

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"schedule": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"f6a7b8c9-d0e1-2345-f678-901234567890",
    400">class="text-emerald-400">"workflow_id": 400">class="text-emerald-400">"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    400">class="text-emerald-400">"cron_expression": 400">class="text-emerald-400">"0 9 * * 1",
    400">class="text-emerald-400">"timezone": 400">class="text-emerald-400">"America/New_York",
    400">class="text-emerald-400">"inputs": { 400">class="text-emerald-400">"date_range": 400">class="text-emerald-400">"LAST_WEEK" },
    400">class="text-emerald-400">"missed_execution_policy": 400">class="text-emerald-400">"run_immediately",
    400">class="text-emerald-400">"enabled": true,
    400">class="text-emerald-400">"next_run_at": 400">class="text-emerald-400">"2026-03-24T13:00:00.000Z",
    400">class="text-emerald-400">"created_by": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-03-19T18:15:00.000Z"
  }
}
GET/api/v2/workflows/:id/schedulesAuthenticated

List all schedules for a workflow. Verifies tenant ownership.

Path Parameters

iduuidrequired

The workflow ID.

Request

cURL
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workflows/a1b2c3d4-e5f6-7890-abcd-ef1234567890/schedules \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"schedules": [
    {
      400">class="text-emerald-400">"id": 400">class="text-emerald-400">"f6a7b8c9-d0e1-2345-f678-901234567890",
      400">class="text-emerald-400">"workflow_id": 400">class="text-emerald-400">"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      400">class="text-emerald-400">"cron_expression": 400">class="text-emerald-400">"0 9 * * 1",
      400">class="text-emerald-400">"timezone": 400">class="text-emerald-400">"America/New_York",
      400">class="text-emerald-400">"enabled": true,
      400">class="text-emerald-400">"next_run_at": 400">class="text-emerald-400">"2026-03-24T13:00:00.000Z",
      400">class="text-emerald-400">"last_run_at": 400">class="text-emerald-400">"2026-03-17T13:00:00.000Z",
      400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-03-19T18:15:00.000Z"
    }
  ],
  400">class="text-emerald-400">"count": 1
}
PATCH/api/v2/workflows/:id/schedules/:scheduleIdAuthenticated

Update an existing schedule. Verifies tenant ownership of the parent workflow. Returns 404 if the schedule is not found.

Path Parameters

iduuidrequired

The workflow ID.

scheduleIduuidrequired

The schedule ID to update.

Body Parameters

cron_expressionstring

Updated cron expression.

timezonestring

Updated IANA timezone.

inputsobject

Updated inputs for scheduled executions.

enabledboolean

Enable or disable the schedule.

missed_execution_policystring

Updated missed execution policy.

Request

cURL
400">curl -X 400">PATCH https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workflows/a1b2c3d4-e5f6-7890-abcd-ef1234567890/schedules/f6a7b8c9-d0e1-2345-f678-901234567890 \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY" \
  -H 400">class="text-emerald-400">"Content-Type: application/json" \
  -d '{
    400">class="text-emerald-400">"cron_expression": 400">class="text-emerald-400">"0 9 * * 1,4",
    400">class="text-emerald-400">"enabled": true
  }'

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"schedule": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"f6a7b8c9-d0e1-2345-f678-901234567890",
    400">class="text-emerald-400">"workflow_id": 400">class="text-emerald-400">"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    400">class="text-emerald-400">"cron_expression": 400">class="text-emerald-400">"0 9 * * 1,4",
    400">class="text-emerald-400">"timezone": 400">class="text-emerald-400">"America/New_York",
    400">class="text-emerald-400">"enabled": true,
    400">class="text-emerald-400">"next_run_at": 400">class="text-emerald-400">"2026-03-20T13:00:00.000Z",
    400">class="text-emerald-400">"updated_at": 400">class="text-emerald-400">"2026-03-19T18:20:00.000Z"
  }
}
DELETE/api/v2/workflows/:id/schedules/:scheduleIdAuthenticated

Delete a schedule. Verifies tenant ownership of the parent workflow.

Path Parameters

iduuidrequired

The workflow ID.

scheduleIduuidrequired

The schedule ID to delete.

Request

cURL
400">curl -X 400">DELETE https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workflows/a1b2c3d4-e5f6-7890-abcd-ef1234567890/schedules/f6a7b8c9-d0e1-2345-f678-901234567890 \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"message": 400">class="text-emerald-400">"Schedule deleted successfully"
}