Skip to content

Latest commit

 

History

History

README.md

Motia Examples

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.

📚 Browse by Category

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:

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:

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:

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


🎯 Quick Start

Choose Your Path

Path 1: "I'm New to Motia"

  1. Start with Getting Started
  2. Pick the middleware-auth-handler-example
  3. Progress through all 5 getting-started examples
  4. Move to Foundational

Path 2: "I Want to Build AI Apps"

  1. Quick review of Getting Started
  2. Jump to AI AgentsChat Agents
  3. Explore RAG and Search for knowledge bases
  4. Build Multi-Agent Systems

Path 3: "I Need to Integrate Services"

  1. Review Getting Startedqueue-example
  2. Go to Integrations
  3. Pick the service you need (GitHub, Stripe, Gmail, etc.)

Path 4: "I Want Production-Ready Examples"

  1. Browse Advanced Use Cases
  2. Check AI AgentsMulti-Agent Systems
  3. Explore RAG Applications

📊 At a Glance

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


🎓 Learning Resources

Documentation

Community


🏗️ Project Structure

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

🚀 Running an Example

General Steps

# 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

Language Distribution

  • TypeScript/JavaScript: ~70% of examples
  • Python: ~20% of examples
  • Multi-language: ~10% (both TS and Python)

💡 Tips and Best Practices

For Beginners

  • 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

For Intermediate Users

  • 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

For Advanced Users

  • 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

🔍 Find Examples by Feature

By Motia Feature

By Technology

By Use Case


🤝 Contributing

We welcome contributions! Here's how you can help:

  1. Report Issues: Found a bug? Open an issue
  2. Improve Examples: Submit PRs to enhance existing examples
  3. Add Examples: Share your Motia applications
  4. Documentation: Help improve READMEs and guides
  5. Community: Help others in Discord

Adding a New Example

  1. Choose the appropriate category
  2. Follow the project structure template
  3. Include comprehensive README
  4. Add env.example with all required variables
  5. Test thoroughly
  6. Submit PR with description

📄 License

All examples are licensed under the Apache License 2.0 unless otherwise specified.


🙋 Need Help?


⭐ Featured Examples

For Learning & Comprehensive Demos

For AI Development

For Production


Built with ❤️ using Motia

Start building event-driven applications today!