Plugins

Mistral Workflows plugins are standard Python packages that expose reusable workflows, activities, and dependencies under the mistralai.workflows.plugins namespace. Install them with pip and import into your code like any other package.

from mistralai.workflows.plugins.mistralai import mistralai_chat_complete
from mistralai.workflows.plugins.mistralai import Agent, Runner
Official Plugins

Official Plugins

Mistral AI Plugin

Mistral AI Plugin

Package: mistralai-workflows-plugins-mistralai

Provides native Mistral AI integration for LLM operations, agent execution, session management, and MCP support within workflows.

Key activities:

ActivityDescription
mistralai_chat_completeSingle-turn chat completion
mistralai_chat_streamStreaming chat completion
mistralai_chat_parseChat completion with structured output parsing
mistralai_embeddingsGenerate text embeddings
mistralai_ocrExtract text from images and documents
mistralai_create_agentCreate a remote agent
mistralai_update_agentUpdate a remote agent
mistralai_start_conversationStart an agent conversation
mistralai_start_conversation_streamStart an agent conversation with streaming
mistralai_append_conversationAdd messages to an existing conversation
mistralai_append_conversation_streamAdd messages to an existing conversation with streaming

Key components:

ComponentDescription
AgentAgent definition with model, tools, and configuration
RunnerOrchestrates agent execution with conversation and tool loops
LocalSessionLocal in-process agent session
RemoteSessionRemote stateful agent session
MCPStdioConfigConfiguration for local MCP servers (stdio)
MCPSSEConfigConfiguration for remote MCP servers (SSE)
MCPConfigUnion type alias for MCPStdioConfig | MCPSSEConfig
collect_mcp_toolsActivity: collect tool definitions from one or more MCP servers
execute_mcp_toolActivity: execute a named tool on its MCP server
get_mistral_clientDependency: returns a configured mistralai.Mistral client

Example — chat completion:

import mistralai.workflows as workflows
from mistralai.workflows import workflow
from mistralai.workflows.plugins.mistralai import (
    ChatCompletionRequest,
    UserMessage,
    mistralai_chat_complete,
)
from pydantic import BaseModel


class Input(BaseModel):
    text: str


@workflow.define(name="summarize")
class SummarizeWorkflow:
    @workflow.entrypoint
    async def run(self, params: Input) -> str:
        request = ChatCompletionRequest(
            model="mistral-large-latest",
            messages=[UserMessage(content=f"Summarize this text:\n\n{params.text}")],
        )
        result = await mistralai_chat_complete(request)
        return result.choices[0].message.content

For full documentation on Agent, Runner, sessions, MCP, and multi-agent handoffs, see the Durable Agents guide.

Webhook Plugin

Webhook Plugin

Package: mistralai-workflows-plugins-webhook

Provides HTTP/webhook routing and fan-out for building event-driven workflows. Use it to receive webhooks from external services (GitHub, Slack, Linear, etc.) and route them to running workflow instances.

Key components:

ComponentDescription
HTTPRouterWorkflowBase class for webhook router workflows
RouteDispatcherDispatches incoming HTTP requests to handler methods
SearchableWorkflowMixin to expose search attributes for workflow targeting
postDecorator to register a method as an HTTP POST handler
SearchAttributeKey/value pair used to target running workflow instances
search_workflow_execution_idsFind running workflow instance IDs matching search attributes
send_signalFan out a signal to multiple workflow instances
WebhookFanOutResultResult of send_signal (list of target IDs and dispatched count)
HTTPRequest / HTTPResponseRequest and response types

Provider-specific helpers (experimental) are available under webhook.github, webhook.slack, and webhook.linear.

Example:

from mistralai.workflows import workflow
from mistralai.workflows.plugins.webhook import (
    HTTPRouterWorkflow,
    HTTPRequest,
    HTTPResponse,
    post,
)

@workflow.define(name="my-webhook-router")
class MyWebhookRouter(HTTPRouterWorkflow):
    @post("/")
    async def handle(self, request: HTTPRequest) -> HTTPResponse:
        return HTTPResponse(status_code=200, body={"ok": True})
Installation

Installation

Install the plugins you need alongside the main SDK:

pip install mistralai-workflows
pip install mistralai-workflows-plugins-mistralai
pip install mistralai-workflows-plugins-webhook
Creating Your Own Reusable Libraries

Creating Your Own Reusable Libraries

You can create custom packages to share reusable workflows, activities, and dependencies within your organization.

note

The mistralai.workflows.plugins namespace is reserved for Mistral-supported plugins. For your own reusable code, use your own top-level package name.

Directory structure:

acme-workflows/
├── pyproject.toml
├── acme_workflows/
│   ├── __init__.py
│   ├── activities.py
│   └── workflows.py
└── tests/

pyproject.toml:

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "acme-workflows"
version = "0.1.0"
dependencies = [
    "mistralai-workflows>=2.0.0",
]

After installing your package, import directly:

from acme_workflows.activities import my_custom_activity
from acme_workflows.workflows import my_rag_pipeline