Get Workflow Execution
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)
| Parameter | Type | Required | Description |
|---|
execution_id | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.WorkflowExecutionResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get Workflow Execution History
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)
| Parameter | Type | Required | Description |
|---|
execution_id | str | :heavy_check_mark: | N/A |
decode_payloads | Optional[bool] | :heavy_minus_sign: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
Any
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Signal Workflow Execution
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)
models.SignalWorkflowResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Query Workflow Execution
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)
models.QueryWorkflowResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Terminate Workflow Execution
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 ...
| Parameter | Type | Required | Description |
|---|
execution_id | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Batch Terminate Workflow Executions
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)
| Parameter | Type | Required | Description |
|---|
execution_ids | List[str] | :heavy_check_mark: | List of execution IDs to process |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.BatchExecutionResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Cancel Workflow Execution
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 ...
| Parameter | Type | Required | Description |
|---|
execution_id | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Batch Cancel Workflow Executions
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)
| Parameter | Type | Required | Description |
|---|
execution_ids | List[str] | :heavy_check_mark: | List of execution IDs to process |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.BatchExecutionResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Reset Workflow
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 ...
| Parameter | Type | Required | Description |
|---|
execution_id | str | :heavy_check_mark: | N/A |
event_id | int | :heavy_check_mark: | The event ID to reset the workflow execution to |
reason | OptionalNullable[str] | :heavy_minus_sign: | Reason for resetting the workflow execution |
exclude_signals | Optional[bool] | :heavy_minus_sign: | Whether to exclude signals that happened after the reset point |
exclude_updates | Optional[bool] | :heavy_minus_sign: | Whether to exclude updates that happened after the reset point |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Update Workflow Execution
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)
models.UpdateWorkflowResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get Workflow Execution Trace Info
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)
| Parameter | Type | Required | Description |
|---|
execution_id | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.ExecutionTraceInfoResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get Workflow Execution Trace Otel
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)
| Parameter | Type | Required | Description |
|---|
execution_id | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.WorkflowExecutionTraceOTelResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get Workflow Execution Trace Summary
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)
| Parameter | Type | Required | Description |
|---|
execution_id | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.WorkflowExecutionTraceSummaryResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get Workflow Execution Trace Events
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)
| Parameter | Type | Required | Description |
|---|
execution_id | str | :heavy_check_mark: | N/A |
merge_same_id_events | Optional[bool] | :heavy_minus_sign: | N/A |
include_internal_events | Optional[bool] | :heavy_minus_sign: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.WorkflowExecutionTraceEventsResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Stream
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)
Union[eventstreaming.EventStream[models.StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBody], eventstreaming.EventStreamAsync[models.StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBody]]
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
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).
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)
| Parameter | Type | Required | Description |
|---|
execution_id | str | :heavy_check_mark: | N/A |
run_id | OptionalNullable[str] | :heavy_minus_sign: | Filter logs by workflow run ID |
activity_id | OptionalNullable[str] | :heavy_minus_sign: | Filter logs by activity ID |
after | date | :heavy_minus_sign: | Only return logs at or after this timestamp |
before | date | :heavy_minus_sign: | Only return logs before this timestamp |
order | Optional[models.GetWorkflowExecutionLogsOrder] | :heavy_minus_sign: | First-page sort order: 'asc' (oldest first) or 'desc'. Ignored when cursor is set. |
cursor | OptionalNullable[str] | :heavy_minus_sign: | Pagination cursor from a previous response's next_cursor; carries the window and order |
limit | Optional[int] | :heavy_minus_sign: | Maximum number of logs to return |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.ExecutionLogSearchResponse
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
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.
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)
| Parameter | Type | Required | Description |
|---|
execution_id | str | :heavy_check_mark: | N/A |
run_id | OptionalNullable[str] | :heavy_minus_sign: | Filter logs by workflow run ID |
activity_id | OptionalNullable[str] | :heavy_minus_sign: | Filter logs by activity ID |
after | date | :heavy_minus_sign: | Start a fresh stream at this timestamp (ignored when resuming via last_event_id) |
last_event_id | OptionalNullable[str] | :heavy_minus_sign: | Resume from this cursor (a prior response's SSE id) |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
Union[eventstreaming.EventStream[models.StreamWorkflowExecutionLogsResponseBody], eventstreaming.EventStreamAsync[models.StreamWorkflowExecutionLogsResponseBody]]
| Error Type | Status Code | Content Type |
|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |