Skip to main content
The cpln workload cron run command runs a command using a persistent suspended cron workload. The runner workload is created on first use and reused for subsequent runs, avoiding the overhead of creating and deleting a workload each time.
This is the recommended approach for running one-off commands. If you need to create a temporary standard workload instead (e.g., to clone an existing workload’s configuration), use cpln workload run.

When to use this

Run migrations

Execute database migrations with fast startup times

Recurring scripts

Run maintenance scripts repeatedly without workload creation overhead

Background jobs

Fire-and-forget jobs that run without blocking your terminal

Interactive debugging

Connect to an interactive session inside the runner workload

Prerequisites

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

Basic usage

On first use, this:
  1. Creates a persistent suspended cron workload as the runner
  2. Starts a job execution with your command
  3. Waits for the job to complete and outputs the result
On subsequent runs, the existing runner workload is reused, making startup significantly faster.

Options

--interactive and --background are mutually exclusive.

Execution modes

Default (wait for completion)

Waits for the job to complete and outputs the final status:

Background mode

Fires and forgets, outputting the job ID immediately:
Use this for long-running tasks where you don’t need to wait for the result.

Interactive mode

Waits for the job to start, then connects via WebSocket for an interactive terminal session:

Specify a shell

Use a custom image

Common workflows

The cron runner uses ubuntu:latest by default, which won’t have your application tools (Node.js, Python, etc.). Use --image to specify an image that has the tools your command needs.

Run database migrations

Run data processing in the background

Pass environment variables

Run in a specific location

The specified location must be enabled in your GVC. You can check your GVC’s locations with cpln gvc get <gvc-name>.

Add tags for tracking

Assign an identity

Use --identity to assign a specific identity to the cron runner workload. If a runner with that identity already exists, it will be reused instead of creating a new one:
This is useful when your command needs to access cloud resources or secrets that require a specific identity’s permissions.

Resource configuration

Override CPU and memory for resource-intensive tasks:

Troubleshooting

The default timeout is 600 seconds. For long-running tasks, specify an image with the tools you need and increase the timeout:
Alternatively, use --background for tasks that don’t need to wait for completion.
The default image may not have your tool. Use a custom image:
Specify a different shell for interactive sessions:

Next steps

Run One-off Workloads

Create temporary standard workloads for one-off tasks

Execute Commands

Run commands in existing workloads

Connect to Workloads

Interactive shell in running workloads

Command Reference

Full cron run command reference