cpln workload run command creates a temporary workload, waits for it to become healthy, executes your command, and optionally cleans up. It’s similar to docker run - perfect for one-off tasks, debugging, and running scripts in your cloud environment.
When to use this
Run migrations
Execute database migrations in your production environment
One-off scripts
Run maintenance scripts, data processing, or cleanup tasks
Debug with clones
Clone an existing workload to debug in an isolated environment
Quick tests
Spin up temporary containers to test configurations
Prerequisites
CLI installed
CLI installed
Install the Control Plane CLI. See Installation.
Required permissions
Required permissions
You need
create and exec permissions on workloads. See Workload Permissions.Basic usage
- Creates a temporary workload using
ubuntu:22.04 - Waits for it to become healthy
- Executes the command
- Exits (workload remains unless
--rmis used)
Options
Run a simple command
Use a custom image
Clone an existing workload
Run commands in an environment identical to an existing workload:my-app with all its configuration (env vars, secrets, identity) and runs the command.
Target a specific container
For multi-container workloads:Automatic cleanup
Delete the temporary workload after the command completes:Interactive mode
Stay in the container after the command runs:Specify a shell
Common workflows
Run database migrations
Debug in a cloned environment
Run data processing
Test in a specific location
Add tags for tracking
Resource configuration
Override CPU and memory for resource-intensive tasks:Override container command
Replace the container’s default command:sleep infinity instead of its default command, then opens a bash session.
Troubleshooting
Workload never becomes ready
Workload never becomes ready
Run with Each time the reported status changes, it is written to stderr — naming the containers that are not ready yet and any message the platform attached, such as a deployment paused because it cannot reveal a referenced secret, or an image that cannot be pulled.If the status shows nothing unusual, the location may not be available in your GVC:Verify the location is in the GVC’s
--verbose to see what the platform reports about the deployment while the command waits:staticPlacement.locationLinks.Command not found
Command not found
The default Ubuntu image may not have your tool. Use a custom image:
Shell not available
Shell not available
Specify a different shell:
Timeout waiting for workload
Timeout waiting for workload
The workload may take longer to start. Check the GVC locations and image availability.The error names the last status the platform reported, which usually identifies the container that never became ready. Run with
--verbose to follow that status from the start of the wait.Next steps
Execute Commands
Run commands in existing workloads
Connect to Workloads
Interactive shell in running workloads
Create a Workload
Create persistent workloads
Command Reference
Full run command reference