Executions
An execution is a single invocation of a workflow. Each execution has a unique execution_id — either auto-generated or specified by the caller — and progresses through a sequence of statuses as it runs.
Triggering an execution
from mistralai import Mistral
client = Mistral(api_key="your_key")
execution = client.workflows.execute(
workflow_identifier="my_workflow",
input={"data": "hello"},
execution_id="my-run-2024-01-15", # optional custom ID
)
print(execution.execution_id, execution.status)Execution statuses
An execution starts as RUNNING and ends in one of several terminal states:
COMPLETED— finished successfullyFAILED— terminated with an unhandled errorCANCELED— gracefully stoppedTERMINATED— forcefully stoppedTIMED_OUT— exceededexecution_timeoutCONTINUED_AS_NEW— history reset via continue-as-newRETRYING_AFTER_ERROR— failed and scheduled for retry
Executions vs runs
An execution is a workflow invocation with a stable execution_id that persists across its entire lifetime. A run is a single attempt within that execution. Most of the time, an execution has exactly one run. But if a workflow is reset to a previous point in its history, a new run begins under the same execution_id.
Only one run can be active at a time. API action endpoints — /cancel, /terminate, /signals, /queries, /updates — always target the latest run of an execution.
API endpoints
| Endpoint | Description |
|---|---|
POST /v1/workflows/{id}/execute | Trigger a new execution |
GET /v1/workflows/runs | List all runs |
GET /v1/workflows/executions/{execution_id} | Get latest run of an execution |
POST /v1/workflows/executions/{id}/cancel | Cancel gracefully |
POST /v1/workflows/executions/{id}/terminate | Stop immediately |
POST /v1/workflows/executions/{id}/reset | Reset to a previous event |
See the full API reference for parameters and response schemas.