Skip to main content

Prerequisites

Obtain an API key from the API settings page.
Keep your API key confidential and never commit it to version control. Use environment variables or secure configuration management.

Overview

Execute workflows programmatically using the Wiv API. This endpoint triggers a workflow execution and returns tracking information for monitoring progress.

Endpoint Details

HTTP Method & URL

[POST] https://api.wiv.ai/workflows/{workflow_id}/run

Path Parameters

ParameterTypeDescription
workflow_idstringThe unique identifier of the workflow to execute

Required Headers

HeaderValueDescription
Content-Typeapplication/jsonIndicates JSON request body
X-API-KEY{your_api_key}Authentication key (generate in API settings)

Request Body

{
  "payload": {
    // Optional: Input data for your workflow
    // Structure depends on your workflow's input requirements
  }
}

Payload Examples

Empty payload (for workflows with no input requirements):
{
  "payload": {}
}
With input data:
{
  "payload": {
    "user_id": "12345",
    "action": "process_order",
    "data": {
      "order_id": "ORD-2024-001",
      "customer_email": "customer@example.com"
    }
  }
}

Response Format

Success Response (200 OK)

{
  "data": {
    "event_type": "WORKFLOW_TRIGGER",
    "execution_id": "exec_abc123def456",
    "payload": {
      // Echoes back the payload you sent
    },
    "run_by": "api_user_name",
    "tenant_id": "tenant_xyz789",
    "timestamp": "2025-05-22 20:59:07.014093",
    "trigger_id": "-",
    "trigger_type": "MANUAL",
    "workflow_id": "workflow_def456ghi789"
  }
}

Response Fields

FieldTypeDescription
execution_idstringUnique identifier for this workflow run — use for tracking
event_typestringAlways WORKFLOW_TRIGGER for manual executions
timestampstringWhen the workflow was triggered (UTC)
trigger_typestringMANUAL for API-triggered workflows
run_bystringUser or system that initiated the workflow
tenant_idstringYour organization identifier
workflow_idstringConfirms which workflow was executed