Skip to main content

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, optional credentials_id)
  • inputs: request payload (url, method, query_params, headers, body)
  • url is required in inputs

Request body (inputs.body)​

body.typeBehavior
jsonJSON body; Content-Type: application/json
form_dataapplication/x-www-form-urlencoded from content key/value map
multipartmultipart/form-data with auto-generated boundary (do not set Content-Type in headers)
rawRaw string; optional content_type
fileSingle 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), optional filename, optional content_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_ms is the per-attempt timeout. It defaults to 30000 when missing, non-numeric or <= 0, and is capped at 300000 (5 minutes).
  • retry_config.max_attempts is the number of retries after the first attempt (2 means up to three attempts); retry_config.backoff_ms (default 1000) 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 on response.status_code for status-based retries.
  • To avoid duplicate side effects, GET, HEAD, OPTIONS, TRACE, PUT and DELETE are always retried, but other methods (POST, PATCH) are retried only when the request has an Idempotency-Key or X-Idempotency-Key header, or when the error shows the request never left the gateway (DNS or connection-dial failure). A POST that 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.attempts reports 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.
  • success when request completes as expected.
  • error for 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-Type manually for multipart — the engine must set the boundary; duplicate or wrong Content-Type breaks the request.
  • Confusing Form (URL-encoded) (form_data) with multipart — only multipart sends multipart/form-data with separate parts and file fields.