Nodes/MKRShift_Nodes/HTTP Webhook Send
ComfyUI Node

HTTP Webhook Send

The half of the plan/send pair that actually talks to the network

By criskb·Created 7 months ago·Updated 5 months ago· 0
HTTP Webhook Send
    • response_json
    • status_code
    • summary_json
    http_plan_json{}
    payload_json{}

    MKRHTTPWebhookPlan describes a request; this is the node that actually makes it. Feed it a plan JSON, and it performs the HTTP call from inside the graph and hands you the parsed response - status code and body. It's the runtime half of MKRShift's plan/send pattern, and on its own it's a perfectly serviceable "POST this JSON to that URL" node for automation, host integrations, or calling local endpoints during a run.

    How it works

    Give it an http_plan_json (from the plan node, or hand-written), and it:

    1. Parses the plan - URL, method (POST/PUT/PATCH), headers, payload.
    2. Merges in an optional payload_json override - handy when you build one plan but want to fire it with different data each run.
    3. Makes the request with Python's standard-library urllib (no requests dependency, nothing extra to install), a 30-second timeout, and Content-Type: application/json set when there's a payload.
    4. Returns the response body parsed as JSON when possible, the HTTP status code, and a summary.

    Notably, this node doesn't fetch anything - no GET, consistent with its sibling plan node. It pushes.

    Inputs

    • http_plan_json - required. A bare {} won't crash, but it resolves to the default localhost URL, so you'll be POSTing to http://127.0.0.1:8188/mkrshift and getting whatever that endpoint returns (probably a 404 on a stock ComfyUI server).
    • payload_json - optional override for the payload baked into the plan.

    Outputs

    • response_json - the parsed response body. If the body isn't valid JSON, you get an object with ok, url, status, and a text field holding the raw body, plus a "response was not valid JSON" warning. So it never loses the body, it just tells you it couldn't parse it.
    • status_code - an actual INT, which is the whole point: wire it into logic to branch on success/failure. Non-2xx statuses don't throw; they come back as a status code plus an "http error N" warning.
    • summary_json - URL, method, status code, and any warnings from the plan, payload, and request.

    Installing it

    Part of the pack:

    # ComfyUI Manager: search "MKRShift Nodes", install, restart.
    # or:
    cd ComfyUI/custom_nodes
    git clone https://github.com/criskb/MKRShift_Nodes
    # restart ComfyUI
    

    No extra dependencies. urllib is in the standard library - this node adds nothing to your Python environment.

    Gotchas

    The status_code output is your first debugging tool: 0 means the request failed outright (connection refused, DNS, timeout - the error message lands in response_json.error and the summary warnings). A 4xx/5xx means the request went out and the server answered with a problem. And since this is a synchronous call with a 30-second timeout, a slow endpoint will hold your run - that's expected behavior, not a hang; it eventually returns the timeout as a failure. For anything calling a remote service, MKRHTTPWebhookPlan's readable plan format remains the right habit: build it, inspect it, then wire it in here. You always know exactly what's about to leave your machine.

    CategoryMKRShift Nodes/Addons/Network

    Inputs (2)

    NameTypeDefaultDescription
    http_plan_jsonSTRING{}
    payload_jsonoptSTRING{}

    Outputs (3)

    NameTypeDescription
    response_jsonSTRING
    status_codeINT
    summary_jsonSTRING