> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Check that a definition installs every node a workflow uses

> Compares a workflow with a definition the caller supplies, before any build exists or before one is saved, and writes nothing. Each distinct node class is attributed to a pack exactly as POST /v1/workflows/resolve attributes it, then that pack is looked for in the definition's `customNodes` by the source each entry installs from: a registry version by its registry id, a repository by that repository. Built-in, partner and canvas classes install nothing and are left out.

A class is `missing` only when the registry names its pack and the definition plainly lacks it. A class that cannot be decided either way is `unverified` with a reason, never counted as covered: nothing attributes it to a pack, the registry did not answer, the pack is pinned to a version other than the registry's latest (or to a git ref or commit) so nothing shows that version has the class, the entry with the pack's id installs from another repository, only the workflow file's own stamp attributes the class to the pack, or the pack may be an uploaded file. `complete` is true only when nothing is missing or unverified, so an unreachable registry never reads as an all-clear.

A 400 carries the identifier a caller branches on: `INVALID_REQUEST` when the workflow or the definition is absent, `INVALID_WORKFLOW` when the payload is not a workflow or holds no nodes, `WORKFLOW_TOO_LARGE` when it names more node classes than one import may carry, and `INVALID_DEFINITION` when `customNodes` cannot be read as nodes.




## OpenAPI

````yaml /openapi-builder.yaml post /v1/workflows/validate
openapi: 3.0.3
info:
  title: Comfy Builder API
  version: 0.1.0
  description: >
    Builder owns builds (editable environment definitions) and cuts immutable,
    deployable releases that Deploy later runs.
servers:
  - url: https://platformapi.comfy.org/builder
    description: Comfy Developer Platform
security:
  - BearerAuth: []
  - ApiKeyAuth: []
paths:
  /v1/workflows/validate:
    post:
      summary: Check that a definition installs every node a workflow uses
      description: >
        Compares a workflow with a definition the caller supplies, before any
        build exists or before one is saved, and writes nothing. Each distinct
        node class is attributed to a pack exactly as POST /v1/workflows/resolve
        attributes it, then that pack is looked for in the definition's
        `customNodes` by the source each entry installs from: a registry version
        by its registry id, a repository by that repository. Built-in, partner
        and canvas classes install nothing and are left out.


        A class is `missing` only when the registry names its pack and the
        definition plainly lacks it. A class that cannot be decided either way
        is `unverified` with a reason, never counted as covered: nothing
        attributes it to a pack, the registry did not answer, the pack is pinned
        to a version other than the registry's latest (or to a git ref or
        commit) so nothing shows that version has the class, the entry with the
        pack's id installs from another repository, only the workflow file's own
        stamp attributes the class to the pack, or the pack may be an uploaded
        file. `complete` is true only when nothing is missing or unverified, so
        an unreachable registry never reads as an all-clear.


        A 400 carries the identifier a caller branches on: `INVALID_REQUEST`
        when the workflow or the definition is absent, `INVALID_WORKFLOW` when
        the payload is not a workflow or holds no nodes, `WORKFLOW_TOO_LARGE`
        when it names more node classes than one import may carry, and
        `INVALID_DEFINITION` when `customNodes` cannot be read as nodes.
      operationId: validateWorkflow
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowValidateRequest'
      responses:
        '200':
          description: >
            The comparison. Missing or unverified classes are the normal outcome
            of a definition that is not finished, not a failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowCoverage'
        '400':
          $ref: '#/components/responses/BadRequest'
components:
  schemas:
    WorkflowValidateRequest:
      type: object
      required:
        - workflow
        - definition
      properties:
        workflow:
          $ref: '#/components/schemas/ComfyWorkflow'
        definition:
          $ref: '#/components/schemas/Definition'
    WorkflowCoverage:
      type: object
      description: >
        Which of a workflow's custom node classes a definition installs. Every
        such class is counted in `covered`, listed under one pack in `missing`,
        or listed in `unverified`, exactly once.
      required:
        - format
        - complete
        - covered
        - missing
        - unverified
      properties:
        format:
          type: string
          description: >-
            Which export dialect the file was read as, `api` or `ui` (the same
            values as WorkflowResolveResult's `format`).
        complete:
          type: boolean
          description: >
            True only when the definition provably installs every custom class:
            nothing missing and nothing unverified. Not a statement about
            models, Python packages or partner access.
        covered:
          type: integer
          description: How many distinct custom classes the definition provides.
        missing:
          type: array
          description: The packs to add, sorted by `packId`.
          items:
            $ref: '#/components/schemas/WorkflowMissingPack'
        unverified:
          type: array
          description: The classes nothing could decide, sorted by `classType`.
          items:
            $ref: '#/components/schemas/WorkflowUnverifiedClass'
    ComfyWorkflow:
      type: object
      description: >
        A ComfyUI workflow, in either export dialect. The API format is a flat
        object of node id to node, each carrying `class_type` and its values
        under `inputs`. The UI format carries a `nodes` array with positional
        `widgets_values` alongside a `links` array, which is what identifies it,
        and may hold reusable groups under `definitions.subgraphs` that are
        expanded when read.


        Read rather than validated field by field: the node classes and model
        filenames are taken out, and everything else is ignored. A payload that
        matches neither dialect is a 400.
      additionalProperties: true
    Definition:
      type: object
      description: >
        The user's environment choices (nodes, models, base version). Free-form
        for MVP, except that a field named like a known one in another case
        (customnodes for customNodes) is rejected: create and update refuse one
        they bring in, and check and cut refuse it wherever it sits. A public
        custom node declares an https github.com repository URL plus an optional
        gitRef (absent means the default branch); a private one references an
        uploaded blobId; exactly one of the two per node. A model declares a
        type (the ComfyUI model folder it lands in, e.g. checkpoints, loras,
        vae) plus exactly one source, a public sourceUri (https) or a private
        blobId, and an optional filename and sha256; the built release records
        each model so it can be placed at deploy time (models are not baked into
        the image). A CivitAI sourceUri is saved without its token query
        parameter and any user:password@ part, since a deployment downloads
        CivitAI links with the platform's own token, so a saved definition can
        read back without them. A CivitAI sourceUri (civitai.com or civitai.red,
        with or without www.) should be a download link
        (https://civitai.com/api/download/models/<versionId>) or a model page
        link (https://civitai.com/models/<modelId>), since a deployment can
        download no other CivitAI link: create and update warn on any other, and
        check and cut refuse it. An optional baseImage names the curated base
        image (the CUDA/Python/torch runtime the build is built on) by id;
        omitted means the default, and an unrecognized id is rejected (only
        images we build are selectable, never an arbitrary ref). pipDependencies
        is a requirements.txt string (one requirement per line). A version pin
        (`numpy<2.5`) is applied as an override in the single dependency
        resolution, so it beats every other declaration of that package; it
        forces a version rather than adding a package, so use it to correct
        versions your nodes already bring in, and the build warns about a pin
        nothing else requires. A direct reference to an https wheel (`nunchaku @
        https://host/nunchaku-1.0.1-cp311-cp311-linux_x86_64.whl`) is instead a
        root of the resolution and adds that package, which is how an engine
        published only as a wheel outside PyPI gets in; an optional `#sha256=`
        fragment on the address is verified at install. Local paths, file: URLs,
        git+ references and addresses carrying credentials are dropped with a
        warning, and so is an address for a package a version pin in the same
        blob also names, whatever markers either line carries, because the pin
        would replace the address in the resolution. modelPolicy,
        partnerNodePolicy and customNodePolicy are allow/deny lists for which
        models, partner nodes and custom nodes the build permits: each is an
        object with a mode of "allowlist" (allow only the list) or "blocklist"
        (allow all except the list) plus a list of string ids. An optional
        uiOrigin string records which client flow authored the definition; the
        platform currently writes "desktop-snapshot" or "comfyui-bundle". It is
        attribution only: stored and read back as sent, never validated, and it
        changes nothing about the build (the worker reports it, truncated to 64
        characters, as ui_origin on its build analytics events).
      additionalProperties: true
    WorkflowMissingPack:
      type: object
      description: >-
        A pack the registry names for the workflow's classes and the definition
        lacks.
      required:
        - packId
        - classes
      properties:
        packId:
          type: string
          description: >-
            The registry id, or the clone URL for a pack the registry does not
            publish.
        name:
          type: string
        repository:
          type: string
        latestVersion:
          type: string
          description: >-
            The registry's newest published version, the one known to carry
            these classes.
        classes:
          type: array
          description: The workflow's classes this pack provides, sorted.
          items:
            type: string
    WorkflowUnverifiedClass:
      type: object
      required:
        - classType
        - reason
      properties:
        classType:
          type: string
        reason:
          type: string
          enum:
            - unknownClass
            - lookupFailed
            - pinnedVersion
            - otherRepository
            - stampOnly
            - uploadedPack
            - unmatchedUpload
          description: >
            unknownClass: nothing attributes the class to a pack. lookupFailed:
            the registry did not answer for its pack. pinnedVersion: the pack is
            in the definition at a registry version other than the latest, or at
            a git ref or commit. otherRepository: an entry carries the pack's
            registry id but installs from a different repository, such as a
            fork. stampOnly: the pack is in the definition, but only the pack
            the workflow file stamped on the class, or for a class with no
            registry stamp the registry's class index, attributes the class to
            it, so the pack may no longer ship it. uploadedPack: the pack is in
            the definition as an uploaded file. unmatchedUpload: the pack is
            absent by id and repository, but the definition holds an upload that
            may be it.
        packId:
          type: string
          description: The pack the class is attributed to, when one is known.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable detail.
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        A workspace-scoped Cloud JWT. A missing or invalid token is 401
        UNAUTHORIZED in the Error body.
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >
        A workspace API key, sent alone. The service checks it on every request
        and acts as the key's user in the key's workspace. A request carrying a
        key and a Bearer token is 400 INVALID_REQUEST, and a value that is not a
        key's shape is 401 UNAUTHORIZED. A refused key answers 401
        (UNAUTHORIZED), 403 (FORBIDDEN), 404 (NOT_FOUND) or 429 (RATE_LIMITED)
        with its message and Retry-After; a 503 (SERVICE_UNAVAILABLE) means the
        key could not be checked right now, so retry. Each refusal answers the
        Error body.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.