Workflows.Executions

June 23, 2026 ยท View on GitHub

Overview

Available Operations

get_workflow_execution

Get Workflow Execution

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.workflows.executions.get_workflow_execution(execution_id="<id>")

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
execution_idstr:heavy_check_mark:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.WorkflowExecutionResponse

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

get_workflow_execution_history

Get Workflow Execution History

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.workflows.executions.get_workflow_execution_history(execution_id="<id>", decode_payloads=True)

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
execution_idstr:heavy_check_mark:N/A
decode_payloadsOptional[bool]:heavy_minus_sign:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

Any

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

signal_workflow_execution

Signal Workflow Execution

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.workflows.executions.signal_workflow_execution(execution_id="<id>", name="<value>")

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
execution_idstr:heavy_check_mark:N/A
namestr:heavy_check_mark:The name of the signal to send
inputOptionalNullable[models.SignalInvocationBodyInput]:heavy_minus_sign:Input data for the signal, matching its schema
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.SignalWorkflowResponse

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

query_workflow_execution

Query Workflow Execution

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.workflows.executions.query_workflow_execution(execution_id="<id>", name="<value>")

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
execution_idstr:heavy_check_mark:N/A
namestr:heavy_check_mark:The name of the query to request
inputOptionalNullable[models.QueryInvocationBodyInput]:heavy_minus_sign:Input data for the query, matching its schema
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.QueryWorkflowResponse

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

terminate_workflow_execution

Terminate Workflow Execution

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    mistral.workflows.executions.terminate_workflow_execution(execution_id="<id>")

    # Use the SDK ...

Parameters

ParameterTypeRequiredDescription
execution_idstr:heavy_check_mark:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

batch_terminate_workflow_executions

Batch Terminate Workflow Executions

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.workflows.executions.batch_terminate_workflow_executions(execution_ids=[
        "<value 1>",
        "<value 2>",
    ])

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
execution_idsList[str]:heavy_check_mark:List of execution IDs to process
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.BatchExecutionResponse

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

cancel_workflow_execution

Cancel Workflow Execution

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    mistral.workflows.executions.cancel_workflow_execution(execution_id="<id>")

    # Use the SDK ...

Parameters

ParameterTypeRequiredDescription
execution_idstr:heavy_check_mark:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

batch_cancel_workflow_executions

Batch Cancel Workflow Executions

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.workflows.executions.batch_cancel_workflow_executions(execution_ids=[])

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
execution_idsList[str]:heavy_check_mark:List of execution IDs to process
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.BatchExecutionResponse

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

reset_workflow

Reset Workflow

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    mistral.workflows.executions.reset_workflow(execution_id="<id>", event_id=24149, exclude_signals=False, exclude_updates=False)

    # Use the SDK ...

Parameters

ParameterTypeRequiredDescription
execution_idstr:heavy_check_mark:N/A
event_idint:heavy_check_mark:The event ID to reset the workflow execution to
reasonOptionalNullable[str]:heavy_minus_sign:Reason for resetting the workflow execution
exclude_signalsOptional[bool]:heavy_minus_sign:Whether to exclude signals that happened after the reset point
exclude_updatesOptional[bool]:heavy_minus_sign:Whether to exclude updates that happened after the reset point
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

update_workflow_execution

Update Workflow Execution

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.workflows.executions.update_workflow_execution(execution_id="<id>", name="<value>")

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
execution_idstr:heavy_check_mark:N/A
namestr:heavy_check_mark:The name of the update to request
inputOptionalNullable[models.UpdateInvocationBodyInput]:heavy_minus_sign:Input data for the update, matching its schema
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.UpdateWorkflowResponse

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

get_workflow_execution_trace_info

Get Workflow Execution Trace Info

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.workflows.executions.get_workflow_execution_trace_info(execution_id="<id>")

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
execution_idstr:heavy_check_mark:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.ExecutionTraceInfoResponse

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

get_workflow_execution_trace_otel

Get Workflow Execution Trace Otel

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.workflows.executions.get_workflow_execution_trace_otel(execution_id="<id>")

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
execution_idstr:heavy_check_mark:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.WorkflowExecutionTraceOTelResponse

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

get_workflow_execution_trace_summary

Get Workflow Execution Trace Summary

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.workflows.executions.get_workflow_execution_trace_summary(execution_id="<id>")

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
execution_idstr:heavy_check_mark:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.WorkflowExecutionTraceSummaryResponse

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

get_workflow_execution_trace_events

Get Workflow Execution Trace Events

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.workflows.executions.get_workflow_execution_trace_events(execution_id="<id>", merge_same_id_events=False, include_internal_events=False)

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
execution_idstr:heavy_check_mark:N/A
merge_same_id_eventsOptional[bool]:heavy_minus_sign:N/A
include_internal_eventsOptional[bool]:heavy_minus_sign:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.WorkflowExecutionTraceEventsResponse

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

stream

Stream

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.workflows.executions.stream(execution_id="<id>")

    with res as event_stream:
        for event in event_stream:
            # handle event
            print(event, flush=True)

Parameters

ParameterTypeRequiredDescription
execution_idstr:heavy_check_mark:N/A
event_sourceOptionalNullable[models.EventSource]:heavy_minus_sign:N/A
last_event_idOptionalNullable[str]:heavy_minus_sign:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

Union[eventstreaming.EventStream[models.StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBody], eventstreaming.EventStreamAsync[models.StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBody]]

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

get_workflow_execution_logs

Retrieve logs for a workflow execution.

Use after/before/order on the first request to set the time range and sort order; for the next pages pass the cursor from the previous response (it remembers the range and order).

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.workflows.executions.get_workflow_execution_logs(execution_id="<id>", order="asc", limit=50)

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
execution_idstr:heavy_check_mark:N/A
run_idOptionalNullable[str]:heavy_minus_sign:Filter logs by workflow run ID
activity_idOptionalNullable[str]:heavy_minus_sign:Filter logs by activity ID
afterdate:heavy_minus_sign:Only return logs at or after this timestamp
beforedate:heavy_minus_sign:Only return logs before this timestamp
orderOptional[models.GetWorkflowExecutionLogsOrder]:heavy_minus_sign:First-page sort order: 'asc' (oldest first) or 'desc'. Ignored when cursor is set.
cursorOptionalNullable[str]:heavy_minus_sign:Pagination cursor from a previous response's next_cursor; carries the window and order
limitOptional[int]:heavy_minus_sign:Maximum number of logs to return
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.ExecutionLogSearchResponse

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*

stream_workflow_execution_logs

Stream logs for a workflow execution via SSE.

Resume cursor comes from the Last-Event-ID header or last_event_id query param (header wins) and takes precedence over after; omit all to tail from the execution start.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.workflows.executions.stream_workflow_execution_logs(execution_id="<id>")

    with res as event_stream:
        for event in event_stream:
            # handle event
            print(event, flush=True)

Parameters

ParameterTypeRequiredDescription
execution_idstr:heavy_check_mark:N/A
run_idOptionalNullable[str]:heavy_minus_sign:Filter logs by workflow run ID
activity_idOptionalNullable[str]:heavy_minus_sign:Filter logs by activity ID
afterdate:heavy_minus_sign:Start a fresh stream at this timestamp (ignored when resuming via last_event_id)
last_event_idOptionalNullable[str]:heavy_minus_sign:Resume from this cursor (a prior response's SSE id)
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

Union[eventstreaming.EventStream[models.StreamWorkflowExecutionLogsResponseBody], eventstreaming.EventStreamAsync[models.StreamWorkflowExecutionLogsResponseBody]]

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*