π₯ A Modern Unified Backend Framework for APIs, Events and Agents π₯
Motia is a modern backend framework that unifies APIs, background jobs, events, and AI agents into a single cohesive system. A unified backend where JavaScript, TypeScript, Python, etc, work together.
- π― Your Logic, Your Step: A Step holds your business logic. It can be a simple function, a call to a database, or a complex AI agent. This is where your application's real work gets done.
- π Any Language, One Workflow: Write Steps in TypeScript, Python, and other languages to come. all in the same project. Use Python for your AI agents and TypeScript for your API, and Motia makes them work together effortlessly.
- β‘ Full Power, No Boilerplate: Inside a Step's
handler, you have the full power of the Node.js or Python ecosystem. Install any package, call any API, connect to any database. No restrictions, just your code. - ποΈ Zero-Config Observability: Get full end-to-end tracing and logging for every Step execution, automatically. No setup required. See exactly what happened, when, and why.
- π Simple & Powerful Workflows: Connect Steps together by emitting and subscribing to events. Build complex, multi-stage processes with simple, declarative code.
- πͺ Unified State: Share data between Steps effortlessly. Motia provides built-in state management that is automatically traced, giving you a complete picture of your data's lifecycle through a workflow.
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 |
Motia's architecture is built around a single, powerful primitive: the Step. A Step is not just a trigger; it's a powerful container for your business logic. You can write anything from a simple database query to a complex AI agent interaction inside a single step. Instead of managing separate services for APIs, background workers, and scheduled tasks, you simply define how your steps are triggered.
- Need a public API? Create an
apistep. This defines a route and handler for HTTP requests. You can build a complete REST or GraphQL API just with these steps. - Need a background job or queue? Have your
apistepemitan event. Aneventstep subscribed to that event's topic will pick up the job and process it asynchronously. This is how you handle anything that shouldn't block the main request thread, from sending emails to complex data processing. - Need to run a task on a schedule? Use a
cronstep. It will trigger automatically based on the schedule you define.
This model means you no longer need to glue together separate frameworks and tools. A single Motia application can replace a stack that might otherwise include Nest.js (for APIs), Temporal (for workflows), and Celery/BullMQ (for background jobs). It's all just steps and events.
The Step is Motia's core primitive. The following concepts are deeply integrated with Steps to help you build powerful, complex, and scalable backends:
Understand the three ways Steps are triggered:
- HTTP (
api) β Build REST/GraphQL endpoints with zero boilerplate. - Events (
event) β React to internal or external events emitted by other steps. - Cron (
cron) β Schedule recurring jobs with a familiar cron syntax.
Steps talk to each other by emitting and subscribing to topics. This decouples producers from consumers and lets you compose complex workflows with simple, declarative code.
All steps share a unified key-value state store. Every get, set, and delete is automatically traced so you always know when and where your data changed.
Motia provides structured, JSON logs correlated with trace IDs and step names. Search and filter your logs without regex gymnastics.
Push live updates from long-running or asynchronous workflows to clients without polling. Perfect for dashboards, progress indicators, and interactive AI agents.
Every execution generates a full trace, capturing step timelines, state operations, emits, stream calls, and logs. Visualise everything in the Workbench's Traces UI and debug faster.
Get up and running in under 60 seconds:
npx motia@latest create -i- Enter project details like template, project name, etc
Start the Motia Workbench:
npx motia 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
The Workbench is your command center for developing and monitoring your Motia application.
- π Flows: Visually inspect, design, and understand the connections between your steps.
- π Endpoints: Test your API endpoints directly from the UI, with full support for streaming responses.
- ποΈ Traces: Dive into detailed, end-to-end traces of your workflows. See exactly how data flows, where time is spent, and what errors occurred.
- π Logs: View structured, correlated logs for every step execution.
- πͺ States: Inspect the internal state and data passed between steps for any given workflow execution.
| 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! β






