> ## Documentation Index
> Fetch the complete documentation index at: https://support.myapps.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflows & deployments

> Versions, deployments, and shipping graph changes without breaking production

Four ideas, and the relationship between them is the whole model:

```
Workflow  →  Workflow version  →  Deployment  →  Run
(the graph)   (a saved revision)   (callable)     (one execution)
```

| Term                 | Identified by         | What it is                    |
| -------------------- | --------------------- | ----------------------------- |
| **Workflow**         | `workflow_id`         | Your ComfyUI graph            |
| **Workflow version** | `workflow_version_id` | A specific saved revision     |
| **Deployment**       | `deployment_id`       | A version exposed to the API  |
| **Run**              | `run_id`              | One execution of a deployment |

## Why versions matter

**Your code calls a deployment, not a workflow.** Editing your graph in ComfyUI changes nothing about what your API calls do until you deploy the new version.

That's the safety property worth internalizing:

* Experiment freely — production keeps running the deployed version
* Ship deliberately — deploying is the moment behavior changes
* Roll back by pointing at the previous version

<Warning>
  The corollary catches people out: **saving your workflow does not update your API.** If a fix isn't showing up in runs, check that you deployed it.
</Warning>

## Inputs are a contract

Your graph's input nodes define what callers must send. The `inputs` object in a run request maps to those names:

```json theme={null}
{
  "deployment_id": "your-deployment-id",
  "inputs": {
    "input_text": "a lighthouse at dusk",
    "input_image": "https://example.com/reference.png"
  }
}
```

Renaming or removing an input node is a **breaking change** for every caller. Treat input names as a public API:

* **Adding** an optional input is safe
* **Renaming** one breaks existing callers
* **Removing** one breaks existing callers
* **Changing the type** breaks them quietly, which is worse

<Tip>
  Need to change inputs incompatibly? Deploy it as a new deployment and migrate callers over, rather than mutating the one in production.
</Tip>

## Inspecting a version

`GET /workflow-version/{version_id}` returns a version's detail — useful when a run behaved unexpectedly and you want to confirm which revision actually executed. Every run records its `workflow_version_id`, so you can always trace a result back to the exact graph that produced it.

## Machines

Runs execute on a **machine**, recorded as `machine_id` on the run. Two runs of the same deployment on different machines should behave identically — if they don't, the machine is where to look, and the `machine_id` is what to report.

## Run origin

Every run records where it came from:

| Origin         | Means                        |
| -------------- | ---------------------------- |
| `manual`       | Triggered by hand            |
| `api`          | Triggered through the API    |
| `public-share` | Triggered via a public share |

Useful for separating your own testing from real traffic when you're reviewing history.

## Practical workflow

<Steps>
  <Step title="Build and test by hand">
    Get the graph right in ComfyUI first. Debugging a graph through API calls is slow.
  </Step>

  <Step title="Name your inputs deliberately">
    They're a contract. `input_image` beats `image2`.
  </Step>

  <Step title="Deploy">
    Note the `deployment_id`. That's what your code stores.
  </Step>

  <Step title="Call it once by hand">
    Confirm one run end to end before wiring it into anything.
  </Step>

  <Step title="Version forward">
    For breaking changes, deploy alongside and migrate — don't mutate what's live.
  </Step>
</Steps>
