frameworks/motia/motia-js/README.md
Get started in seconds:
npx motia@latest create
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 - a single primitive that handles everything.
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.
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 enqueues an event, and an Event Step that processes it.
<details open> <summary><b>TypeScript</b></summary>// steps/send-message.step.ts
export const config = {
name: 'SendMessage',
triggers: [
{
type: 'http',
method: 'POST',
path: '/messages',
}
],
enqueues: ['message.sent']
};
export const handler = async (req, { enqueue }) => {
await enqueue({
topic: 'message.sent',
data: { text: req.body.text }
});
return { status: 200, body: { ok: true } };
};
// steps/process-message.step.ts
export const config = {
name: 'ProcessMessage',
triggers: [
{
type: 'queue',
topic: 'message.sent',
}
],
};
export const handler = async (input, { logger }) => {
logger.info('Processing message', input);
};
// steps/send-message.step.js
const config = {
name: 'SendMessage',
triggers: [
{
type: 'http',
method: 'POST',
path: '/messages',
}
],
enqueues: ['message.sent']
};
const handler = async (req, { enqueue }) => {
await enqueue({
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',
triggers: [
{
type: 'queue',
topic: '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.
Get Motia project up and running in under 60 seconds:
npx motia@latest create # runs the interactive terminal
Follow the prompts to pick a template, project name, and language.
Inside your new project folder, launch the dev server:
npm run dev # β http://localhost:3000
That's it! You have:
Every Motia project includes detailed AI development guides that work with any AI coding tool:
.mdc rules with context-aware suggestionsAGENTS.md standardThe guides include patterns for API endpoints, background tasks, state management, real-time streaming, and complete architecture blueprints.
| Type | When it runs | Use Case |
|---|---|---|
http | HTTP Request | REST endpoints |
queue | Queue subscription | Background processing |
cron | Schedule | Recurring jobs |
state | State change | State management |
stream | Stream subscription | Real-time streaming |
A complete chess platform benchmarking LLM performance with real-time evaluation.
Live Website β | Source Code β
Built from scratch to production deployment, featuring:
| 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 | Status |
|---|---|
| JavaScript | β Stable |
| TypeScript | β Stable |
| Python | β Stable |
| Ruby | π§ Beta |
| Go | π Soon |
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 |
|---|---|---|---|
| Streams: RBAC | β Shipped | #495 | Add support for RBAC |
| Streams: Workbench UI | β Shipped | #497 | Add support for Workbench UI |
| Queue Strategies | β Shipped | #476 | Add support for Queue Strategies |
| Reactive Steps | β Shipped | #477 | Add support for Reactive Steps |
| Point in time triggers | π Planned | #480 | Add support for Point in time triggers |
| Workbench plugins | β Shipped | #481 | Add support for Workbench plugins |
| Rewrite core in Rust | β Shipped | #482 | Rewrite our Core in Rust |
| Decrease deployment time | β Shipped | #483 | Decrease deployment time |
| Built-in database support | π Planned | #484 | Add support for built-in database |
We welcome contributions! Check our Contributing Guide to get started.
π Get Started β’ π Docs β’ π¬ Discord
<a href="https://git-history.com"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://git-history.com/api/embed/stars?repos=MotiaDev/motia&theme=dark" /> <source media="(prefers-color-scheme: light)" srcset="https://git-history.com/api/embed/stars?repos=MotiaDev/motia&theme=light" /> </picture> </a><sub>β Star us if you find Motia useful!</sub>
</div>