Skip to content

Commit 413e250

Browse files
authored
spec: add workflow_id / workflow_version_id to PromptRequest with x-runtime tag (#13709)
Adds two optional, nullable UUID fields to PromptRequest for runtimes that wrap workflow execution in a workflow-version entity (the hosted-cloud runtime does this; local ComfyUI does not). Both fields are tagged `x-runtime: [cloud]` to mark them as runtime-specific — local ComfyUI returns `null` (or omits them entirely) and that's correct behavior, not drift. ## Why these fields belong in the OSS spec Hosted-cloud's frontend and backend share `openapi.yaml` as their single source of truth via auto-generated client types. Without the fields declared in the spec, the cloud runtime has to either: 1. Hand-edit a vendored copy of openapi.yaml (drift between vendor and upstream — unsustainable). 2. Maintain a separate cloud-only spec file (forks the contract, defeats the point of a shared OSS spec). Both options have been tried and both produce maintenance pain. The shape that scales is: cloud-only fields live in OSS spec under their intended path, declared nullable, with an explicit `x-runtime` tag so local-only readers can ignore them programmatically and human readers can see what each runtime populates. ## About the `x-runtime` extension This is the first use of `x-runtime` in this spec. Convention: - `x-runtime: [cloud]` — only the hosted-cloud runtime populates the field; local returns null or omits. - `x-runtime: [local]` — only local populates; cloud returns null. - Tag absent — both runtimes populate the field (the default). This is a vendor extension (`x-` prefix) and is ignored by spec validators that don't recognize it, including `kin-openapi`. Local clients reading the spec see two extra optional nullable fields, which is forward-compatible with all existing readers. ## What this does not change - No Python code changes. `PromptRequest` already accepts arbitrary optional fields (`extra_data: additionalProperties: true` on the same schema is a stronger guarantee). The Python server already silently accepts and ignores both fields today. - No required-fields change. Both fields stay outside `required`, so older clients that don't know about them keep validating. - No nullability widening on existing fields. ## Verification - YAML parses (`yaml.safe_load`). - `kin-openapi` `loader.LoadFromFile` accepts the modified spec. - `openapi3filter.ValidateRequest` on a PromptRequest with both fields set to `null`, set to a valid UUID, or omitted — all pass.
1 parent 35819e3 commit 413e250

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

openapi.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,6 +1999,26 @@ components:
19991999
items:
20002000
type: string
20012001
description: List of node IDs to execute (partial graph execution)
2002+
workflow_id:
2003+
type: string
2004+
format: uuid
2005+
nullable: true
2006+
x-runtime: [cloud]
2007+
description: |
2008+
UUID identifying a hosted-cloud workflow entity to associate with this
2009+
job. Local ComfyUI doesn't track workflow entities and returns `null`
2010+
(or omits the field). The `x-runtime: [cloud]` extension marks this
2011+
as populated only by the hosted-cloud runtime; absence of the tag
2012+
means a field is populated by all runtimes.
2013+
workflow_version_id:
2014+
type: string
2015+
format: uuid
2016+
nullable: true
2017+
x-runtime: [cloud]
2018+
description: |
2019+
UUID identifying a hosted-cloud workflow version to associate with
2020+
this job. Local ComfyUI returns `null` (or omits the field). See
2021+
`workflow_id` above for `x-runtime` semantics.
20022022
20032023
PromptResponse:
20042024
type: object

0 commit comments

Comments
 (0)