Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Mistral Workflows

Build reliable, production-grade AI workflows with Python.

Overview

Mistral Workflows is a Python SDK for building AI-powered workflows with built-in reliability, observability, and scalability. It provides fault tolerance, durability, and exactly-once execution guarantees.

Features

  • Simple Python API: Define workflows using Python decorators
  • Built-in Reliability: Automatic retries, timeouts, and error handling
  • Distributed Execution: Scale workflows across multiple workers
  • LLM Integration: Native support for Mistral AI and other LLM providers
  • Observability: Distributed tracing, structured logging, and event streaming
  • Type Safety: Full type hints and Pydantic validation

Installation

pip install mistralai-workflows

Quick Start

from mistralai.workflows import workflow, activity


@activity()  # timeout and retries go here, e.g. start_to_close_timeout (default 5 minutes)
async def get_weather(city: str) -> str:
    # Your activity implementation
    return f"Weather in {city}: Sunny"


@workflow.define(name="weather")
class WeatherWorkflow:
    @workflow.entrypoint
    async def run(self, city: str) -> str:
        weather = await get_weather(city)
        return weather

The workflow awaits the activity like any coroutine, and the SDK runs it as an activity with the settings passed to @activity(). To serve the workflow, start a worker with run_worker, as shown under Worker configuration below.

Documentation

For full documentation, visit docs.mistral.ai/studio/workflows.

Examples

Example projects are in the Mistral cookbook. Each one has a README that covers setup, running the worker and starting the workflow in Studio.

Worker configuration

Importing the SDK and declaring workflows do not read or validate environment settings. Unprepared workflow definitions use SDK defaults; run_worker or prepare_workflows applies the configured name prefix, determinism enforcement, and versioning before the worker runs.

By default, run_worker reads configuration from environment variables when it starts:

from mistralai import workflows

await workflows.run_worker([WeatherWorkflow])

Applications can also pass configuration in code. Values provided in code override environment variables; all other values use the environment or SDK defaults. Explicit configuration objects read and validate the environment when they are constructed:

from mistralai import workflows

config = workflows.WorkflowsConfig(
    worker=workflows.WorkerConfig(
        deployment_name=app_config.deployment_name,
        server_url=app_config.mistral_server_url,
    )
)

await workflows.run_worker([WeatherWorkflow], config=config)

Header precedence

Explicit WorkerConfig.mistral_api_headers and mistral_api_header_files values replace the entire mapping inherited from environment variables, dotenv files, or settings secrets; entries are not merged with a mapping supplied in code. Pass {} or None to clear the inherited mapping. Each field is independent: clearing static headers does not clear file-backed headers. The same rule applies to dictionaries passed through WorkflowsConfig(worker={"mistral_api_headers": {}}), including headers inherited through a WORKER JSON setting. When an explicit mapping drops inherited headers, the worker logs a warning that names them, without their values.

When either field is omitted, it keeps the usual settings-source behavior: environment variables take precedence over dotenv files and settings secrets, with dictionary entries merged across sources. A header mapping inherited through WORKER is not an explicit code override and continues to merge with direct header settings. Other nested configuration retains its usual merge behavior.

Process limitations

Within one process:

  • The same workflow type and task queue must use the same configuration.
  • The same workflow type may use a different configuration on another task queue, but its name, sandboxing, and versioning settings must stay the same.
  • While a worker or prepare_workflows() uses a workflow type name, no other workflow class can use it. Once they stop, another class can reuse the name.

License

Apache License 2.0 - see LICENSE for details.

Metadata

Release files for mistralai-workflows 4.0.0rc3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mistralai-workflows 4.0.0rc3
File Size Uploaded Provenance Actions
mistralai_workflows-4.0.0rc3.tar.gz 699.4 kB With provenance Details for mistralai_workflows-4.0.0rc3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mistralai-workflows 4.0.0rc3
File Interpreter ABI Platform Actions
mistralai_workflows-4.0.0rc3-py3-none-any.whl Python 3 none any Details for mistralai_workflows-4.0.0rc3-py3-none-any.whl

Total release size: 1.2 MB

Release files / mistralai_workflows-4.0.0rc3.tar.gz

Download URL mistralai_workflows-4.0.0rc3.tar.gz
Size 699.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1fbabd0bc73e859f80ecf05653fed1cacb2957d28c8ec94832827b1ef89a3a3b
BLAKE2b-256 checksum
How to use checksums
1da0fca57a6ea198d97f1debf7b70f8e1a037a4d39d68952be8b6353e0742b42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / mistralai_workflows-4.0.0rc3-py3-none-any.whl

Download URL mistralai_workflows-4.0.0rc3-py3-none-any.whl
Size 522.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
845214618268ed24fa3cbe5f4f97096bbad3a20ea0f92ae820a66a5c8a0677ee
BLAKE2b-256 checksum
How to use checksums
f20e3d02539c7d308e4204883ea59388b960f6d5c1de4239f4b357668d56239a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for mistralai-workflows 4.0.0rc3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mistralai_workflows-4.0.0rc3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page