Motia Icon

Welcome to Motia

Build production-grade backends with a single primitive. APIs, background jobs, workflows, AI agents, streaming, state management, and observability — unified in one framework.

Motia is a unified backend framework where everything is built around one core primitive: the Step. Instead of juggling separate frameworks for APIs, queues, cron jobs, AI agents, and real-time streaming, you write Steps — simple files with a config and a handler — and Motia connects them automatically.

import type { Handlers, StepConfig } from 'motia'
 
export const config = {
  name: 'CreateUser',
  triggers: [{ type: 'http', method: 'POST', path: '/users' }],
  enqueues: ['user.created'],
  flows: ['onboarding'],
} as const satisfies StepConfig
 
export const handler: Handlers<typeof config> = async (req, { enqueue, logger }) => {
  logger.info('Creating user', { email: req.body.email })
  await enqueue({ topic: 'user.created', data: req.body })
  return { status: 201, body: { success: true } }
}

Drop this file in your project and Motia auto-discovers it. No registration, no boilerplate wiring.


What You Get

Motia gives you a complete backend toolkit from a single primitive:

CapabilityHow It Works
HTTP APIsSteps with http triggers become REST endpoints with validation and routing
Background JobsSteps with queue triggers process messages asynchronously with retries
Scheduled TasksSteps with cron triggers run on a schedule
Reactive WorkflowsSteps with state or stream triggers react to data changes automatically
AI AgentsBuild agentic workflows with streaming support and tool calling
State ManagementBuilt-in key-value storage shared across all Steps, with atomic updates
Real-Time StreamingPush live updates to connected clients via WebSocket streams
ObservabilityStructured logging, distributed tracing, and metrics out of the box
Multi-LanguageWrite Steps in TypeScript, Python, or JavaScript — they all work together

Powered by iii

Motia runs on the iii engine, which manages all infrastructure concerns — queues, pub/sub, state storage, stream servers, cron scheduling, and observability — through a single config.yaml file. You focus on business logic in your Steps; iii handles the rest.


Prerequisites

  • iii — Install the runtime: curl -fsSL https://install.iii.dev/iii/main/install.sh | sh
  • Node.js 18+ — Required for TypeScript/JavaScript Steps
  • Python 3 — Optional, for Python Steps

Get Started

On this page