HTTP Request Node
Performs an outbound HTTP call and branches on success/error.
Config vs inputs (code-grounded)
config: transport/runtime settings (timeout_ms,retry_config, optionalcredentials_id)inputs: request payload (url,method,query_params,headers,body)urlis required ininputs
Request body (inputs.body)
body.type | Behavior |
|---|---|
json | JSON body; Content-Type: application/json |
form_data | application/x-www-form-urlencoded from content key/value map |
multipart | multipart/form-data with auto-generated boundary (do not set Content-Type in headers) |
raw | Raw string; optional content_type |
file | Single binary body from base64 content.file and content.content_type |
Multipart (body.type: multipart)
body.content is an array of parts (or { "parts": [ ... ] } — same shape the engine accepts). Each part is an object:
- Text field:
name,part_type:"text",value(string; expressions allowed at runtime like other inputs). - File field:
name,part_type:"file",file(standard base64, no data-URL prefix), optionalfilename, optionalcontent_type.
File payloads are buffered in memory (same model as the existing single-file body mode). Very large uploads should use presigned object storage or another integration path.
Timeout and retries
timeout_msis the per-attempt timeout. It defaults to30000when missing, non-numeric or<= 0, and is capped at300000(5 minutes).retry_config.max_attemptsis the number of retries after the first attempt (2means up to three attempts);retry_config.backoff_ms(default1000) is the fixed wait between attempts.- Retries happen only when no response was received (connection, DNS or timeout errors). Any HTTP response, including
5xx, ends the loop; branch onresponse.status_codefor status-based retries. - To avoid duplicate side effects,
GET,HEAD,OPTIONS,TRACE,PUTandDELETEare always retried, but other methods (POST,PATCH) are retried only when the request has anIdempotency-KeyorX-Idempotency-Keyheader, or when the error shows the request never left the gateway (DNS or connection-dial failure). APOSTthat timed out after it was sent is not retried. - Every attempt sends the same body and the same applied credentials. When retries are configured,
response.attemptsreports how many attempts were made.
Credentials
With credentials_id set, the node applies the credential (API key header or query parameter, basic auth, OAuth2 client credentials, or mTLS client certificate) before sending. If the credential cannot be found, loaded or decrypted, its client certificate has expired, or the OAuth2 token endpoint fails or returns no access token, the node takes the error branch without sending the request. Error messages never include the request URL's query string, so an API key sent with key_in=query is not exposed.
Call depth
Every request carries X-Zerq-Call-Depth: one more than the depth of the run (1 for a run that no nested call started). When the request comes back to this gateway (a workflow calling a route of the same Zerq, possibly its own), the gateway continues the count, and a request beyond depth 10 is refused with 508 Loop Detected before its proxy or workflow runs, so a workflow that calls its own route stops after ten nested calls instead of looping. The count is shared with nested AI Gateway calls (LLM node), which stop at depth 3: a workflow reached through three or more nested gateway calls cannot call a model through the Zerq AI Gateway. A value set in the node's headers is replaced. Sub-workflows (Execute Workflow node) keep their own limit of 5 levels.
Unresolved values
A header, query parameter or array item whose expression resolves to nothing (missing field, null or undefined) is omitted instead of being sent as the literal <nil>. Unresolved form and multipart text values are sent as empty strings.
Outputs/branches
- Uses
matched_output. successwhen request completes as expected.errorfor request failures, timeout, transport errors, or credentials that could not be applied.
Example usage snippet
{
"id": "n_http",
"type": "http_request_node",
"config": {
"timeout_ms": 3000,
"retry_config": { "max_attempts": 2, "backoff_ms": 250 }
},
"inputs": {
"url": "https://api.partner.com/orders",
"method": "POST",
"headers": { "Content-Type": ["application/json"] },
"body": { "type": "json", "content": { "orderId": "o-123" } }
}
}
Multipart example (file part uses raw base64 in file; omit Content-Type in headers):
{
"inputs": {
"url": "https://api.partner.com/upload",
"method": "POST",
"body": {
"type": "multipart",
"content": [
{ "name": "title", "part_type": "text", "value": "Quarterly report" },
{
"name": "document",
"part_type": "file",
"file": "<base64-encoded-bytes>",
"filename": "report.pdf",
"content_type": "application/pdf"
}
]
}
}
}
Common pitfalls
- Missing timeout and causing long-running executions.
- Not masking sensitive headers in logs.
- Treating all non-2xx responses the same without branch-specific handling.
- Setting
Content-Typemanually formultipart— the engine must set the boundary; duplicate or wrongContent-Typebreaks the request. - Confusing Form (URL-encoded) (
form_data) with multipart — onlymultipartsendsmultipart/form-datawith separate parts and file fields.