Start ComfyUI Task 2 - Advanced
POST
/task/openapi/create
Start ComfyUI Task (Advanced)
By specifying
nodeInfoList
, you can dynamically override node parameters, making your task highly flexible and programmable.Endpoint
POST https://www.runninghub.ai/task/openapi/create
Method
POST
with application/json
bodyRequest Headers
Header | Required | Example | Description |
---|---|---|---|
Host | Yes | www.runninghub.ai | Your API domain (must be exact) |
Content-Type | Yes | application/json | Request content type |
⚠️ Note: The Host
header is mandatory and must matchwww.runninghub.ai
. It may be automatically included by some HTTP clients, but be sure to double-check.
Request Parameters
Required Parameters
Name | Type | Required | Description |
---|---|---|---|
apiKey | string | Yes | Your API key used for authentication |
workflowId | string | Yes | Workflow template ID, exportable from the UI |
nodeInfoList | array | No | List of node parameters to override before task execution |
nodeInfoList Structure
Field | Type | Description |
---|---|---|
nodeId | string | Unique ID of the node, from the exported workflow JSON |
fieldName | string | Field name to override (e.g., text , seed , steps ) |
fieldValue | any | New value for the field, should match the expected type |
Example Request
{
"apiKey": "your-api-key",
"workflowId": "1904136902449209346",
"nodeInfoList": [
{
"nodeId": "6",
"fieldName": "text",
"fieldValue": "1 girl in classroom"
},
{
"nodeId": "3",
"fieldName": "seed",
"fieldValue": "1231231"
}
]
}
Optional Parameters
Name | Type | Default | Description |
---|---|---|---|
addMetadata | boolean | true | Whether to embed prompt metadata in the image |
webhookUrl | string | - | Optional callback URL to receive result notifications |
workflow | string | - | Custom full workflow in JSON string format. If provided, it overrides workflowId |
instanceType | string | - | Specify the instance type when starting a task |
instanceType Usage Instructions
instanceType
parameter. For example:"instanceType": "plus"
About webhookUrl
(Advanced Use)
webhookUrl
parameter. For example:"webhookUrl": "https://your-webhook-url"
⚠️ Recommended for backend developers only.
POST
request to your URL with the following payload:{
"event": "TASK_END",
"taskId": "1904163390028185602",
"eventData": "{\"code\":0,\"msg\":\"success\",\"data\":[{\"fileUrl\":\"https://rh-images.xiaoyaoyou.com/de0db6f2564c8697b07df55a77f07be9/output/ComfyUI_00033_hpgko_1742822929.png\",\"fileType\":\"png\",\"taskCostTime\":0,\"nodeId\":\"9\"}]}"
}
event
: Callback event name. Currently always TASK_END
taskId
: ID of the completed taskeventData
: Same structure as the Check Task Output API⚠️ Important: Your webhook handler must process the request asynchronously.
RunningHub expects a fast response — long blocking logic may trigger retries due to timeout.
Response
Successful Response
{
"code": 0,
"msg": "success",
"data": {
"netWssUrl": null,
"taskId": "1910246754753896450",
"clientId": "e825290b08ca2015b8f62f0bbdb5f5f6",
"taskStatus": "QUEUED",
"promptTips": "{\"result\": true, \"error\": null, \"outputs_to_execute\": [\"9\"], \"node_errors\": {}}"
}
}
Response Fields
Field | Type | Description |
---|---|---|
code | int | Response code, 0 means success |
msg | string | Response message, usually "success" |
data | object | Task result data (see below) |
data Subfields
Field | Type | Description |
---|---|---|
taskId | string | Task ID, used for querying status or result |
taskStatus | string | Initial task status: QUEUED , RUNNING , or FAILED |
clientId | string | Internal tracking ID for debugging (not required for users) |
netWssUrl | string | WebSocket URL for real-time updates (not recommended currently) |
promptTips | string | JSON-formatted string showing ComfyUI validation messages or errors |
Best Practices
nodeId
and fieldName
before sending the requestpromptTips
to identify invalid or misconfigured nodeswebhookUrl
if you want real-time results pushed to your backendnetWssUrl
as it's currently unstable; use polling endpoints insteadRelated APIs
Request
Header Params
Host
string
required
Example:
www.runninghub.ai
Body Params application/json
Request samples
Responses
Modified at 2025-06-13 06:34:52