---
title: "Publish a workflow file"
method: POST
path: "/api/userdata/{file}/publish"
tags: ["workflows"]
---

# Publish a workflow file

`POST /api/userdata/{file}/publish`

Creates a new published_workflow record from the latest version and snapshots the provided assets.

## Path parameters

- `file` string, required

## Request body

- PublishWorkflowAssetsRequest — Request body for publishing workflow assets to the Hub.
  - `asset_ids` string[], required — IDs of assets (inputs and models) to snapshot.

## Response `200`

Workflow published

- WorkflowPublishInfo — Publishing metadata for a workflow shared to the Hub.
  - `assets` AssetInfo[], required — Published assets (inputs and models).
    - `id` string, required — Asset identifier.
    - `in_library` boolean, required — Whether the caller already owns this asset.
    - `model` boolean, required — Whether this asset is a model.
    - `name` string, required
    - `preview_url` string, required — Signed URL for previewing the asset.
    - `public` boolean, required — Whether this is a public (platform-provided) asset.
    - `storage_url` string, required
  - `listed` boolean, required
  - `publish_time` string, date-time, nullable
  - `share_id` string, required
  - `workflow_id` string, required

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Workflow not found
- `500` — Internal server error

## Changes

- **2026-06-03** `8560879e6188` — 3 breaking, 1 warning, 13 info
  - added required request body
  - removed the required property `error` from the response with the `401` status
  - removed the required property `error` from the response with the `404` status
  - removed the optional property `url` from the response with the `200` status
  - …13 more
- **2026-05-22** `09a5075587c8` — 3 info
  - api operation id `publishUserdataFile` removed and replaced with `postUserdataFilePublish`
  - added the non-success response with the status `400`
  - 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/userdata/:file/publish/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/8af4304e9fb0/schema)
