Workflow executions are running instances of workflow definitions. Each execution represents a single process that progresses through states based on transitions you trigger.
Start a new workflow instance by posting to the executions endpoint:
curl -X 'POST' \
'https://app.yworkflow.com/api/executions' \
-H 'accept: application/json' \
-H 'X-API-KEY: wkf_123456789012' \
-H 'Content-Type: application/json' \
-d '{
"definitionId": "leave-request"
}'The execution begins in the "start" state defined in your workflow definition. The system validates input data against the workflow's input schema.
Use the available transitions to progress the workflow through states. Check the availableTransitions array in the execution response.
When the workflow reaches a final state (no transitions), the status becomes completed.
Retrieve the current status and details of an execution:
curl -X 'GET' \
'https://app.yworkflow.com/api/executions/{executionId}' \
-H 'accept: application/json' \
-H 'X-API-KEY: wkf_123456789012'The response includes:
{
"id": "74659490-b855-42dc-9b0f-54f8040d8778",
"definitionId": "leave-request",
"version": "v1",
"status": "started",
"inputs": {},
"currentStates": ["draft"],
"availableTransitions": ["submit"]
}Progress the workflow by triggering a transition:
curl -X 'POST' \
'https://app.yworkflow.com/api/executions/{executionId}/transitions' \
-H 'accept: application/json' \
-H 'X-API-KEY: wkf_123456789012' \
-H 'Content-Type: application/json' \
-d '{
"transitionId": "submit"
}'💡 Parallel Execution: After triggering a transition that leads to a fork, the workflow splits into parallel states. The currentStates array will contain multiple state IDs.
🔐 Role-Based Access Control: The availableTransitions array only shows transitions you're authorized to perform based on your API key's role and the state's owners.
When a workflow reaches a fork state, it creates multiple active states simultaneously. Each branch executes independently.
Example: After triggering "submit" in the leave-request workflow, currentStates will contain both ["hr_check", "manager_check"].
Join states merge parallel branches back together:
The join state waits until the condition is met, then automatically transitions to the target state.
Transition logic error (guard failed, action not available)
Execution not found
Workflow locked/busy or completed (state conflict). Retry after a brief delay.
Input validation failed. Check that your input matches the transition's input schema.
List all workflow executions with pagination (cursor-based).
Start a new workflow instance. Body includes definitionId, optional version, and input data.
Get execution status and details, including current states and available transitions.
Trigger a transition to move the workflow from current state to next state.