Motia
Overview
Motia is a unified backend framework built around a single primitive called the Step — a file with a config (defining how and when it runs) and a handler (business logic). Inspired by the same paradigm shift React brought to frontend, Motia eliminates runtime fragmentation by replacing separate frameworks for APIs, background jobs, queues, workflows, and AI agents with one cohesive system. It supports JavaScript, TypeScript, and Python (Ruby in beta, Go coming), and ships with a visual Workbench for real-time flow debugging and tracing.
Problem Addressed
| Problem |
Solution |
| Backend uses 5+ separate frameworks (API, queue, cron, AI) |
One Step primitive handles every backend pattern via a type field in config |
| Wiring services together requires manual glue code |
Steps auto-discovered by filename; Motia connects them via emit/subscribe |
| AI agents need separate orchestration runtime |
Agent workflows are just Steps with queue or event triggers chained via emit |
| Observability requires third-party integrations |
Built-in Workbench UI at localhost:3000 with flow diagrams, traces, state viewer |
| Multi-language backends require polyglot service meshes |
Native JS/TS/Python support in a single project with shared state and topics |
| AI coding tools lack framework-specific context |
Ships with Cursor .mdc rules and AGENTS.md support for 20K+ compatible projects |
Key Statistics
| Metric |
Value |
Date Gathered |
| GitHub Stars |
15,107 |
2026-02-23 |
| GitHub Forks |
1,006 |
2026-02-23 |
| Open Issues |
55 |
2026-02-23 |
| Contributors |
~40 |
2026-02-23 |
| npm Monthly DL |
9,837 |
2026-02-23 |
| Latest Release |
v0.17.14-beta.196 |
2026-02-23 |
| Repository Age |
Since January 2025 |
2026-02-23 |
| Primary Language |
TypeScript/Python |
2026-02-23 |
Key Features
The Step Primitive
- config defines trigger type (
http, queue, cron, state, stream), subscribed topics, emitted topics, and flow membership
- handler receives input + context object with
emit, logger, state, streams helpers
- Auto-discovered by filename:
*.step.ts, *.step.js, *_step.py
- Change the
type field to convert between API endpoint, background worker, cron job, or stream processor — same pattern
Trigger Types
| Type |
When It Runs |
Primary Use Case |
http |
HTTP request |
REST API endpoints |
queue |
Topic message |
Background job processing |
cron |
Schedule |
Recurring jobs |
state |
State change |
Reactive state workflows |
stream |
Stream event |
Real-time streaming |
Multi-Language Support
- JavaScript — stable, CommonJS module exports
- TypeScript — stable, fully typed with
ApiRouteConfig, EventConfig, CronConfig interfaces
- Python — stable, module-level
config dict + async def handler
- Ruby — beta
- Go — planned
Built-in State Management
state.set(key, value) / state.get(key) / state.getGroup(prefix) in handlers
- Shared across Steps within a flow — no external database needed for workflow state
- Ideal for tracking progress in multi-step pipelines
Workbench (Visual Debugger)
- Runs at
http://localhost:3000 during development
- Flow diagrams showing Step connections and topic wiring
- Real-time log streaming with trace IDs
- State inspector and stream monitoring
- Workbench plugins for extensibility (shipped v0.17)
AI Development Support
- Bundled Cursor IDE
.mdc rules with context-aware suggestions for Steps
- Compatible with AGENTS.md standard (used by 20K+ projects) for OpenCode, Codex, Jules, Aider, Amp, GitHub Copilot
- Architecture blueprints and AI dev guides included in every
npx motia create project
Core Architecture
- Core runtime rewritten in Rust (shipped) for performance
iii engine integration for infrastructure provisioning (iii-config.yaml)
- Motia Cloud for production deployment
Technical Architecture
Step File Structure
steps/
*.step.ts # TypeScript Steps (auto-discovered)
*.step.js # JavaScript Steps (auto-discovered)
*_step.py # Python Steps (auto-discovered)
Data Flow Between Steps
HTTP POST /messages
→ SendMessage.step (http trigger)
→ enqueue({ topic: 'message.sent', data: {...} })
→ ProcessMessage.step (queue trigger, subscribes: ['message.sent'])
→ logger.info / state.set / enqueue(...)
Context Object (handler second argument)
| Property |
Purpose |
enqueue |
Publish event to a topic for other Steps |
logger |
Structured logging with auto trace context |
state |
Key-value storage shared across the flow |
streams |
Real-time stream updates (SSE/WebSocket) |
Stack
| Component |
Technology |
| Core Runtime |
Rust (rewritten from Node.js) |
| Step Runtimes |
Node.js (TS/JS), Python |
| Infrastructure |
iii engine (iii.dev) |
| Deployment |
Motia Cloud |
| Dev UI |
Workbench (React, localhost:3000) |
Installation & Usage
# Bootstrap a new Motia project (interactive)
npx motia@latest create
# Start development server with Workbench
npm run dev
# → Workbench: http://localhost:3000
TypeScript Step (API + Queue)
// steps/send-message.step.ts
import { Handlers } from 'motia'
export const config = {
name: 'SendMessage',
triggers: [
{
type: 'http',
method: 'POST',
path: '/messages',
}
],
enqueues: ['message.sent'],
flows: ['messaging']
}
export const handler: Handlers['SendMessage'] = async (req, { enqueue, state }) => {
const { text, userId } = req.body
await state.set(`msg:${userId}`, { text, status: 'queued' })
await enqueue({ topic: 'message.sent', data: { text, userId } })
return { status: 200, body: { ok: true } }
}
Python Step (Event consumer)
# steps/process_step.py
config = {
"name": "ProcessMessage",
"type": "event",
"subscribes": ["message.sent"],
"emits": ["message.processed"],
"flows": ["messaging"]
}
async def handler(input_data, context):
text = input_data.get("text")
await context.logger.info("Processing", {"text": text})
await context.enqueue({"topic": "message.processed", "data": {"status": "done"}})
Cron Step
// steps/daily-summary.step.ts
import { Handlers } from 'motia'
export const config = {
name: 'DailySummary',
triggers: [
{
type: 'cron',
cron: '0 9 * * *',
}
],
enqueues: ['summary.generated'],
flows: ['reporting']
}
export const handler: Handlers['DailySummary'] = async ({ state, enqueue }) => {
const messages = await state.getGroup('msg:')
await enqueue({ topic: 'summary.generated', data: { total: messages.length } })
}
Relevance to Claude Code Development
Applications
- Skill pipeline backend: Motia Steps could back multi-step skill orchestration workflows (e.g., research → validate → format → commit) with built-in state tracking and queue retry.
- Agent workflow infrastructure: The enqueue/subscribe model mirrors Claude Code's Task-tool delegation pattern; Motia provides a durable, observable runtime for the same pattern.
- Multi-language skill execution: Python and TypeScript Steps in the same project align with this repo's mixed Python scripts + TypeScript hooks architecture.
- AI development guides in project scaffolding: The
.mdc rules bundled with npx motia create demonstrate a pattern for embedding AI coding context directly in project templates — applicable to plugin/skill scaffolding.
Patterns Worth Adopting
- Single primitive over multiple integrations: Motia's "one Step for everything" philosophy parallels the skill system's goal of reducing tooling sprawl. A single SKILL.md format for all agent behaviors is analogous.
- Config + handler separation: Separating declarative config (when/how) from imperative handler (what) is a clean pattern for agent step definitions — the SKILL.md frontmatter mirrors this.
- Auto-discovery by filename convention:
*.step.ts auto-loading is analogous to the skill directory auto-loading pattern; explicit registration can be replaced by naming convention.
- AGENTS.md for AI tool context: Bundling AI coding context files in scaffolded projects (like Motia's
.mdc Cursor rules) is directly applicable to the plugin-creator skill's project initialization.
- Built-in observability from day one: Shipping the Workbench UI as an integral dev experience (not optional add-on) demonstrates that observability should be a first-class concern in agent frameworks.
Integration Opportunities
- Motia as skill pipeline executor: Complex multi-phase skill workflows (groom → research → implement) could be expressed as Motia flows, gaining durable execution, retry, and visual debugging.
- MCP server wrapping Motia Steps: Expose Motia workflows as MCP tools so Claude Code agents can trigger multi-step backend operations with state tracking and streaming progress.
- Research pipeline: The AI Research Agent example (
examples/ai-deep-research-agent) is directly relevant — a Motia-based research pipeline could back the research-curator skill with observable steps.
- Workbench pattern for skill debugging: The visual flow diagram + trace approach in Workbench could inspire a debugging view for multi-agent skill orchestration.
References
Research Method: Information gathered from official website, GitHub repository README, GitHub API (stars, forks, issues, contributors), npm downloads API, and official documentation.
Freshness Tracking
| Field |
Value |
| Version Documented |
v0.17.14-beta.196 |
| Release Date |
2026-01-09 |
| GitHub Stars |
15,107 (as of 2026-02-23) |
| npm Monthly DL |
9,837 (as of 2026-02-23) |
| Next Review Date |
2026-05-23 |
Review Triggers:
- v1.0 stable release (currently beta)
- Core primitive API breaking changes
- Go language support becomes stable
- GitHub stars milestone (20K, 30K)
- MCP server integration announced
iii engine stable release
1---2name: problem-addressed-223description: Motia is a unified backend framework built around a single primitive called the Step — a file with a config (defining how and when it runs) and a handler (business logic).4---5# Motia67| Field | Value |8| ------------- | --------------------------------------------- |9| Research Date | 2026-02-23 |10| Primary URL | <https://www.motia.dev/> |11| GitHub | <https://github.com/MotiaDev/motia> |12| npm | <https://www.npmjs.com/package/motia> |13| Version | v0.17.14-beta.196 (released 2026-01-09) |14| License | Apache-2.0 |15| Discord | <https://discord.gg/motia> |16| Docs | <https://www.motia.dev/docs> |1718---1920## Overview2122Motia is a unified backend framework built around a single primitive called the **Step** — a file with a `config` (defining how and when it runs) and a `handler` (business logic). Inspired by the same paradigm shift React brought to frontend, Motia eliminates runtime fragmentation by replacing separate frameworks for APIs, background jobs, queues, workflows, and AI agents with one cohesive system. It supports JavaScript, TypeScript, and Python (Ruby in beta, Go coming), and ships with a visual Workbench for real-time flow debugging and tracing.2324---2526## Problem Addressed2728| Problem | Solution |29| ----------------------------------------------------------- | ---------------------------------------------------------------------------------- |30| Backend uses 5+ separate frameworks (API, queue, cron, AI) | One Step primitive handles every backend pattern via a `type` field in config |31| Wiring services together requires manual glue code | Steps auto-discovered by filename; Motia connects them via emit/subscribe |32| AI agents need separate orchestration runtime | Agent workflows are just Steps with `queue` or `event` triggers chained via emit |33| Observability requires third-party integrations | Built-in Workbench UI at `localhost:3000` with flow diagrams, traces, state viewer |34| Multi-language backends require polyglot service meshes | Native JS/TS/Python support in a single project with shared state and topics |35| AI coding tools lack framework-specific context | Ships with Cursor `.mdc` rules and AGENTS.md support for 20K+ compatible projects |3637---3839## Key Statistics4041| Metric | Value | Date Gathered |42| ---------------- | ------------------------ | ------------- |43| GitHub Stars | 15,107 | 2026-02-23 |44| GitHub Forks | 1,006 | 2026-02-23 |45| Open Issues | 55 | 2026-02-23 |46| Contributors | ~40 | 2026-02-23 |47| npm Monthly DL | 9,837 | 2026-02-23 |48| Latest Release | v0.17.14-beta.196 | 2026-02-23 |49| Repository Age | Since January 2025 | 2026-02-23 |50| Primary Language | TypeScript/Python | 2026-02-23 |5152---5354## Key Features5556### The Step Primitive5758- **config** defines trigger type (`http`, `queue`, `cron`, `state`, `stream`), subscribed topics, emitted topics, and flow membership59- **handler** receives input + context object with `emit`, `logger`, `state`, `streams` helpers60- Auto-discovered by filename: `*.step.ts`, `*.step.js`, `*_step.py`61- Change the `type` field to convert between API endpoint, background worker, cron job, or stream processor — same pattern6263### Trigger Types6465| Type | When It Runs | Primary Use Case |66| -------- | ---------------- | ------------------------- |67| `http` | HTTP request | REST API endpoints |68| `queue` | Topic message | Background job processing |69| `cron` | Schedule | Recurring jobs |70| `state` | State change | Reactive state workflows |71| `stream` | Stream event | Real-time streaming |7273### Multi-Language Support7475- **JavaScript** — stable, CommonJS module exports76- **TypeScript** — stable, fully typed with `ApiRouteConfig`, `EventConfig`, `CronConfig` interfaces77- **Python** — stable, module-level `config` dict + `async def handler`78- **Ruby** — beta79- **Go** — planned8081### Built-in State Management8283- `state.set(key, value)` / `state.get(key)` / `state.getGroup(prefix)` in handlers84- Shared across Steps within a flow — no external database needed for workflow state85- Ideal for tracking progress in multi-step pipelines8687### Workbench (Visual Debugger)8889- Runs at `http://localhost:3000` during development90- Flow diagrams showing Step connections and topic wiring91- Real-time log streaming with trace IDs92- State inspector and stream monitoring93- Workbench plugins for extensibility (shipped v0.17)9495### AI Development Support9697- Bundled Cursor IDE `.mdc` rules with context-aware suggestions for Steps98- Compatible with AGENTS.md standard (used by 20K+ projects) for OpenCode, Codex, Jules, Aider, Amp, GitHub Copilot99- Architecture blueprints and AI dev guides included in every `npx motia create` project100101### Core Architecture102103- Core runtime rewritten in Rust (shipped) for performance104- `iii` engine integration for infrastructure provisioning (`iii-config.yaml`)105- Motia Cloud for production deployment106107---108109## Technical Architecture110111### Step File Structure112113```text114steps/115 *.step.ts # TypeScript Steps (auto-discovered)116 *.step.js # JavaScript Steps (auto-discovered)117 *_step.py # Python Steps (auto-discovered)118```119120### Data Flow Between Steps121122```text123HTTP POST /messages124 → SendMessage.step (http trigger)125 → enqueue({ topic: 'message.sent', data: {...} })126 → ProcessMessage.step (queue trigger, subscribes: ['message.sent'])127 → logger.info / state.set / enqueue(...)128```129130### Context Object (handler second argument)131132| Property | Purpose |133| --------- | --------------------------------------------- |134| `enqueue` | Publish event to a topic for other Steps |135| `logger` | Structured logging with auto trace context |136| `state` | Key-value storage shared across the flow |137| `streams` | Real-time stream updates (SSE/WebSocket) |138139### Stack140141| Component | Technology |142| -------------- | -------------------------------------- |143| Core Runtime | Rust (rewritten from Node.js) |144| Step Runtimes | Node.js (TS/JS), Python |145| Infrastructure | `iii` engine (iii.dev) |146| Deployment | Motia Cloud |147| Dev UI | Workbench (React, localhost:3000) |148149---150151## Installation & Usage152153```bash154# Bootstrap a new Motia project (interactive)155npx motia@latest create156157# Start development server with Workbench158npm run dev159# → Workbench: http://localhost:3000160```161162### TypeScript Step (API + Queue)163164```typescript165// steps/send-message.step.ts166import { Handlers } from 'motia'167168export const config = {169 name: 'SendMessage',170 triggers: [171 {172 type: 'http',173 method: 'POST',174 path: '/messages',175 }176 ],177 enqueues: ['message.sent'],178 flows: ['messaging']179}180181export const handler: Handlers['SendMessage'] = async (req, { enqueue, state }) => {182 const { text, userId } = req.body183 await state.set(`msg:${userId}`, { text, status: 'queued' })184 await enqueue({ topic: 'message.sent', data: { text, userId } })185 return { status: 200, body: { ok: true } }186}187```188189### Python Step (Event consumer)190191```python192# steps/process_step.py193config = {194 "name": "ProcessMessage",195 "type": "event",196 "subscribes": ["message.sent"],197 "emits": ["message.processed"],198 "flows": ["messaging"]199}200201async def handler(input_data, context):202 text = input_data.get("text")203 await context.logger.info("Processing", {"text": text})204 await context.enqueue({"topic": "message.processed", "data": {"status": "done"}})205```206207### Cron Step208209```typescript210// steps/daily-summary.step.ts211import { Handlers } from 'motia'212213export const config = {214 name: 'DailySummary',215 triggers: [216 {217 type: 'cron',218 cron: '0 9 * * *',219 }220 ],221 enqueues: ['summary.generated'],222 flows: ['reporting']223}224225export const handler: Handlers['DailySummary'] = async ({ state, enqueue }) => {226 const messages = await state.getGroup('msg:')227 await enqueue({ topic: 'summary.generated', data: { total: messages.length } })228}229```230231---232233## Relevance to Claude Code Development234235### Applications236237- **Skill pipeline backend**: Motia Steps could back multi-step skill orchestration workflows (e.g., research → validate → format → commit) with built-in state tracking and queue retry.238- **Agent workflow infrastructure**: The enqueue/subscribe model mirrors Claude Code's Task-tool delegation pattern; Motia provides a durable, observable runtime for the same pattern.239- **Multi-language skill execution**: Python and TypeScript Steps in the same project align with this repo's mixed Python scripts + TypeScript hooks architecture.240- **AI development guides in project scaffolding**: The `.mdc` rules bundled with `npx motia create` demonstrate a pattern for embedding AI coding context directly in project templates — applicable to plugin/skill scaffolding.241242### Patterns Worth Adopting2432441. **Single primitive over multiple integrations**: Motia's "one Step for everything" philosophy parallels the skill system's goal of reducing tooling sprawl. A single SKILL.md format for all agent behaviors is analogous.2452. **Config + handler separation**: Separating declarative config (when/how) from imperative handler (what) is a clean pattern for agent step definitions — the SKILL.md frontmatter mirrors this.2463. **Auto-discovery by filename convention**: `*.step.ts` auto-loading is analogous to the skill directory auto-loading pattern; explicit registration can be replaced by naming convention.2474. **AGENTS.md for AI tool context**: Bundling AI coding context files in scaffolded projects (like Motia's `.mdc` Cursor rules) is directly applicable to the `plugin-creator` skill's project initialization.2485. **Built-in observability from day one**: Shipping the Workbench UI as an integral dev experience (not optional add-on) demonstrates that observability should be a first-class concern in agent frameworks.249250### Integration Opportunities2512521. **Motia as skill pipeline executor**: Complex multi-phase skill workflows (groom → research → implement) could be expressed as Motia flows, gaining durable execution, retry, and visual debugging.2532. **MCP server wrapping Motia Steps**: Expose Motia workflows as MCP tools so Claude Code agents can trigger multi-step backend operations with state tracking and streaming progress.2543. **Research pipeline**: The AI Research Agent example (`examples/ai-deep-research-agent`) is directly relevant — a Motia-based research pipeline could back the `research-curator` skill with observable steps.2554. **Workbench pattern for skill debugging**: The visual flow diagram + trace approach in Workbench could inspire a debugging view for multi-agent skill orchestration.256257---258259## References260261| Source | URL | Accessed |262| ---------------------- | --------------------------------------------------------------------- | ---------- |263| Official Website | <https://www.motia.dev/> | 2026-02-23 |264| GitHub Repository | <https://github.com/MotiaDev/motia> | 2026-02-23 |265| Documentation | <https://www.motia.dev/docs> | 2026-02-23 |266| Quick Start Guide | <https://www.motia.dev/docs/getting-started/quick-start> | 2026-02-23 |267| Steps Concept | <https://www.motia.dev/docs/concepts/steps> | 2026-02-23 |268| Manifesto | <https://www.motia.dev/manifesto> | 2026-02-23 |269| Motia Examples | <https://github.com/MotiaDev/motia-examples> | 2026-02-23 |270| npm Package | <https://www.npmjs.com/package/motia> | 2026-02-23 |271| Vercel OSS 2025 | <https://vercel.com/blog/summer-2025-oss-program#motia> | 2026-02-23 |272273**Research Method**: Information gathered from official website, GitHub repository README, GitHub API (stars, forks, issues, contributors), npm downloads API, and official documentation.274275---276277## Freshness Tracking278279| Field | Value |280| ------------------ | --------------------------------------- |281| Version Documented | v0.17.14-beta.196 |282| Release Date | 2026-01-09 |283| GitHub Stars | 15,107 (as of 2026-02-23) |284| npm Monthly DL | 9,837 (as of 2026-02-23) |285| Next Review Date | 2026-05-23 |286287**Review Triggers**:288289- v1.0 stable release (currently beta)290- Core primitive API breaking changes291- Go language support becomes stable292- GitHub stars milestone (20K, 30K)293- MCP server integration announced294- `iii` engine stable release