---
title: "Create a new version"
method: POST
path: "/api/workflows/{workflow_id}/versions"
tags: ["workflows"]
---

# Create a new version

`POST /api/workflows/{workflow_id}/versions`

Creates a new workflow version with updated workflow JSON. Uses optimistic concurrency via base_version.

## Path parameters

- `workflow_id` string, required

## Request body

- CreateWorkflowVersionRequest — Request body for creating a new version of a saved workflow.
  - `base_version` integer, required — The version number this change is based on (for optimistic concurrency)
  - `workflow_json` object, required — The updated ComfyUI workflow JSON

## Response `201`

Version created successfully

- WorkflowVersionResponse — Metadata for a single workflow version.
  - `created_at` string, date-time, required
  - `created_by` string, required
  - `id` string, required
  - `latest_version` integer, required
  - `version` integer, required

## Other responses

- `401` — Unauthorized
- `403` — Forbidden - not the workflow owner
- `404` — Workflow not found
- `409` — Version conflict - base_version does not match latest
- `422` — Validation error
- `500` — Internal server error

## Changes

> 38 revisions in range; 2 could not be searched.

- **2026-06-03** `8560879e6188` — 4 breaking, 11 info
  - removed the required property `error` from the response with the `401` status
  - removed the required property `error` from the response with the `403` status
  - removed the required property `error` from the response with the `404` status
  - removed the required property `error` from the response with the `409` status
  - …11 more
- **2026-05-22** `09a5075587c8` — 3 info
  - api operation id `createCloudWorkflowVersion` removed and replaced with `createWorkflowVersion`
  - added the non-success response with the status `422`
  - added the non-success response with the status `500`
- **2026-05-08** `c9640fded659` — 1 info
  - endpoint added
- **2026-04-24** `a66055fa384e` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/comfy-org/apis/comfyui-api/changes/api/workflows/:workflow_id/versions/post.md)

---

[API](https://skmtc.dev/comfy-org/apis/comfyui-api.md) · [All operations](https://skmtc.dev/comfy-org/apis/comfyui-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/comfy-org/comfyui-api/revisions/da017caf56f1/schema)
