Nodes/comfy-workflow-api/Workflow API Receiver
ComfyUI Node

Workflow API Receiver

The Node That Turns an HTTP Request Into a Run, Not a GUI Click

By isala404·Created 8 months ago·Updated 7 months ago· 2
Workflow API Receiver
    • webhook_context
    default_callback_url
    default_timeout60
    default_max_retries3
    debugfalse

    WebhookReceiver is the door. It's the first node in any workflow this pack runs, and its whole job is to turn an incoming HTTP request into a WEBHOOK_CONTEXT object that the rest of the graph reads from. On its own it produces nothing visible - no image, no number, no output you can grab - but without it, the pack's other two nodes (WebhookTransformer and WebhookSend) have nothing to work with.

    The idea behind the whole pack is running ComfyUI as a headless service. Someone POSTs a workflow to your instance along with a callback_url, and this node is what receives the configuration from that request and hands it downstream.

    How it works

    At startup the pack registers POST /api/webhook on ComfyUI's own server (port 8188 by default). When a request arrives, the route validates the workflow, stashes everything it needs into the request's hidden extra_pnginfo - the callback URL, auth header and value, timeout, retry count, plus every custom field and uploaded file - and queues the workflow. When execution reaches this node, it reads all of that back out and builds the context that the rest of the graph consumes.

    One detail that matters: the node deliberately never caches. Its IS_CHANGED returns a fresh value on every call, so a second identical request actually runs again instead of being treated as "already did this." For a webhook endpoint, that's the difference between working and silently serving stale results.

    Inputs and outputs that matter

    There are no required inputs. Everything is optional, and everything is a fallback - values from the request win, and these only kick in when the caller didn't supply them:

    • default_callback_url - where WebhookSend ships results if the request had none.
    • default_timeout - HTTP timeout in seconds (1–300, default 60) for those deliveries.
    • default_max_retries - retry attempts on failure (0–10, default 3).
    • debug - prints a full request summary: remote IP, request ID, content type, size, and every field with its type and size.

    The single output, webhook_context, is a WEBHOOK_CONTEXT type that wires only into the other webhook nodes. That's fine - that's the point.

    Installation

    It's one of three nodes in the comfy-workflow-api pack, so you install the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/isala404/comfy-workflow-api
    pip install -r comfy-workflow-api/requirements.txt
    

    Restart ComfyUI, or install through ComfyUI Manager by searching "comfy-workflow-api". The only hard dependency is aiohttp; audio/video features want av. No model downloads, no heavy installs.

    Common issues

    If a request arrives but nothing downstream gets the fields you expect, turn debug on first. The printed summary lists every field the request actually carried, so you'll spot the mismatch instantly.

    Also, this node does exactly nothing on its own. A receiver with nothing after it is a workflow that runs and then quietly stops. And if you run it from the canvas by hand with no API request behind it, you get an empty context with just your fallback settings - handy for testing the plumbing, useless for anything real.

    One security note that applies to the whole pack, and this is the node that opens the door: /api/webhook is unauthenticated, like ComfyUI's default API. Anyone who can reach your ComfyUI port can submit workflows through it - and custom nodes in general execute arbitrary Python at full user-level access when installed. Don't expose that port to the public internet without a reverse proxy and auth in front of it.

    Categorywebhook

    Inputs (4)

    NameTypeDefaultDescription
    default_callback_urloptSTRINGFallback callback URL if not provided in request
    default_timeoutoptINT601–300HTTP request timeout in seconds
    default_max_retriesoptINT30–10Number of retry attempts on failure
    debugoptBOOLEANfalseEnable debug logging

    Outputs (1)

    NameTypeDescription
    webhook_contextWEBHOOK_CONTEXT