HTTP Request

This action sends an HTTP request to a specified endpoint with configurable method, body, and content type. It supports request batching when an array of objects (tabular data) is provided, allowing requests to be grouped to accommodate request or rate limits. The response, including status code and HTTP headers, is captured in the workflow pipeline and made available to subsequent actions.

Input Output
Any (JSON)
  • Any (JSON) (Passthrough)
  • Response Data (object) (Optional)

Error Handling

This action supports various error handling options:

  • Fail on Empty Body – Causes the action to fail if a response body is expected but not returned.
  • Fail on 4xx – Causes the action to fail when the HTTP response status code is between 400 and 499.
  • Fail on 5xx – Causes the action to fail when the HTTP response status code is between 500 and 599.

Request Batching

Some remote API endpoints limit the number of objects per request or enforce request rate limits. Request batching allows large datasets to be divided into smaller requests and submitted over time to accommodate these constraints.

For example, if the dataset is:

Copy
{
  "myData": [
    { "id": 83729, "name": "Alice Johnson" },
    { "id": 47381, "name": "Bob Smith" },
    { "id": 21984, "name": "Charlie Brown" },
    { "id": 59213, "name": "David White" },
    { "id": 14825, "name": "Eve Davis" },
    /* ... 1,000 additional records omitted ... */
    { "id": 63094, "name": "Frank Green" },
    { "id": 42975, "name": "Grace Miller" },
    { "id": 30058, "name": "Hannah Martin" },
    { "id": 97034, "name": "Ivy Thompson" },
    { "id": 25618, "name": "Jack Wilson" }
  ]
}

A total of 1,010 records are included, and the following configuration options are used:

  • Batch Size: 100
  • Batch Delay: 60

As a result, the HTTP Request action sends 11 separate HTTP requests:

Request 1

Copy
[
  { "id": 83729, "name": "Alice Johnson" },
  { "id": 47381, "name": "Bob Smith" },
  { "id": 21984, "name": "Charlie Brown" },
  { "id": 59213, "name": "David White" },
  { "id": 14825, "name": "Eve Davis" },
  /* ... 95 additional records omitted ... */
]

Request 2-10

Note: Omitted for brevity.

Request 11

Copy
[
  /* ... 5 additional records omitted ... */
  { "id": 63094, "name": "Frank Green" },
  { "id": 42975, "name": "Grace Miller" },
  { "id": 30058, "name": "Hannah Martin" },
  { "id": 97034, "name": "Ivy Thompson" },
  { "id": 25618, "name": "Jack Wilson" }
]

Note: The final request includes any remaining records and may contain fewer records than the configured batch size if the total does not divide evenly. In the example above, because 1,010 is not evenly divisible by 100, the final request contains only the remaining 10 records.

Asynchronous Polling

If the endpoint supports the HTTP asynchronous request-reply pattern, polling can be enabled. When polling is enabled, the HTTP Request action waits for the long-running operation to complete before finishing the action and allowing the workflow to continue.

If the endpoint does not support polling (for example, it does not return a 202 Accepted response or a valid Location header), the HTTP Request action fails.

See Asynchronous Request-Reply pattern for a technical overview.

Verified Polling Compatibility

The following applications have been confirmed to be compatible with iWorkflow polling:

Response Types

When the response type is JSON, the response is incorporated directly into the workflow pipeline and is available for use in expressions in subsequent actions, without requiring additional parsing. When the response type is not JSON, the body property contains the response as a string, such as HTML or another data format.

Example JSON Response

Copy
{
  "myHttpResponse": {
    "url": "https://example.org/api/sample",
    "method": "GET",
    "statusCode": 200,
    "headers": { ... },
    "body": {
      "result": "OK",
      "error": null,
      "message": "Sample JSON Response"
    }
  }
}

Example non-JSON Response

Copy
{
  "myHttpResponse": {
    "url": "https://example.org/sample/page.html",
    "method": "GET",
    "statusCode": 200,
    "headers": { ... },
    "body": "<!DOCTYPE html>\n<html lang=\"en\"> <head> <title>..."
  }
}

Properties

These properties control the behavior and structure of the HTTP Request action:

Name Type

Templatable

Notes

Method Text Yes Supply the HTTP method (verb) to be used for the request, such as GET, POST, or PUT.
URL Text Specify the full remote URL, including any query string parameters. Portions of this field can be templated, allowing query string values to be supplied dynamically.
Headers List (Optional) Specify the HTTP headers to include with the request. Header values can be templated to allow dynamic content.
Body Text (Optional) Specify the body to be included for methods that typically require a body such as POST, PUT, or PATCH.
Content Type Text

Specify a valid MIME type for the request, such as application/json or text/csv.

Warning! Some remote endpoints won’t accept the request without a correct content type specified.

Batch Size Number No Specify the size of each batch such as the maximum number of records to include in each request.
Batch Delay Number The number of seconds to wait between batched requests.
Output Property Text

Specify the property name where the HTTP response data will be stored. If the output property is set to httpResponseData, the response structure appears as follows:

Copy
"httpResponseData": {
  "url": "https://example.org/.../",
  "method": "GET",
  "statusCode": 200,
  "headers": {
    "Date": [
        "Mon, 24 Jun 2024 17:07:26 GMT"
    ],
    "Server": [
        "nginx"
    ],
    "Cache-Control": [
        "private"
    ],
    /* ... additional headers ... */
  }
  "body": { ... }
  /* Or, for non-JSON: "body": "..." */
}
Fail on Empty Body Checkbox If enabled, the action fails when the remote endpoint returns no response body.
Fail on 4xx Checkbox If enabled, the action fails when the response status code is between 400 and 499.
Fail on 5xx Checkbox If enabled, the action fails when the response status code is between 500 and 599.
Enable Asynchronous Polling Checkbox If enabled, the action uses asynchronous polling and waits for the remote operation to complete before continuing.
Polling Timeout Number Specify the maximum time, in seconds, that the HTTP action should wait for a polling endpoint to complete. Valid values range from 1 to 86,400 (24 hours).