---
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

---

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