Multi-Language Development
Build Motia applications with TypeScript, Python, and JavaScript running as independent runtimes
Motia supports writing Steps in multiple languages within the same project. Each language runtime runs as an independent process managed by the iii engine — there are no cross-language dependencies. Python developers do not need Node.js, and Node.js developers do not need Python.
How It Works
Each language has its own Motia SDK and its own process. The iii engine coordinates between them through shared infrastructure (queues, state, streams). A TypeScript Step can enqueue a message that a Python Step processes, and vice versa.
Supported Languages
| Language | File Pattern | SDK Package | Runtime |
|---|---|---|---|
| TypeScript | .step.ts | motia (npm) | Node.js or Bun |
| JavaScript | .step.js | motia (npm) | Node.js or Bun |
| Python | _step.py | motia (pip) | Python 3 |
config.yaml Setup
Configure separate ExecModule entries for each runtime:
Each ExecModule watches its own file patterns and manages its own SDK process independently.
Example: Cross-Language Flow
A TypeScript HTTP endpoint triggers a Python ML processing step:
Both Steps share the same flow (review-pipeline) and communicate through the queue — no direct inter-process communication needed.
Mixed Template Example
The motia-iii-example repository includes a mixed template that demonstrates Node.js and Python working together in a single project. Create it with:
The mixed template structure:
| Directory | Responsibility |
|---|---|
nodejs/src/ | HTTP API endpoints (create-ticket, list-tickets) |
python/steps/ | Queue and cron triggers (triage, notify, sla-monitor, escalate) |
The iii-config.yaml uses two ExecModules — one for each runtime:
When a user creates a ticket via POST /tickets, the Node.js Step stores it in state and enqueues to ticket::created. The Python Step consumes that topic, triages the ticket, and enqueues to ticket::triaged. Both runtimes share the same state, queues, and API — proving true multi-language orchestration without cross-dependencies.
Runtime Flexibility
Node.js vs Bun
Motia supports both Node.js and Bun for TypeScript/JavaScript Steps. Configure your preferred runtime in the ExecModule:
Module System
You can use either CommonJS or ESM. For ESM (recommended for Bun compatibility):
CommonJS works without any changes. Motia does not force a module system migration.