A comprehensive collection of examples demonstrating how to build event-driven applications with Motia. From beginner tutorials to production-ready systems, this repository covers the full spectrum of Motia's capabilities.
Level: Beginner
Start here if you're new to Motia
Learn core concepts with simple, focused examples:
- API endpoints and event processing
- Middleware and authentication
- Queue management
- Real-time updates with SSE and WebSocket
- Collaborative real-time features
Time to Complete: 2-5 hours
Examples: 5
Level: Intermediate
Common patterns for real-world applications
Master essential patterns for building production apps:
- API Patterns - Full-stack todo app, file processing, text analysis (3 examples)
- Workflow Patterns - Long-running workflows, human-in-the-loop (1 example)
- Automation - Content workflows, scheduling (3 examples)
- Infrastructure - Docker, monitoring, performance (3 examples)
Time to Complete: 1-2 days
Examples: 10 across 4 subcategories
Level: Intermediate to Expert
Build intelligent AI-powered applications
From simple chatbots to complex multi-agent systems:
- Chat Agents - Conversational AI with memory
- Specialized Agents - ReAct pattern, code review, research, moderation, planning
- Multi-Agent Systems - Complex orchestration (app generator, travel planner, hedge fund)
Time to Complete: 2-5 days
Examples: 20 across 3 subcategories (3 chat + 11 specialized + 6 multi-agent)
⭐ Featured: ai-app-generator - Generate complete full-stack apps
Level: Advanced
Retrieval-Augmented Generation and semantic search
Build AI applications with knowledge bases:
- RAG Fundamentals - ChromaDB, Weaviate, local vs cloud
- RAG Applications - Property search, documentation, research assistants
Time to Complete: 3-5 days
Examples: 9 across 2 subcategories
Databases: ChromaDB, Weaviate, LanceDB, Pinecone
Level: Intermediate
Connect with popular platforms and services
Integrate Motia with external services:
- GitHub - CI/CD, webhooks, automation
- Communication - Gmail, Trello
- Payment - Stripe integration
- Social Media - Engagement, content distribution
- Google Workspace - Drive, Sheets, Calendar
Time to Complete: 1-2 days
Examples: 9 across 5 subcategories
⭐ Featured: stripe-payment-demo - Production-ready payment flow
Level: Intermediate
Build intelligent monitoring systems
Scheduled monitoring with smart alerts:
- Air quality monitoring
- Mortgage rate tracking
- Vehicle maintenance alerts
Time to Complete: 1 day
Examples: 3
Key Concept: Cron Steps + Event-driven alerts
Level: Intermediate to Advanced
Automate content and marketing workflows
Marketing automation and content management:
- Email marketing automation
- User-generated content workflows
- Multi-modal content analysis
Time to Complete: 2-3 days
Examples: 3
⭐ Featured: email-marketing-automation - Complete email platform
Level: Expert
Production-ready, complex implementations
Enterprise-grade applications:
- AI room renovation (computer vision + design)
- Competitor price scraping
- ShopFlow (Shopify + WhatsApp customer support automation)
- Meeting transcription and analysis
- Intelligent form routing
- Computer vision examples
- Wake surf club booking + SMS + calendar
Time to Complete: 1-2 weeks
Examples: 7
Note: These are production-ready systems, not tutorials
- Start with Getting Started
- Pick the middleware-auth-handler-example
- Progress through all 5 getting-started examples
- Move to Foundational
- Quick review of Getting Started
- Jump to AI Agents → Chat Agents
- Explore RAG and Search for knowledge bases
- Build Multi-Agent Systems
- Review Getting Started → queue-example
- Go to Integrations
- Pick the service you need (GitHub, Stripe, Gmail, etc.)
- Browse Advanced Use Cases
- Check AI Agents → Multi-Agent Systems
- Explore RAG Applications
| Category | Level | Examples | Time | Best For |
|---|---|---|---|---|
| Getting Started | Beginner | 5 | 2-5h | Learning Motia basics |
| Foundational | Intermediate | 10 | 1-2d | Common app patterns |
| AI Agents | Int-Expert | 20 | 2-5d | AI applications |
| RAG and Search | Advanced | 9 | 3-5d | Knowledge bases |
| Integrations | Intermediate | 9 | 1-2d | External services |
| Monitoring | Intermediate | 3 | 1d | Alert systems |
| Content/Marketing | Int-Advanced | 3 | 2-3d | Marketing automation |
| Advanced | Expert | 7 | 1-2w | Production systems |
Total Examples: 66
Latest: Added comprehensive todo-app and ProspectAI examples
- Motia Docs - Official documentation
- API Steps Guide - HTTP endpoints
- Event Steps Guide - Background processing
- Cron Steps Guide - Scheduled tasks
- Real-time Streaming - SSE and WebSockets
- State Management - Cache and state
Each example follows a consistent structure:
example-name/
├── README.md # Documentation and setup instructions
├── package.json # Dependencies (for JS/TS examples)
├── requirements.txt # Dependencies (for Python examples)
├── .env.example # Environment variable template
├── motia-workbench.json # Workbench configuration (optional)
├── steps/ # Step definitions
│ ├── api/ # API endpoints
│ ├── events/ # Event handlers
│ └── cron/ # Scheduled tasks
├── src/ # Source code
│ ├── services/ # Business logic
│ └── utils/ # Utilities
└── docs/ # Additional documentation
└── images/ # Screenshots and diagrams
# 1. Navigate to the example
cd getting-started/middleware-auth-handler-example
# 2. Install dependencies
npm install
# 3. Configure environment
cp env.example .env
# Edit .env with your API keys
# 4. Start development server
npm run dev
# 5. Open Workbench
# http://localhost:3000- TypeScript/JavaScript: ~70% of examples
- Python: ~20% of examples
- Multi-language: ~10% (both TS and Python)
- Start Simple: Don't skip the getting-started examples
- Use Workbench: Visual workflow helps understanding
- Read READMEs: Each example has detailed documentation
- Ask Questions: Join Discord for community support
- Explore Categories: Find patterns relevant to your use case
- Combine Patterns: Mix and match from different examples
- Customize: Adapt examples to your needs
- Contribute: Share your improvements
- Study Architecture: Learn from advanced examples' structure
- Performance: Consider queues, caching, and scaling
- Monitoring: Implement proper logging and metrics
- Production: Add error handling and security
- API Steps: All categories, especially Getting Started
- Event Steps: AI Agents, Integrations
- Cron Steps: Monitoring and Alerts, Foundational
- Streaming (SSE): AI Agents, Getting Started
- Middleware: Getting Started
- State Management: AI Agents, Getting Started
- Queues: Getting Started, Advanced
- OpenAI: AI Agents, RAG and Search
- Anthropic Claude: AI Agents
- Vector Databases: RAG and Search
- GitHub: Integrations
- Stripe: Integrations
- Docker: Foundational
- Computer Vision: Advanced
- Chatbots: AI Agents
- Search: RAG and Search
- E-commerce: Integrations, ShopFlow, Monitoring
- Content: Content and Marketing
- Analytics: Advanced
- Automation: Foundational
- Monitoring: Monitoring and Alerts
We welcome contributions! Here's how you can help:
- Report Issues: Found a bug? Open an issue
- Improve Examples: Submit PRs to enhance existing examples
- Add Examples: Share your Motia applications
- Documentation: Help improve READMEs and guides
- Community: Help others in Discord
- Choose the appropriate category
- Follow the project structure template
- Include comprehensive README
- Add env.example with all required variables
- Test thoroughly
- Submit PR with description
All examples are licensed under the Apache License 2.0 unless otherwise specified.
- Documentation Issues: Check the README in each example
- Motia Questions: Motia Docs
- Community Support: Discord
- Bug Reports: GitHub Issues
- todo-app - 🌟 COMPLETE Motia demo showcasing ALL features (APIs, events, cron, streams, state)
- middleware-auth-handler-example - Essential middleware patterns
- realtime-todo-app - Real-time with SSE
- real-time-cursor-pointers - Collaborative real-time
- ai-app-generator - Multi-agent app generation
- streaming-ai-chatbot - Real-time AI chat
- motia-research-assistant - Research automation
- stripe-payment-demo - Payment processing
- email-marketing-automation - Email campaigns
- competitor-price-scrapper - Web scraping
Built with ❤️ using Motia
Start building event-driven applications today!