The III SDK provides a unified interface for building distributed applications with function registration, invocation, and trigger management. It enables seamless communication between services through a WebSocket-based engine.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/MotiaDev/motia/llms.txt
Use this file to discover all available pages before exploring further.
Supported Languages
The III SDK is available in three languages:Node.js
TypeScript/JavaScript SDK with full async support and OpenTelemetry integration
Python
Async Python SDK with function registration and trigger management
Rust
High-performance async Rust SDK with automatic reconnection
Core Concepts
Functions
Functions are the basic unit of work in the III Engine. You register functions that can be invoked by other services or triggered by events.Triggers
Triggers are event sources that invoke functions. Common trigger types include:- HTTP - API endpoints that invoke functions
- Events - Event-driven function invocation
- Schedules - Time-based function execution
- Custom - Define your own trigger types
Invocations
Invocations are how you call functions:- Synchronous - Wait for the function result
- Asynchronous - Fire-and-forget (no result returned)
Architecture
The III SDK communicates with the III Engine via WebSocket connections. The engine acts as a central orchestrator for:- Function Registry - Keeps track of all registered functions
- Function Routing - Routes invocations to the appropriate worker
- Trigger Management - Manages trigger registration and execution
- Inter-service Communication - Enables workers to call each other’s functions
- Telemetry & Observability - Collects traces, metrics, and logs
Key Features
Function Registration
Register callable functions that can be invoked by other services or triggers:Function Invocation
Call functions synchronously or asynchronously:Trigger Management
Create triggers to automatically invoke functions:Context-Aware Logging
Built-in logging with execution context:OpenTelemetry Integration
Full observability with traces, metrics, and logs (Node.js and Rust):- Automatic trace context propagation
- Distributed tracing across function calls
- Metrics collection and reporting
- Structured logging with correlation IDs
Automatic Reconnection
Resilient WebSocket connections with automatic reconnection:- Exponential backoff with jitter
- Configurable retry limits and delays
- Automatic re-registration of functions and triggers
- Connection state monitoring
Installation
Quick Start
See the language-specific documentation for detailed usage:Engine Functions
The III Engine provides built-in functions that you can call from any SDK:engine::functions::list- List all registered functionsengine::workers::list- List all connected workersengine::workers::register- Register worker metadataengine::channels::create- Create streaming channels for data transfer
Next Steps
Node.js API
Explore the Node.js SDK API reference
Python API
Explore the Python SDK API reference
Rust API
Explore the Rust SDK API reference
Examples
Browse SDK examples and tutorials