Motia Cloud Deployment
Learn how to deploy your Motia workflows to production
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
Required Options
Option | Alias | Description | Environment Variable |
---|---|---|---|
--api-key | -k | API key for authentication | MOTIA_API_KEY |
--version-name | -v | Version tag for the deployment | None |
Optional Options
Option | Alias | Description | Environment Variable |
---|---|---|---|
--environment-id | -s | Environment ID | MOTIA_ENVIRONMENT_ID |
--env-file | -e | Path to environment file | None |
--project-name | -n | Project name (used when environment-id is not provided) | MOTIA_PROJECT_NAME |
Note: Command-line options take precedence over environment variables. If both are provided, the command-line value will be used.
Examples
Deploy with a specific version:
Deploy to a specific environment with environment variables:
Deploy using environment variables:
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 cloud 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