Node-RED http request node: submit a Sume job and branch on statusCode
Node-RED's http request node returns payload, statusCode and headers. Wire a Sume submit, branch on 202 vs errors, and keep the job id for the status read.

The answer
Node-RED's http request node sends the request described by msg.url, msg.method, msg.headers and msg.payload, and puts the response body in msg.payload with msg.statusCode and msg.headers beside it. For a Sume submit, set method to POST, send a JSON payload with mode: async, and branch on msg.statusCode before reading the job id from the body.
The node help also says it can parse the body as JSON and that the status code field holds the error code if the request could not be completed, so a check on that field covers both HTTP errors and network failures.
What the node reads and writes
These are the properties from the node's own help text that matter for a Sume call.
| Property | Direction | Use |
|---|---|---|
| msg.url | Input | https://api.sume.com/v1/images |
| msg.method | Input | POST (must be GET, PUT, POST, PATCH or DELETE) |
| msg.headers | Input | Content-Type and Idempotency-Key |
| msg.payload | Input and output | Request body; then the response body |
| msg.statusCode | Output | HTTP status, or an error code |
| msg.requestTimeout | Input | Milliseconds; overrides the global request timeout |
Build the message
A function node ahead of the request builds the message. Keep the Idempotency-Key derived from your own record id so a replayed flow sends the same key.
msg.url = "https://api.sume.com/v1/images";
msg.method = "POST";
msg.headers = {
"content-type": "application/json",
"idempotency-key": "order-" + msg.orderId + "-r1",
};
msg.payload = {
model: "sume/auto",
mode: "async",
prompt: msg.prompt,
};
return msg;Branch and keep the id
Sume documents 202 or 200 for an accepted submit, then 401, 402, 429 and 5xx for the failures. A switch node on msg.statusCode can send accepted responses on and everything else to an alert. On the accepted branch, the job id is in the parsed body under data.request_id; store it in flow context along with the order id.
The status read is a second http request node with method GET and the url https://api.sume.com/v1/jobs/<id>/status. Poll on the terminal boolean and the next_poll_after_seconds hint; fetch the result only when result_ready is true.
Where the key goes
The Authorization header is the next post's subject, because Node-RED's help text sets a precedence rule between the node configuration and msg.headers that decides where the key belongs. Read it before you put a credential in a message.
Timeouts and the 30-second wait
The node help says requestTimeout, in milliseconds, overrides the globally configured HTTP request timeout. Sume's server-side sync wait is clamped to 30 seconds and bounds how long the request blocks, not how long the job runs. With async submits the call returns quickly, so a timeout of ten to fifteen seconds on the submit node is plenty, and the long wait lives in your polling flow instead.
If a submit times out on your side, the job may still have been created. Resend with the same Idempotency-Key and the same payload; Sume returns the original job instead of billing again. A different key creates a second paid job.
Polling inside a flow
A common layout is an inject node on a timer feeding a function node that reads the stored job ids from context, then an http request node for each status read. Use the next_poll_after_seconds value from the previous response to decide whether to skip a tick. When terminal is true, route the message to a result-fetch node if result_ready is true, and to an error branch otherwise.
Keep the total deadline on your side. Sume's docs suggest around twenty minutes for video as a reasonable client-side limit, and note that giving up does not cancel the job; cancel explicitly while it is cancelable if you want it to stop.
Sources
Related posts
More in Developers
- og:image width, height and alt tags for an AI image from Sume
Open Graph has optional og:image:width, og:image:height and og:image:alt. Read the real size from a Sume render with Pillow and print all three tags.
- One reference image on Seedance 2.5 is not a first frame
On /v1/videos, input_references steer a generation; frame_images pin frames. Send one image the wrong way and the clip does not start on your picture.
- One request for four Sume video models: 1080p, 5 to 10 s, 16:9 or 9:16
Kling 3, Wan 3.0, H3 Max and Omni share one request shape: 1080p, 5 to 10 seconds, 16:9 or 9:16. Compute the intersection in Python and price each model.
- OpenAI Agents SDK client_session_timeout_seconds with Sume jobs_wait
In the OpenAI Agents SDK for Python, client_session_timeout_seconds sets the MCP read timeout. Set it above Sume's 55-second jobs_wait cap, or 0 to disable it.
Written by Sume