Deployment
Learn how to deploy your Motia workflows to production
Deployment
Motia provides a robust deployment system that allows you to deploy your workflows to various environments. This guide explains the deployment architecture, process, and how to use the Motia CLI for deployments.
Deployment Architecture
The Motia deployment system follows a three-step process:
- Upload Files: Each zip file is uploaded individually with its relative path information
- Upload Configuration: The
motia.steps.json
configuration is uploaded - Start Deployment: A request is sent to start the deployment process with the uploaded files and configuration
This approach provides several benefits:
- Better tracking of individual file uploads
- Separation of configuration from files
- Ability to retry specific parts of the deployment if needed
- More efficient server-side processing
- Ensures all files are successfully uploaded before proceeding
Using the Motia CLI for Deployment
The simplest way to deploy your Motia workflows is using the CLI command:
Command Options
Option | Alias | Description | Default |
---|---|---|---|
--environment | -e | Target environment for deployment | development |
--version | -v | Version tag for the deployment | Current timestamp |
--api-key | -k | API key for authentication (required) | None |
Examples
Deploy to the development environment with an auto-generated version:
Deploy to production with a specific version:
Deployment Results
After deployment, two files are generated in your project directory:
1. motia.deployments.json
Contains detailed information about each deployment attempt, including:
- Bundle path
- Deployment ID
- Step type
- Step name
- Step path
- Flow name
- Environment
- Version
- Success status
- Error message (if any)
2. motia.deployments.summary.json
A more human-readable summary organized by flows:
- Total steps deployed
- Successful deployments count
- Failed deployments count
- Deployment timestamp
- Environment
- Version
- List of flows with their steps and deployment status
Deployment Process
When you run motia deploy
, the CLI performs the following actions:
- Preparation: Validates your project structure and configuration
- File Collection: Gathers all workflow step zip files from your project
- File Upload: Uploads each zip file to the Motia platform
- Configuration Upload: Uploads your workflow configuration
- Deployment Initiation: Starts the deployment process on the server
- Status Reporting: Provides feedback on deployment progress and results
The CLI will display progress information during deployment and a summary when complete.
Troubleshooting Deployments
If you encounter issues during deployment, try these steps:
- Check the generated deployment files for specific error messages
- Ensure your API key has the correct permissions
- Verify your project structure follows Motia's requirements
- Check that all required files are present and correctly formatted
Next Steps
- Learn about Environment Variables for configuring your deployments
- Explore CI/CD Integration for automating your deployment process
- Check out Deployment Strategies for advanced deployment patterns