Skip to main content
Version: 5.1

Call a REST API

Call REST API invokes an HTTP endpoint through an http:Client connection and binds the response to the type you ask for. The call is recorded like any other activity, so a workflow that restarts mid-flight reads the recorded response back instead of calling the API again.

Use it whenever a workflow needs to talk to an HTTP service and you would otherwise write an activity function that does nothing but forward the call.

Fields​

FieldRequiredDescription
ConnectionYesThe http:Client to call through. Only HTTP connections are offered.
MethodYesGET, POST, PUT, DELETE, or PATCH. Choose From Expression to pass the method as an activity:RestMethod value instead.
PathNoResource path appended to the connection's base URL, for example /users/1.
MessageNoThe request body, offered for every method except GET. Accepts an http:Request, a record, json, xml, a string, or bytes.
HeadersNoRequest headers. Under the advanced fields.
ResultYesThe variable that receives the response.
Databinding TypeYesThe type to bind the response payload to. Defaults to json. For example, a GET with a Databinding Type of OrderStatus hands the workflow a typed value rather than raw JSON.

Approval Policy, Retry Policy, and Check Error work the same as for every prebuilt activity. See Prebuilt activities.

Retries and writes

A POST that failed after the server processed it will be sent again when Auto Retry is on, which can create a duplicate. Pass an idempotency key if the API supports one, choose Human Review so a person decides, or leave retries off for calls that cannot be repeated safely.

Next steps​

On this page
Was this page helpful?
Report an issue