Skip to main content
The 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.
Recommendation: Consider using cpln workload cron run instead — it’s significantly faster and the preferred way to run commands going forward. It uses a persistent cron workload runner that is reused across executions, eliminating the overhead of creating and tearing down a workload each time.

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

Install the Control Plane CLI. See Installation.
You need create and exec permissions on workloads. See Workload Permissions.

Basic usage

By default, this:
  1. Creates a temporary workload using ubuntu:22.04
  2. Waits for it to become healthy
  3. Executes the command
  4. Exits (workload remains unless --rm is used)

Options

Run a simple command

Use a custom image

Clone an existing workload

Run commands in an environment identical to an existing workload:
This clones 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:
Use --rm for one-off tasks to avoid accumulating temporary workloads.

Interactive mode

Stay in the container after the command runs:
After the command executes, you’ll have an interactive shell to continue working.

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:
This starts the container with sleep infinity instead of its default command, then opens a bash session.

Troubleshooting

Run with --verbose to see what the platform reports about the deployment while the command waits:
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 staticPlacement.locationLinks.
The default Ubuntu image may not have your tool. Use a custom image:
Specify a different shell:
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