Build Your First Motia App
Build your first multi-language Motia app in minutes. This guide walks you through creating, running, and understanding a Motia app using JavaScript, TypeScript, and Python.
Build Your First Motia App
Get up and running with Motia in just a few minutes! This guide shows you how to create a Motia app that connects JavaScript, TypeScript, and Python as steps.
What You'll Build
A simple data processing Motia app:
- TypeScript API endpoint receives data with validation
- TypeScript bridges and notifies with proper types
- Python processes the data with proper logging
- JavaScript generates final summary and metrics
All connected automatically with zero configuration and strict type safety.
Step 1: Create Your Motia App
✅ That's it! You now have a working Motia app with a visual debugger at http://localhost:3000
Step 2: Add Environment Variables (Optional)
If you want to use external APIs, create a .env
file:
The basic tutorial works without any API keys. Add environment variables only if you want to integrate external services.
Step 3: Add Your Logic Steps
TypeScript API Endpoint (App Starter)
// File: 01-starter.step.ts
TypeScript Bridge Step
// File: 02-bridge.step.ts
Python Data Processor
// File: simple-python.step.py
TypeScript Notification Step
// File: notify.step.ts
TypeScript Finalizer Step
// File: 04-final.step.ts
JavaScript Summary Generator
// File: 05-summary.step.js
What Happens Next?
Watch in the Workbench (http://localhost:3000
) as your data flows through:
- TypeScript API receives and validates the request
- TypeScript bridge processes and forwards data
- Python processes it with proper logging (access to numpy, pandas, torch, etc.)
- TypeScript handles notifications with full type safety
- JavaScript generates final summary with metrics
All languages working together in one unified system with:
- ✅ Automatic observability - see every step in real-time
- ✅ Built-in error handling - retry logic included
- ✅ Shared state - pass data between languages effortlessly
- ✅ Hot reload - edit any file and see changes instantly
- ✅ Type safety - proper TypeScript types throughout
- ✅ Input validation - Zod schema validation for APIs
- ✅ Multi-language - JavaScript, TypeScript, and Python working together
Deploy and Extend
You just built a production-ready multi-language Motia app!
Extend your app:
- Add scheduled jobs with
cron
steps - Create UI components with React/Vue steps
- Connect to databases, APIs, and external services
- Scale to handle millions of requests
Ready to deploy? Check out Motia Cloud deployment for one-click production deployments.
Ready to build more? Check out our Getting Started Guide for more details.
The bottom line: Motia eliminates the complexity of managing separate runtimes. Write each piece in the best language for the job, and Motia handles the rest.
Project Structure
Learn about Motia's project structure, file organization, and automatic step discovery system for building scalable workflow applications.
Creating Your First REST API in Motia
Learn how to build a complete REST API with CRUD operations using Motia. This guide covers HTTP endpoints, request validation, and response handling.