
π₯ The Unified Backend Framework That Eliminates Runtime Fragmentation π₯
APIs, background jobs, queueing, streaming, states, workflows, AI agents, observability, scaling, and deployment all in one system. JavaScript, TypeScript, Python, and more in a single core primitive
π‘ Motia Manifesto β’ π Quick Start β’ π Defining Steps β’ π Docs
π― What is Motia?
Backend development today is fragmented.
APIs live in one framework, background jobs in another, queues and schedulers elsewhere, and now AI agents and streaming systems have their own runtimes. Add observability and state management on top, and you're stitching together half a dozen tools before writing your first feature.
Motia unifies all of these concerns around one core primitive: the Step.
Just as React made frontend development simple by introducing components, Motia redefines backend development with Steps.
Every backend pattern, API endpoints, background jobs, queues, workflows, AI agents, streaming, observability, and state, is expressed with the same primitive.
To read more about this, check out our manifesto.
The Core Primitive: the Step
A Step is just a file with a config
and a handler
. Motia auto-discovers these files and connects them automatically.
Here's a simple example of two Steps working together: an API Step that emits an event, and an Event Step that processes it.
TypeScript
// steps/send-message.step.ts
export const config = {
name: 'SendMessage',
type: 'api',
path: '/messages',
method: 'POST',
emits: ['message.sent']
};
export const handler = async (req, { emit }) => {
await emit({
topic: 'message.sent',
data: { text: req.body.text }
});
return { status: 200, body: { ok: true } };
};
// steps/process-message.step.ts
export const config = {
name: 'ProcessMessage',
type: 'event',
subscribes: ['message.sent']
};
export const handler = async (input, { logger }) => {
logger.info('Processing message', input);
};
Python
# send_message_step.py
config = {
"name": "SendMessage",
"type": "api",
"path": "/messages",
"method": "POST",
"emits": ["message.sent"]
}
async def handler(req, context):
await context.emit({
"topic": "message.sent",
"data": {"text": req.body["text"]}
})
return {"status": 200, "body": {"ok": True}}
# process_message_step.py
config = {
"name": "ProcessMessage",
"type": "event",
"subscribes": ["message.sent"]
}
async def handler(input, context):
context.logger.info("Processing message", input)
JavaScript
// steps/send-message.step.js
const config = {
name: 'SendMessage',
type: 'api',
path: '/messages',
method: 'POST',
emits: ['message.sent']
};
const handler = async (req, { emit }) => {
await emit({
topic: 'message.sent',
data: { text: req.body.text }
});
return { status: 200, body: { ok: true } };
};
module.exports = { config, handler };
// steps/process-message.step.js
const config = {
name: 'ProcessMessage',
type: 'event',
subscribes: ['message.sent']
};
const handler = async (input, { logger }) => {
logger.info('Processing message', input);
};
module.exports = { config, handler };
π With just two files, you've built an API endpoint, a queue, and a worker. No extra frameworks required.
π» Remix your own Motia App in Replit
π Quickstart
Get Motia project up and running in under 60 seconds:
1. Bootstrap a New Motia Project
npx motia@latest create # runs the interactive terminal
Follow the prompts to pick a template, project name, and language.
2. Start the Workbench
Inside your new project folder, launch the dev server:
npx motia dev # β http://localhost:3000
That's it! You have:
- β REST APIs with validation
- β Visual debugger & tracing
- β Multi-language support
- β Event-driven architecture
- β Zero configuration
- β AI development guides included (Cursor, OpenCode, Codex, and more)
π€ AI-Assisted Development
Every Motia project includes detailed AI development guides that work with any AI coding tool:
- Cursor IDE - Optimized
.mdc
rules with context-aware suggestions - OpenCode, Codex (OpenAI) - Full support via
AGENTS.md
standard - Aider, Jules, Factory, Amp, GitHub Copilot - Compatible with AGENTS.md format (used by 20k+ projects)
The guides include patterns for API endpoints, background tasks, state management, real-time streaming, and complete architecture blueprints.
π― Step Types
Type | Trigger | Use Case |
---|---|---|
api |
HTTP Request | REST endpoints |
event |
Topic subscription | Background processing |
cron |
Schedule | Recurring jobs |
noop |
Manual | External processes |
π― Examples
π ChessArena.ai - Full-Featured Production App
A complete chess platform benchmarking LLM performance with real-time evaluation.
Live Website β | Source Code β
Built from scratch to production deployment, featuring:
- π Authentication & user management
- π€ Multi-agent LLM evaluation (OpenAI, Claude, Gemini, Grok)
- π Python engine integration (Stockfish chess evaluation)
- π Real-time streaming with live move updates and scoring
- π¨ Modern React UI with interactive chess boards
- π Event-driven workflows connecting TypeScript APIs to Python processors
- π Live leaderboards with move-by-move quality scoring
- π Production deployment on Motia Cloud
π More Examples
Example | Description |
---|---|
AI Research Agent | Web research with iterative analysis |
Streaming Chatbot | Real-time AI responses |
Gmail Automation | Smart email processing |
GitHub PR Manager | Automated PR workflows |
Finance Agent | Real-time market analysis |
Features demonstrated: Multi-language workflows β’ Real-time streaming β’ AI integration β’ Production deployment
π Language Support
Language | Status |
---|---|
JavaScript | β Stable |
TypeScript | β Stable |
Python | β Stable |
Ruby | π§ Beta |
Go | π Soon |
π Resources
- π Documentation - Complete guides and API reference
- π¬ Discord - Community support and discussions
- π GitHub Issues - Bug reports and feature requests
- πΊοΈ Roadmap - Upcoming features and progress
π§ Roadmap
We have a public roadmap for Motia, you can view it here.
Feel free to add comments to the issues, or create a new issue if you have a feature request.
Feature | Status | Link | Description |
---|---|---|---|
Python Types | Planned | #485 | Add support for Python types |
Streams: RBAC | Planned | #495 | Add support for RBAC |
Streams: Workbench UI | Planned | #497 | Add support for Workbench UI |
Queue Strategies | Planned | #476 | Add support for Queue Strategies |
Reactive Steps | Planned | #477 | Add support for Reactive Steps |
Point in time triggers | Planned | #480 | Add support for Point in time triggers |
Workbench plugins | Planned | #481 | Add support for Workbench plugins |
Rewrite our Core in either Go or Rust | Planned | #482 | Rewrite our Core in either Go or Rust |
Decrease deployment time | Planned | #483 | Decrease deployment time |
Built-in database support | Planned | #484 | Add support for built-in database |
π€ Contributing
We welcome contributions! Check our Contributing Guide to get started.