π₯ A Modern Unified Backend Framework for APIs, Events and Agents π₯
π‘ Motia Manifesto β’ π Quick Start β’ π Defining Steps β’ π Docs
Motia is a modern backend framework that unifies APIs, background jobs, events, and AI agents into a single cohesive system. Eliminate runtime complexity and build unified backends where JavaScript, TypeScript, Python, etc, work together in event-driven workflows, with built-in state management, observability, and one-click deployments.
Motia brings cohesion to the fragmented backend world with our core primitive: the Step. Think of Steps like React Components, but for backends.
- π― Single Purpose: Each Step performs one task
- π Language agnostic: Each Step can be in a different language while being part of the same workflow
- β‘ Versatile: Steps can trigger APIs, background jobs, and AI Agents
- ποΈ Observable: Everything is observable by default
- π Workflows: Collections of connected steps that form complete processes
- πͺ State Management: Shared state across all steps with full traceability
Backend teams juggle fragmented runtimes across APIs, background queues, and AI agents. This creates deployment complexity, debugging gaps, and cognitive overhead from context-switching between frameworks.
This fragmentation demands a unified system.
Motia unifies your entire backend into a unified state. APIs, background jobs, and AI agents become interconnected Steps with shared state and integrated observability.
Before | After (Motia) |
---|---|
Multiple deployment targets | Single unified deployment |
Fragmented observability | End-to-end tracing |
Language dependent | JavaScript, TypeScript, Python, etc |
Context-switching overhead | Single intuitive model |
Complex error handling | Automatic retries & fault tolerance |
Type | Trigger | Use Case |
---|---|---|
api |
HTTP Request | Expose REST endpoints |
event |
Emitted Topics | React to internal or external events |
cron |
Scheduled Time (cron) | Automate recurring jobs |
noop |
None | Placeholder for manual/external tasks |
Get up and running in under 60 seconds:
npx motia@latest create -i
- Enter project details like template, project name, etc
Open 01-api.step.ts
and create a simple API endpoint:
exports.config = {
type: 'api', // Step type: "api", "event", "cron", or "noop"
path: '/hello-world', // API endpoint path
method: 'GET', // HTTP method
name: 'HelloWorld', // Step identifier
emits: ['test-state'], // Events this step emits
flows: ['default'], // Flow this step belongs to
}
exports.handler = async () => {
return {
status: 200,
body: { message: 'Hello World from Motia!' },
}
}
Start the visual development environment:
npm run dev
# Opens at http://localhost:3000
π That's it! You now have a fully functional Motia app with:
- β
API endpoint at
/hello-world
- β Visual debugger and flow inspector
- β Built-in observability
- β Hot reload for instant feedback
From the Workbench, navigate to:
- π Logs: Structured logs for each step execution with inputs, outputs, and errors
- πͺ States: View internal state and data passed between steps using traceID
- π Endpoints: Test all your API endpoints directly from the UI
- π Flows: Visually inspect how your steps connect and what each step does
Finance Agent | GitHub Agent | Gmail Manager |
---|---|---|
![]() Financial insights |
![]() PR automation |
![]() Email automation |
Trello Automation | RAG Agent | AI Image Gen |
---|---|---|
![]() Task automation |
![]() Knowledge retrieval |
![]() Generate images |
Write steps in your preferred language:
Language | Status | Example |
---|---|---|
JavaScript | β Stable | handler.step.js |
TypeScript | β Stable | handler.step.ts |
Python | β Stable | handler.step.py |
Ruby | π Coming Soon | handler.step.rb |
Go | π Coming Soon | handler.step.go |
Rust | π Coming Soon | handler.step.rs |
- π Questions: Use our Discord community
- π Bug Reports: GitHub Issues
- π Documentation: Official Docs
- π₯ Blog: Motia Blog
We're building Motia in the open, and we'd love for you to be a part of the journey.
Check out our public roadmap to see whatβs planned, whatβs in progress, and whatβs recently shipped:
We welcome contributions! Whether it's:
- π Bug fixes and improvements
- β¨ New features and step types
- π Documentation and examples
- π Language support additions
- π¨ Workbench UI enhancements
Check out our Contributing Guide to get started.
π Ready to unify your backend?
π Get Started Now β’ π Read the Docs β’ π¬ Join Discord
Built with β€οΈ by the Motia team β’ Star us on GitHub if you find Motia useful! β