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.
/api/v2/workflows/healthReturns service health status. This endpoint is public and does not require authentication.
Request
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workflows/healthResponse 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.
/api/v2/workflows/parseAuthenticatedParse a natural language instruction into a structured workflow definition. The instruction must be at least 5 characters.
Body Parameters
instructionstringrequiredNatural language description of the workflow. Minimum 5 characters.
contextobjectAdditional context for parsing. Can include availableTools (array) and organizationId (string).
Request
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.
/api/v2/workflowsAuthenticatedList all workflows for the authenticated user's tenant. Results are ordered by creation date descending.
Query Parameters
statusstringFilter by status: active or archived.
limitinteger50Maximum number of workflows to return.
offsetinteger0Pagination offset.
Request
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
}/api/v2/workflowsAuthenticatedCreate 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
namestringrequiredDisplay name for the workflow.
descriptionstringDescription of what the workflow does.
definitionobjectrequiredWorkflow definition object. Must contain a nodes array defining the workflow steps.
versionstring1.0.0Semantic version string.
Request
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"
}
}/api/v2/workflows/:idAuthenticatedGet 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
iduuidrequiredThe workflow ID.
Request
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"
}
}/api/v2/workflows/:idAuthenticatedPartially 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
iduuidrequiredThe workflow ID.
Body Parameters
namestringUpdated workflow name.
descriptionstringUpdated description.
definitionobjectUpdated workflow definition (must contain nodes array).
versionstringUpdated version string.
statusstringSet workflow status: active or archived.
Request
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"
}
}/api/v2/workflows/:idAuthenticatedDelete a workflow and all its execution history (CASCADE). Verifies tenant ownership. Returns 403 if the workflow belongs to a different tenant.
Path Parameters
iduuidrequiredThe workflow ID.
Request
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"
}/api/v2/workflows/:id/schemaAuthenticatedGet the input/output schema extracted from the workflow definition. Useful for determining what inputs are required before executing.
Path Parameters
iduuidrequiredThe workflow ID.
Request
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.
/api/v2/workflows/:id/executeAuthenticatedTrigger 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
iduuidrequiredThe workflow ID.
Body Parameters
inputsobjectInput parameters for the workflow execution. Defaults to empty object.
Request
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
}
}/api/v2/workflows/:id/runsAuthenticatedGet 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
iduuidrequiredThe workflow ID.
Query Parameters
statusstringFilter by run status: running, completed, failed, or terminated.
limitinteger50Maximum number of runs to return.
offsetinteger0Pagination offset.
Request
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
}/api/v2/workflows/:id/runs/:runIdAuthenticatedGet detailed status of a specific workflow run. Inputs and outputs JSON are parsed before returning.
Path Parameters
iduuidrequiredThe workflow ID.
runIduuidrequiredThe run ID.
Request
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"
}
}/api/v2/workflows/:id/runs/:runIdAuthenticatedTerminate a running workflow execution. Returns 400 if the run is already in a terminal state (completed, failed, or terminated).
Path Parameters
iduuidrequiredThe workflow ID.
runIduuidrequiredThe run ID to terminate.
Request
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.
/api/v2/workflows/:id/schedulesAuthenticatedCreate a new cron schedule for the workflow. Verifies tenant ownership. Returns 400 for invalid cron expressions.
Path Parameters
iduuidrequiredThe workflow ID.
Body Parameters
cron_expressionstringrequiredStandard 5-field cron expression. Example: "0 9 * * 1" for every Monday at 9am.
timezonestringUTCIANA timezone identifier.
inputsobjectInputs to pass to each scheduled execution.
missed_execution_policystringHow to handle missed runs: run_immediately, skip, or queue.
Request
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"
}
}/api/v2/workflows/:id/schedulesAuthenticatedList all schedules for a workflow. Verifies tenant ownership.
Path Parameters
iduuidrequiredThe workflow ID.
Request
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
}/api/v2/workflows/:id/schedules/:scheduleIdAuthenticatedUpdate an existing schedule. Verifies tenant ownership of the parent workflow. Returns 404 if the schedule is not found.
Path Parameters
iduuidrequiredThe workflow ID.
scheduleIduuidrequiredThe schedule ID to update.
Body Parameters
cron_expressionstringUpdated cron expression.
timezonestringUpdated IANA timezone.
inputsobjectUpdated inputs for scheduled executions.
enabledbooleanEnable or disable the schedule.
missed_execution_policystringUpdated missed execution policy.
Request
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"
}
}/api/v2/workflows/:id/schedules/:scheduleIdAuthenticatedDelete a schedule. Verifies tenant ownership of the parent workflow.
Path Parameters
iduuidrequiredThe workflow ID.
scheduleIduuidrequiredThe schedule ID to delete.
Request
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"
}