---
title: "Submit a workflow for execution"
method: POST
path: "/api/prompt"
tags: ["prompt"]
---

# Submit a workflow for execution

`POST /api/prompt`

Submits a workflow for execution. The server validates the graph, assigns a `prompt_id`, and enqueues it. Clients listen on `/ws` for execution progress and output messages.

## Request body

- PromptRequest — A workflow submission. Wraps the prompt graph plus optional client identifier and extra per-request data.
  - `prompt` object, required — The workflow graph to execute. Keys are node IDs (strings); values are objects with class_type and inputs.
  - `number` number — Priority number for the queue (lower numbers have higher priority)
  - `front` boolean — If true, adds the prompt to the front of the queue
  - `extra_data` object — Extra data associated with the prompt (e.g. extra_pnginfo)
  - `client_id` string — WebSocket client ID to receive progress updates
  - `prompt_id` string, uuid — Client-supplied prompt ID. Server generates a UUID if omitted.
  - `partial_execution_targets` string[] — List of node IDs to execute (partial graph execution)
  - `workflow_id` string, uuid, nullable — [cloud-only] Cloud workflow entity ID for tracking and gallery association. Ignored by local ComfyUI.
  - `workflow_version_id` string, uuid, nullable — [cloud-only] Cloud workflow version ID for pinning execution to a specific version. Ignored by local ComfyUI.

## Response `200`

Prompt accepted

- PromptResponse — Server acknowledgement of a workflow submission. Includes the assigned `prompt_id` and current queue position.
  - `prompt_id` string, uuid — Unique identifier for the prompt execution
  - `number` number — Priority number in the queue
  - `node_errors` object — Validation errors keyed by node ID
  - `error` union — Top-level prompt error (string message or structured error)
    - string
    - PromptError — Structured prompt validation error
      - `type` string
      - `message` string
      - `details` string

## Other responses

- `400` — Validation or node errors
- `402` — Payment required - Insufficient credits
- `429` — Payment required - User has not paid
- `500` — Internal server error
- `503` — Service unavailable

## Changes

- **2026-05-22** `09a5075587c8` — 4 info
  - added the non-success response with the status `402`
  - added the non-success response with the status `429`
  - added the non-success response with the status `500`
  - added the non-success response with the status `503`
- **2026-05-05** `fcd26f03f0ae` — 2 info
  - added the new optional request property `workflow_id`
  - added the new optional request property `workflow_version_id`
- **2026-04-24** `a66055fa384e` — 2 warning, 10 info
  - removed the request property `workflow_id`
  - removed the request property `workflow_version_id`
  - api tag `prompt` added
  - api tag `workflow` removed
  - …8 more

[Change history](https://skmtc.dev/comfy-org/apis/comfyui-api/changes/api/prompt/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/c4db9e1283df/schema)
