Manage Workloads with the CLI¶
Premium feature
The Workload API is a premium feature. Contact your DataRobot representative or administrator for information on enabling the feature.
The dr workload command group deploys and operates Workloads from your terminal. It is also available under the alias dr wl. Commands are structured as follows:
dr workload <command> [flags]
The group covers the full Workload lifecycle:
| Subcommand | Description |
|---|---|
| Deploy from a project | config, up, promote |
| CRUD | create, get, list, delete |
| Lifecycle | start, stop, status, settings |
| Invoke | endpoint |
| Observe | logs, events, diagnose |
Before you begin, authenticate with dr auth login.
There are two ways to get a Workload running.
Run dr workload config once to save your project's settings to .datarobot.yaml. Then run dr workload up to deploy. Run dr workload up again whenever you make changes.
# Write .datarobot.yaml (a wizard on a terminal, flags otherwise)
dr workload config
# Plan, then deploy; later runs apply only the difference
dr workload up
# Every other command finds the Workload from .datarobot.yaml
dr workload status
dr workload logs --follow
# Lock the version that is running
dr workload promote
# Tear it down, with everything the deploy created
dr workload delete --purge
For a walkthrough, see Tutorial: Deploy from a project folder.
Run dr workload create with a spec file that points to the artifact:
# Build and lock the artifact (see dr artifact)
dr artifact build create <artifact-id> --wait
dr artifact lock <artifact-id>
# Create the Workload
dr workload create --spec-file workload.yaml
# Check it's running
dr workload status <workload-id>
# Get the invoke URL
dr workload endpoint <workload-id>
# Tail logs
dr workload logs <workload-id> --follow
# Tear it down when done
dr workload delete <workload-id>
Working in a project directory¶
Inside a project folder, you can leave out <workload-id> from any command that takes one. The CLI finds the ID for you:
- It looks for
.datarobot.yamlin the current directory, or in the directory you pass with--dir. - If it doesn't find one, it checks each parent directory in turn.
- It reads the Workload ID from the
workloadIdkey in the first.datarobot.yamlit finds.
The command prints the Workload it picked to stderr, so you can confirm it's the right one:
cd my-app
dr workload status # instead of dr workload status 67890abcdef1234567890wld
dr workload logs --follow
dr workload up adds workloadId to .datarobot.yaml automatically after the first deploy.
If you created the Workload another way, such as with dr workload create, you can add the ID yourself. Create a .datarobot.yaml file in the project's root folder that contains this one line, using the ID that dr workload create printed:
workloadId: 67890abcdef1234567890wld
If you pass a Workload ID in the command, the CLI uses that ID and ignores the one in .datarobot.yaml.
The CLI searches only the current directory and its parents, never subfolders or folders beside it. To use a project in another folder, pass its path with --dir.
Because stop, start, delete, and promote change something, they ask for confirmation when the ID comes from the manifest rather than the command line. Pass --yes to skip the prompt in a script; a typed ID is never prompted. stop and start also accept DATAROBOT_CLI_NON_INTERACTIVE=true in place of --yes. delete and promote do not when the ID comes from the manifest: that variable is usually set once across a whole pipeline, and deleting or locking something nobody named is not what it was set for.
Subcommands¶
| Subcommand | Description |
|---|---|
dr workload config |
Write the .datarobot.yaml that describes a project. |
dr workload up |
Deploy a project, or the difference between its .datarobot.yaml and what is running. |
dr workload promote |
Lock the version a Workload is running so it can't change. |
dr workload create |
Create a Workload from a YAML or JSON spec file. |
dr workload get |
Display details for a single Workload by ID. |
dr workload list |
List Workloads with optional filtering. |
dr workload delete |
Delete a Workload by ID, and optionally what the deploy created beside it. |
dr workload start |
Start a stopped Workload. |
dr workload stop |
Stop a running Workload without deleting it. |
dr workload settings |
Show or change replicas, autoscaling, and resources. |
dr workload status |
Display the current status of a Workload. |
dr workload diagnose |
Explain why a Workload is in its current state. |
dr workload endpoint |
Print the invoke URL for a Workload. |
dr workload logs |
Print or stream runtime logs for a Workload. |
dr workload events |
Show the lifecycle events the platform recorded for a Workload. |
dr workload config¶
Write the .datarobot.yaml that describes a project. On a terminal it is a short wizard: bind to an existing Workload or name a new one, confirm the image source and port read from the Dockerfile, pick the sizing, and carry the variables in .env into the file. Every question has a flag, so the same file is written without prompts in CI. The file is the Workload create spec plus a workloadId the CLI manages; see Workload manifest.
dr workload config [--dir <path>] [--name <name> | --workload-id <id>] [--build-mode dockerfile|generated|image] [--port <n>] [--health <path>] [--cpu <n>] [--memory <size>] [--replicas <n>] [--importance <level>] [--skip-env] [--spec-file <path>] [--sync-env] [--dry-run] [-y|--yes] [--output-format text|json]
| Argument/Flag | Description |
|---|---|
--dir <path> |
Project directory. Defaults to the current directory. |
--name <name> |
Name a new Workload, created by the first dr workload up. Exclusive with --workload-id. |
--workload-id <id> |
Bind the project to an existing Workload instead. The file is written from what that Workload runs. |
--build-mode <mode> |
Image source: dockerfile (your own ./Dockerfile, the default when one exists), generated (a DataRobot base image plus your code), or image (a published image). |
--execution-environment <name>, --entrypoint <command> |
The base image and the command that starts the app. Required with --build-mode generated. |
--image <uri> |
The published image. Required with --build-mode image. |
--port <n> |
Container port. Defaults to the Dockerfile's EXPOSE, else 8080. Must be at least 1024. |
--health <path> |
Readiness path, for example /health. Without it no readiness probe is written, since a wrong probe stops a healthy deploy from ever going ready. --no-readiness-probe says so explicitly. |
--cpu <n>, --memory <size>, --replicas <n> |
Sizing per replica and the replica count. Default to 0.5, 512MB, and 1. |
--importance <level> |
low, moderate, high, or critical. Defaults to low. |
--skip-env |
Do not carry the .env in the project into the manifest. By default its variables are written there: ordinary values as literals, secrets as credential references. |
--sync-env |
Bring an existing manifest into line with .env: add, rewrite, and remove variables, and re-send the credential behind a secret. Prints what it would do and asks first. |
--spec-file <path> |
Take the answers from a prepared artifact spec or Workload spec and ask only what it leaves open. The spec file is left alone; .datarobot.yaml is written. |
--dry-run |
Print the manifest and write nothing. |
-y, --yes |
Do not prompt; answer every question from flags and the project. A question neither answers is an error naming the flag that would settle it. |
--output-format <text\|json> |
Output format. Defaults to text. |
config leaves an existing manifest alone; the only edit it makes to one is --sync-env.
Examples¶
The following commands write a manifest interactively, from flags, and from a spec you already have.
# On a terminal: the wizard
dr workload config
# In CI: a project with a Dockerfile needs nothing but a name
dr workload config --yes --name my-app
# A published image
dr workload config --yes --name my-app --build-mode image --image registry.example.com/app:v1
# From a Workload spec you already hold; asks only what it leaves open
dr workload config --spec-file workload.yaml --name my-app
# After editing .env: reconcile the manifest's variables
dr workload config --sync-env
dr workload up¶
Deploy the project. The command compares .datarobot.yaml and your project files with what's currently running, prints a plan of what it will change, and then makes those changes.
If nothing has changed, it prints Already up to date and exits with code 0.
dr workload up [--dir <path>] [--dry-run] [--detach] [--force-build] [--promote] [--sync-env] [--spec-file <path>] [--poll-timeout <duration>] [-y|--yes] [--output-format text|json]
| Argument/Flag | Description |
|---|---|
--dir <path> |
Project directory; the manifest is searched upward from here. Defaults to the current directory. |
--dry-run |
Print the plan and change nothing. On a project with no manifest, also print the .datarobot.yaml a real run would write. |
--detach |
Return once the deploy is requested; do not wait for it to serve. |
--force-build |
Rebuild the image even when the working tree matches what was last synced, and roll the result out. This is how to recover a Workload whose image is gone from the registry. |
--promote |
Lock the artifact of the version that ends up live, even when this deploy created no new version. Locking is one-way. |
--sync-env |
Before deploying, bring the manifest into line with .env. Prints what it would change and asks first. |
--spec-file <path> |
On a first deploy, take the setup's answers from a prepared artifact or Workload spec instead of the wizard. Refused once a manifest exists. |
--poll-timeout <duration> |
How long each wait the deploy does, including the build and the rollout, may take. Defaults to 30m. Giving up ends the wait, not the deploy. |
-y, --yes |
Answer every prompt, including the setup on a project with no manifest and the confirmation for rolling a locked version. |
--output-format <text\|json> |
Output format. Defaults to text. JSON is one document carrying the plan and the result. |
What a run does depends on what changed. The following table summarizes the rules; see Workload manifest for more detail.
| What changed | What up does |
|---|---|
| Nothing | Prints Already up to date. |
| Code or the Dockerfile | Syncs the code, builds a new image, creates a new artifact version, and rolls the Workload onto it. Build logs stream live. |
| An environment variable, the port, a probe, or the image reference | Creates a new version that keeps the running image, and rolls it out. No rebuild. |
| Replicas or resources | Applies the settings in place; no new version. |
| The Workload does not exist | Creates it from the file in one call. |
| The Workload is stopped or errored | Starts it, or rolls it onto what the file has that is new. |
| A rollout is already in flight | Waits it out, then continues. |
A rollout never changes the endpoint, and the generation already serving keeps serving until the new one is ready. Only fields the manifest mentions are managed: a setting the file never names survives every deploy, and a value changed in the UI that the file does name is put back on the next run, and the run says so.
If the project doesn't have a .datarobot.yaml file yet, dr workload up first runs the same setup as dr workload config. It creates .datarobot.yaml, tells you it did, and then deploys.
With --yes, the setup runs without prompts and fills in the settings from your project files. If the CLI can't work out a setting (for example, because there's no Dockerfile), the command stops and lists the dr workload config flags you can use to provide it.
Commit .datarobot.yaml
Commit .datarobot.yaml to your repository. Later deploys use it to find your Workload. Without it, every CI run creates a new Workload.
Examples¶
The following commands deploy interactively, preview, deploy unattended, and recover a lost image.
# Plan, then deploy
dr workload up
# Plan and stop
dr workload up --dry-run
# In CI: deploy asking nothing, with a JSON result
dr workload up --yes --output-format json
# Deploy and lock the result
dr workload up --promote
# Rebuild the image the registry lost
dr workload up --force-build
my-app (67890abc), running
+ artifact new version, 1 spec change; keeps the running image, so no rebuild
env GREETING: changed
~ runtime containerGroups[default].replicaCount: 1 -> 3
✓ Creating the new version (100ms)
✓ Rolling out the new version (300ms)
✓ Waiting for the rollout (11s)
✓ Waiting for the new version to serve (1m2s)
✓ Checking the endpoint (200ms)
Endpoint check: an authenticated GET answered HTTP 200 OK.
dr workload promote¶
Make the version a Workload is running permanent. The draft artifact it is serving is locked in place and given a version number; the Workload keeps running it, and nothing is rebuilt or rolled. This is the CLI form of promoting a Workload to production.
dr workload promote [<workload-id>] [--dir <path>] [-y|--yes] [--output-format text|json]
| Argument/Flag | Description |
|---|---|
<workload-id> |
The Workload ID. Optional inside a project whose .datarobot.yaml names one. |
--dir <path> |
Project directory whose .datarobot.yaml names the Workload. |
-y, --yes |
Skip the confirmation asked when the ID comes from the manifest. |
--output-format <text\|json> |
Output format. Defaults to text. JSON is {"workloadId", "artifactId", "version"}. |
Locking can't be undone. After you promote a Workload, the next dr workload up that changes something creates a new version instead of editing the locked one, and locks the new version too. A promoted Workload always deploys locked versions.
The command fails, and shows the reason from DataRobot, if the Workload:
- Is already running a locked version.
- Has no running version.
- Is in the middle of a rollout.
Only the artifact's owner can promote a Workload.
To deploy and promote in one step, run dr workload up --promote.
dr workload create¶
Create a Workload from a YAML or JSON spec file.
dr workload create --spec-file <path> [--use-case-id <id>] [--enclave <name>] [--output-format text|json]
| Argument/Flag | Description |
|---|---|
--spec-file <path> |
Path to a YAML or JSON spec file. Required. |
--use-case-id <id> |
Link the Workload to a Use Case at create time, the same as a top-level useCaseId in the spec. |
--enclave <name> |
Pin the Workload to a named Enclave granted to that Use Case. Requires --use-case-id or useCaseId in the spec. |
--output-format <text\|json> |
Output format. Defaults to text. |
Spec file format¶
The spec file describes the Workload and provides either an artifact reference or an inline artifact spec. See Two ways to create a Workload for a description of both modes.
name: my-api-service
artifactId: 67890abcdef1234567890abc # locked artifact
importance: low
runtime:
containerGroups:
- name: default
replicaCount: 1
containers:
- name: main
resourceAllocation:
cpu: 1
memory: "512Mi"
name: my-api-service
importance: low
artifact:
name: my-api-service-artifact
spec:
containerGroups:
- containers:
- imageUri: ghcr.io/my-org/my-app:latest
port: 8000
primary: true
readinessProbe:
path: /readyz
port: 8000
initialDelaySeconds: 10
livenessProbe:
path: /healthz
port: 8000
initialDelaySeconds: 30
runtime:
containerGroups:
- name: default
replicaCount: 1
containers:
- name: main
resourceAllocation:
cpu: 1
memory: "512Mi"
Examples¶
dr workload create --spec-file workload.yaml
ID: 67890abcdef1234567890wld
Name: my-api-service
Status: launching
Endpoint: —
Type: service
Importance: low
Artifact ID: 67890abcdef1234567890abc
Created: 2026-05-14 10:00 UTC
Updated: 2026-05-14 10:00 UTC
dr workload create --spec-file workload.yaml --output-format json
{
"id": "67890abcdef1234567890wld",
"name": "my-api-service",
"status": "launching",
"importance": "low",
"createdAt": "2026-05-14T10:00:00Z",
"updatedAt": "2026-05-14T10:00:00Z"
}
dr workload get¶
Display details for a single Workload by ID.
dr workload get [<workload-id>] [--dir <path>] [--output-format text|json]
| Argument/Flag | Description |
|---|---|
<workload-id> |
The Workload ID. Optional inside a project whose .datarobot.yaml names one. |
--dir <path> |
Project directory whose .datarobot.yaml names the Workload. |
--output-format <text\|json> |
Output format. Defaults to text. |
Examples¶
dr workload get 67890abcdef1234567890wld
ID: 67890abcdef1234567890wld
Name: my-api-service
Status: running
Endpoint: https://app.datarobot.com/api/v2/workloads/67890abcdef1234567890wld/
Type: service
Importance: low
Artifact ID: 67890abcdef1234567890abc
Created: 2026-05-14 10:00 UTC
Updated: 2026-05-14 10:05 UTC
dr workload list¶
List Workloads with optional filtering.
dr workload list [--limit <n>] [--offset <n>] [--status <status>] [--enclave <name>] [--output-format text|json]
| Argument/Flag | Description |
|---|---|
--limit <n> |
Maximum number of Workloads to return. Defaults to 100. |
--offset <n> |
Number of Workloads to skip before returning results. Defaults to 0. |
--status <status> |
Filter by lifecycle status. Accepts a single value or multiple values (repeatable flag or comma-separated, for example --status running or --status running,errored). Optional. |
--enclave <name> |
Only list Workloads running on the named Enclave. Optional. |
--output-format <text\|json> |
Output format. Defaults to text. |
Examples¶
dr workload list
Renders as a bordered table:
╭──────────────────────────┬────────────────┬─────────┬─────────┬────────────┬──────────────────────╮
│ WORKLOAD ID │ NAME │ STATUS │ TYPE │ IMPORTANCE │ UPDATED │
├──────────────────────────┼────────────────┼─────────┼─────────┼────────────┼──────────────────────┤
│ 67890abcdef1234567890wld │ my-api-service │ running │ service │ low │ 2026-05-14 10:05 UTC │
╰──────────────────────────┴────────────────┴─────────┴─────────┴────────────┴──────────────────────╯
When no Workloads match, the text output is No workloads found. and the JSON output is {"workloads": []}.
dr workload list --status running --output-format json
{
"workloads": [
{
"id": "67890abcdef1234567890wld",
"name": "my-api-service",
"status": "running",
"type": "service",
"importance": "low",
"artifactId": "67890abcdef1234567890abc",
"endpoint": "https://app.datarobot.com/api/v2/workloads/67890abcdef1234567890wld/",
"createdAt": "2026-05-14T10:00:00Z",
"updatedAt": "2026-05-14T10:05:00Z"
}
]
}
dr workload delete¶
Delete a Workload by ID. The Workload is stopped if it is running, and all associated protons are torn down. The backing artifact is not deleted unless you pass --purge.
dr workload delete [<workload-id>] [--dir <path>] [--purge] [-y|--yes]
| Argument/Flag | Description |
|---|---|
<workload-id> |
The Workload ID. Optional inside a project whose .datarobot.yaml names one. |
--dir <path> |
Project directory whose .datarobot.yaml names the Workload. Its binding to the deleted Workload is cleared too. |
--purge |
Also remove what the deploy created beside the Workload: the draft artifact it ran when no other Workload references it, the credentials this project created, and the local .datarobot/workload/ state directory. The confirmation names everything a purge removes. |
-y, --yes |
Skip the confirmation prompt. --yes alone never widens what a delete does. |
After deleting the Workload, the command updates the project it found with --dir (the current directory by default):
- Workload ID: If
.datarobot.yamlpoints to the deleted Workload, the command removes theworkloadIdline. The nextdr workload upfrom that project creates a new Workload. - Environment variables:
.datarobot.yamlkeeps its environment variables. Any variable that referred to a credential deleted by--purgeis reset to a placeholder. The next--sync-envrun, withdr workload upordr workload config, replaces the placeholder with a new credential.
Locked artifacts are kept. A locked artifact can't be deleted, so --purge leaves it in place and says so in its output. It also keeps the artifact's credentials, because anything that runs the artifact might still need them.
Examples¶
The following commands delete by ID, from a project, and with everything the deploy created.
# Delete by ID; the artifact stays
dr workload delete 67890abcdef1234567890wld
# From a project: the Workload named in .datarobot.yaml, after confirming
dr workload delete
# Everything the deploy created, asking nothing
dr workload delete --purge --yes
dr workload start¶
Start a stopped Workload. Has no effect on a Workload that is already running or launching.
dr workload start [<workload-id>] [--dir <path>] [-y|--yes] [--output-format text|json]
| Argument/Flag | Description |
|---|---|
<workload-id> |
The Workload ID. Optional inside a project whose .datarobot.yaml names one. |
--dir <path> |
Project directory whose .datarobot.yaml names the Workload. |
-y, --yes |
Skip the confirmation asked when the ID comes from the manifest. |
--output-format <text\|json> |
Output format. Defaults to text. |
dr workload stop¶
Stop a running Workload without deleting it. Protons are scaled to zero; the Workload identity and endpoint URL are preserved. Use dr workload start to restart.
dr workload stop [<workload-id>] [--dir <path>] [-y|--yes] [--output-format text|json]
| Argument/Flag | Description |
|---|---|
<workload-id> |
The Workload ID. Optional inside a project whose .datarobot.yaml names one. |
--dir <path> |
Project directory whose .datarobot.yaml names the Workload. |
-y, --yes |
Skip the confirmation asked when the ID comes from the manifest. |
--output-format <text\|json> |
Output format. Defaults to text. |
dr workload settings¶
Show or change how much a Workload runs with, including replicas, autoscaling, resource bundles, and the CPU and memory of each container.
These are the same settings that dr workload up applies from .datarobot.yaml. Use this command to check or resize a Workload that doesn't have a .datarobot.yaml file, such as one created with dr workload create.
Note
If the Workload has a .datarobot.yaml file, the next dr workload up resets any setting named in that file to the file's value. To keep a change, update .datarobot.yaml instead.
For conceptual information, see Runtime settings.
dr workload settings [<workload-id>] [--dir <path>] [--output-format text|json]
dr workload settings [<workload-id>] --replicas <n> [--group <name>] [--wait] [-y|--yes]
dr workload settings [<workload-id>] --spec-file <path> [--wait] [-y|--yes]
| Argument/Flag | Description |
|---|---|
<workload-id> |
The Workload ID. Optional inside a project whose .datarobot.yaml names one. |
--dir <path> |
Project directory whose .datarobot.yaml names the Workload. |
--replicas <n> |
Scale one container group to n replicas. A Workload with one group needs no --group; with several, name it. A group with autoscaling enabled is refused, because its count belongs to the autoscaler: change the policy with --spec-file instead. |
--group <name> |
The container group --replicas applies to. |
--spec-file <path> |
Apply a whole settings body, JSON or YAML: the document --output-format json prints, or the runtime block itself. The body replaces the whole runtime, so every group needs its name, its containers, and either resourceBundles or a resourceAllocation on each container. |
--wait |
Follow the replacement to its end, wait for the Workload to run on the new settings, and print them. A replacement that fails leaves the Workload on the settings it had, and the command exits non-zero. |
--poll-timeout <duration> |
How long --wait may take. Defaults to 30m. |
-y, --yes |
Skip the confirmation before a change. The rolling restart is still announced. |
--output-format <text\|json> |
Output format. Defaults to text. |
When you change settings, DataRobot replaces the Workload's containers gradually. It starts new containers with the new settings, then shuts down the old ones. The endpoint keeps responding the whole time.
- One change at a time: If a previous change is still rolling out, the command fails. Wait for the rollout to finish, then try again.
- Stopped Workloads: Changing settings on a stopped Workload also starts it.
- Waiting for the change: By default, the command returns as soon as DataRobot accepts the change. Add
--waitto wait until the rollout finishes. If you don't use--wait, rundr workload settingsagain to see whether the rollout is still in progress.
Examples¶
The following commands read the settings, scale, and apply an edited body.
# Current settings, one row per container
dr workload settings
# Scale to three replicas and wait for them
dr workload settings --replicas 3 --wait
# Save the settings, edit them, send them back
dr workload settings --output-format json > settings.json
dr workload settings --spec-file settings.json --wait
╭─────────┬──────────┬──────────────────────────────────┬────────────┬───────────┬─────┬────────────┬─────╮
│ GROUP │ REPLICAS │ AUTOSCALING │ BUNDLE │ CONTAINER │ CPU │ MEMORY │ GPU │
├─────────┼──────────┼──────────────────────────────────┼────────────┼───────────┼─────┼────────────┼─────┤
│ default │ auto │ 0-3 on httpRequestsConcurrency=2 │ cpu.xlarge │ primary │ 1 │ 2147483648 │ - │
╰─────────┴──────────┴──────────────────────────────────┴────────────┴───────────┴─────┴────────────┴─────╯
dr workload status¶
Print the current lifecycle status of a Workload as a bare string. The value is directly usable in scripts. An errored status is a valid answer, so the command still exits 0. Use dr workload get for the full detail view, and dr workload diagnose for why.
dr workload status [<workload-id>] [--dir <path>] [--output-format text|json]
| Argument/Flag | Description |
|---|---|
<workload-id> |
The Workload ID. Optional inside a project whose .datarobot.yaml names one. |
--dir <path> |
Project directory whose .datarobot.yaml names the Workload. |
--output-format <text\|json> |
Output format. Defaults to text. |
For a description of all status values, see Lifecycle states.
Examples¶
dr workload status 67890abcdef1234567890wld
running
dr workload status 67890abcdef1234567890wld
launching
STATUS=$(dr workload status 67890abcdef1234567890wld)
echo "Workload is: $STATUS"
dr workload diagnose¶
Explain why a Workload is in its current state. status says errored and stops there, and logs can be empty for a container that never started. This command reads the platform's per-replica status details for every container generation of the Workload and prints the overall verdict, then a table of each replica and container with its state, reason, restart count, readiness, and how its last run ended. Anything that stands out is listed as a finding: CrashLoopBackOff, ImagePullBackOff, ErrImagePull, OOMKilled, a non-zero exit code, restarts.
dr workload diagnose [<workload-id>] [--dir <path>] [--output-format text|json]
| Argument/Flag | Description |
|---|---|
<workload-id> |
The Workload ID. Optional inside a project whose .datarobot.yaml names one. |
--dir <path> |
Project directory whose .datarobot.yaml names the Workload. |
--output-format <text\|json> |
Output format. Defaults to text. JSON is one {"diagnosis": ...} document with findings as a list on every generation. |
An errored Workload is the answer, not a command failure, so the command exits 0, like status.
Examples¶
dr workload diagnose
Workload 67890abcdef1234567890wld (my-api-service) is errored
Generation 67890abcdef1234567890gen · errored · active artifact 67890abcdef1234567890abc
Workload is in state errored based on pod states
╭─────────────────────────────┬───────────┬─────────┬──────────────────┬──────────┬───────┬────────────────────╮
│ REPLICA │ CONTAINER │ STATE │ REASON │ RESTARTS │ READY │ LAST EXIT │
├─────────────────────────────┼───────────┼─────────┼──────────────────┼──────────┼───────┼────────────────────┤
│ 6945b6ddd7-6mhh8 (running) │ primary │ waiting │ CrashLoopBackOff │ 3 │ no │ exit 0 (Completed) │
╰─────────────────────────────┴───────────┴─────────┴──────────────────┴──────────┴───────┴────────────────────╯
Findings:
⚠ primary: CrashLoopBackOff; last run exited 0 (Completed)
dr workload endpoint¶
Print the invoke URL for a Workload. Only available when the Workload is in running status.
dr workload endpoint [<workload-id>] [--dir <path>]
| Argument/Flag | Description |
|---|---|
<workload-id> |
The Workload ID. Optional inside a project whose .datarobot.yaml names one. |
--dir <path> |
Project directory whose .datarobot.yaml names the Workload. |
Examples¶
# Print the endpoint
dr workload endpoint 67890abcdef1234567890wld
# Store the endpoint in a variable and invoke it
# Note: the URL ends with a trailing slash; append sub-paths without a leading slash
ENDPOINT=$(dr workload endpoint 67890abcdef1234567890wld)
curl -sS "${ENDPOINT}predict" \
-H "Authorization: Bearer $DATAROBOT_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"message": "hello"}'
dr workload logs¶
Print or stream runtime logs for a Workload. By default it prints the most recent --limit lines oldest-first.
dr workload logs [<workload-id>] [--dir <path>] [--level <level>] [--limit <n>] [--grep <text>]... [--exclude <text>]... [--trace-id <id>] [--span-id <id>] [--since <time>] [--until <time>] [--follow] [--output-format text|json]
| Argument/Flag | Description |
|---|---|
<workload-id> |
The Workload ID. Optional inside a project whose .datarobot.yaml names one. |
--dir <path> |
Project directory whose .datarobot.yaml names the Workload. |
--level <level> |
Minimum log level to show: debug, info, warn, warning, error, critical. Optional; if omitted, all levels are returned. |
--limit <n> |
Maximum number of log lines to fetch. Defaults to 100. Filters apply after the fetch, so a filtered result can be shorter. |
--grep <text> |
Only lines containing the text, case-insensitive. Repeat it to require every term. |
--exclude <text> |
Drop lines containing the text, case-insensitive. Repeatable. |
--trace-id <id>, --span-id <id> |
Only the lines of one trace or span. |
--since <time>, --until <time> |
A time window. A time is RFC 3339 (2026-06-11T14:04:15Z), a date (2026-06-11), or a duration back from now (15m, 2h30m, 1d, 1w). A time without a zone is UTC. With --follow, --until is refused. |
--follow |
Stream logs continuously (like tail -f). Press Ctrl+C to stop. |
--output-format <text\|json> |
Output format. Defaults to text. With --follow, JSON is one object per line. |
Empty output is not always a bug
If dr workload logs returns nothing, it says so on stderr and suggests running dr workload diagnose. Logs can be empty for two reasons:
- The log collector isn't installed: DataRobot collects container output (stdout) with a log collector that's installed separately on each cluster. If your installation doesn't have it, the command always returns an empty list, even when the Workload is healthy.
- The container never started: A container that didn't start hasn't written any output.
To find out why a container failed, run dr workload diagnose. It shows the reason and the exit code of the failed run.
Examples¶
# Print the last 100 log lines
dr workload logs 67890abcdef1234567890wld
# Filter to errors only
dr workload logs 67890abcdef1234567890wld --level error --limit 100
# Search the last hour, from inside a project
dr workload logs --grep "connection refused" --since 1h
# Stream errors, dropping health-check noise
dr workload logs --level error --exclude healthz --follow
# Capture logs as JSON for further processing
dr workload logs 67890abcdef1234567890wld --output-format json | jq '.[] | select(.level == "error")'
dr workload events¶
Shows the events DataRobot recorded for a Workload, including what changed, when, and who made the change. Events include:
- Settings changes that rolled out.
- Rollouts that failed, and why.
- Starts and stops.
Use dr workload events to see what DataRobot did to the Workload. Use dr workload logs to see what the container itself wrote.
The command prints the 100 most recent events, oldest first. To change how many it prints, use --limit.
dr workload events [<workload-id>] [--dir <path>] [--limit <n>] [--type <text>]... [--since <time>] [--until <time>] [--proton-id <id>] [--output-format text|json]
| Argument/Flag | Description |
|---|---|
<workload-id> |
The Workload ID. Optional inside a project whose .datarobot.yaml names one. |
--dir <path> |
Project directory whose .datarobot.yaml names the Workload. |
--limit <n> |
Number of recent events to show. Defaults to 100. |
--type <text> |
Only events whose type contains this text, in any case. Repeatable; any of them matches. |
--since <time>, --until <time> |
Bound the window. Same forms as logs. |
--proton-id <id> |
Only events that name the given generation (proton) in their details, such as the rollout that promoted it. |
--output-format <text\|json> |
Output format. Defaults to text. JSON is one {"events": [...]} document with the complete records, details included. |
Examples¶
# The recent trail, from inside a project
dr workload events
# Both outcomes of a rollout
dr workload events --type errored --type completed
# Everything from yesterday, with details
dr workload events --since 1d --output-format json
Error handling¶
| Error | Cause and resolution |
|---|---|
not authenticated |
Run dr auth login first; every dr workload command requires authentication. |
workload <id> not found |
The Workload ID does not exist. Check the ID with dr workload list. |
no workload id: pass one, or run inside a project whose .datarobot.yaml names one |
No ID on the command line and no manifest found walking upward from --dir. Pass the ID, or --dir to the project. |
no Dockerfile in <dir> on a first up --yes |
The setup cannot infer an image source. Run dr workload config with --build-mode and its flags, then up again. |
422 naming a field |
The platform rejected the spec. The key is as .datarobot.yaml spells it; fix the line and run up again. |
invalid spec: required field 'name' is missing or empty |
The spec file's name is missing or empty. Add a non-empty string. |
invalid spec: exactly one of 'artifact' or 'artifactId' must be set |
Supply either an inline artifact block or an artifactId, not both and not neither. |
artifact <id> not found |
The artifactId does not exist. Check the ID with dr artifact list. |
artifact must be locked to create a persistent Workload |
The referenced artifact is still in draft status. Lock it with dr artifact lock first, or use an inline artifact block for a draft Workload with an 8-hour TTL. |
workload limit reached |
The organization has hit its concurrent Workload cap. Delete unused Workloads and try again; or contact your DataRobot administrator. |
workload <id> has no endpoint URL |
The Workload has no endpoint assigned. Check status with dr workload status; the endpoint is only available once the Workload is running. |
Exit codes¶
| Code | Meaning |
|---|---|
0 |
Success. |
1 |
Error (validation failed, API error, not authenticated, etc.). |
130 |
Interrupted (Ctrl+C). |