# Iterate then deploy

> Iterate then deploy - Development-to-production workflow where you iterate on a workload with a
> draft artifact, then register it and create a governed deployment.

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-04-24T16:03:56.299066+00:00` (UTC).

## Primary page

- [Iterate then deploy](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-iterate.html): Full documentation for this topic (HTML).

## Sections on this page

- [Workflow overview](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-iterate.html#workflow-overview): In-page section heading.
- [Step 1: Create a development workload](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-iterate.html#step-1-create-workload): In-page section heading.
- [Step 2: Iterate on the artifact](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-iterate.html#step-2-iterate): In-page section heading.
- [2a. Update artifact (partial update with PATCH)](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-iterate.html#step-2a-patch): In-page section heading.
- [2b. Replace entire artifact (full update with PUT)](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-iterate.html#step-2b-put): In-page section heading.
- [2c. Restart workload to apply changes](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-iterate.html#step-2c-restart): In-page section heading.
- [Step 3: Lock artifact for production](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-iterate.html#step-3-lock-artifact): In-page section heading.
- [Step 4: Create production deployment](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-iterate.html#step-4-create-deployment): In-page section heading.
- [Key concepts](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/tutorials/tutorial-iterate.html#key-concepts): In-page section heading.

## Related documentation

- [Developer documentation](https://docs.datarobot.com/en/docs/api/index.html): Linked from this page.

## Documentation content

# Iterate then deploy

This tutorial demonstrates the development-to-production workflow where you iterate on a workload with a draft artifact, then register it and create a governed deployment.

## Workflow overview

| Phase | Action | Result |
| --- | --- | --- |
| Development | POST /console/workloads/ | Creates workload and draft artifacts. |
| Iteration | PATCH /registry/artifacts/{artifactId} | Updates the container spec, restarts, tests. |
| Lock | PATCH /registry/artifacts/{artifactId} | Sets status: registered to make immutable. |
| Production | POST /console/deployments/ | Creates a governed deployment. |

## Step 1: Create a development workload

Create a workload with an inline artifact. The artifact is created with `status=draft` by default, allowing iteration.

## Step 2: Iterate on the artifact

During development, update the artifact and restart the workload to test changes.

### 2a. Update artifact (partial update with PATCH)

Use `PATCH` to update specific metadata fields (for example, name or description) while keeping others unchanged.

### 2b. Replace entire artifact (full update with PUT)

Use `PUT` to replace the full artifact definition, including the container spec. For changes to the container specification (image, entrypoint, probes, and so on), `PUT` is required; `PATCH` does not support full artifact updates.

### 2c. Restart workload to apply changes

```
# Stop the workload
curl -X POST "${DATAROBOT_ENDPOINT}/console/workloads/${WORKLOAD_ID}/stop" \
  -H "Authorization: Bearer ${DATAROBOT_API_TOKEN}"

# Wait a few seconds, then start
curl -X POST "${DATAROBOT_ENDPOINT}/console/workloads/${WORKLOAD_ID}/start" \
  -H "Authorization: Bearer ${DATAROBOT_API_TOKEN}"
```

## Step 3: Lock artifact for production

When ready for production, change the artifact status from draft to registered:

```
curl -X PATCH "${DATAROBOT_ENDPOINT}/registry/artifacts/${ARTIFACT_ID}" \
  -H "Authorization: Bearer ${DATAROBOT_API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"status": "registered"}'
```

> [!NOTE] Immutability
> Once registered, the artifact's container specification is locked and cannot be modified.

## Step 4: Create production deployment

Create a governed deployment using the `WORKLOAD_ID` from Step 1.

## Key concepts

| Concept | Description |
| --- | --- |
| Draft artifact | Mutable; can be updated during development. |
| Registered artifact | Immutable, locked for production use. |
| Workload | Runtime instance of containers for development or testing. |
| Deployment | Production-grade workload with governance and audit trails. |
