HTTP task definition object

HTTP task (identified by "type": "Http") is used to:

The HTTP task is moved to Completed status once the remote service responds successfully.

Here is an example HTTP task to fetch a list of SimWorkflow workflow definitions:

"Fetch Workflow Definitions": {
  "credentials": "CredentialsId",
  "description": "Fetch a list of SimWorkflow workflow definitions",
  "type": "Http",
  "httpRequest": {
    "url": "https://www.simworkflow.com/api/workflow-definitions",
    "method": "GET",
    "headers": {
      "Accept": "application/json"
    },
    "body": null
  },
  "retry": {
    "intervalSeconds": 1,
    "maxAttempts": 3,
    "backoffRate": 2.0
  },
  "end": true,
  "connectionTimeoutSeconds": 10,
  "readTimeoutSeconds": 10
}

The HTTP task has the following additional fields:

Field

Type

Required

Description

credentials

Credentials Id

No

The saved credentials to use for the target authenticated HTTP request.

httpRequest

JSON Object

Yes

A configuration for HTTP request represented by a JSON Object.

retry

JSON Object

No

The retry configuration to retry the HTTP task when encounter runtime errors.

connectionTimeoutSeconds

Integer

No

The HTTP connection time out in seconds. Minimum: 1. Default: 5.

readTimeoutSeconds

Integer

No

The HTTP read time out in seconds. Minimum: 1. Default: 10.

HTTP request field top-level fields

Field

Type

Required

Description

url

String

Yes

Represents the URL to which the HTTP request should be sent.

method

String

Yes

Represents the HTTP method to be used for the request.

Supported Methods: GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS

headers

JSON Object

No

Represents the HTTP headers to be included in the request.

Each field within the headers object corresponds to a specific HTTP header key-value pair.

body

Object

No

Represents the body of the HTTP request.

This field is typically used for sending data in POST, PUT, PATCH, or other request methods that support a request body.

Note:

Response for HTTP request

The response for the HTTP request is a JSON Object with the following fields:

Field

Type

Description

headers

Map[String, Any]

The HTTP response headers

statusCode

Integer

HTTP response status code

reasonPhrase

String

HTTP response status code's reason phrase

body

Any

The body containing the response if one is present

Response for HTTP request

Task can encounter runtime errors. Errors can arise because of workflow definition issues, task failures or because of transient issues, such as network partition events.

When a task reports an error, the default course of action is to fail the whole workflow. Or the task can be retried, usually at increasing time intervals.

Field

Type

Required

Description

intervalSeconds

Integer

No

The number of seconds before the first retry attempt. Minimum: 1. Default: 1.

maxAttempts

Integer

No

The maximum number of retry attempts. Minimum: 0. Default: 3.

When this is set to 0, errors should never be retried.

backoffRate

Double

No

The multiplier by which the retry interval increases with each attempt. Minimum: 1.0. Default: 1.0.

An example of a retry which will make 2 retry attempts after waits of 3 and 4.5 seconds: