Skip to main content

REST

Generic REST step. Builds a Request from the given configuration (url, method, headers, parameters, body or formData) and executes it using the host HTTP helper. Results are written to cfg.outputs when provided or to the default text output.

At a glance

  • Category Service
  • Aliases SERVICE_REST
  • Version: 1.0.0
  • Applications: all
  • Scope: all

Config Options

NameDescriptionDefaultRequiredResolvedConstraintsConditional Rules
urlThe URL to call. Supports template expressions and variable resolution.NonetruetrueLength:1-∞None
methodHTTP method to use (GET, POST, PUT, DELETE, ...). Default: GET.GETfalsefalseNoneNone
headersOptional headers object. Values will be resolved against the flow context.NonefalsefalseNoneNone
parametersOptional query parameters object. Values will be resolved against the flow context.NonefalsefalseNoneNone
bodyOptional request body. May be a string or object. Objects are JSON-stringified by the step.NonefalsetrueNoneConflicts: formData
formDataOptional formData object. Supports File/Blob entries and arrays. Values are resolved against the flow context.NonefalsefalseNoneConflicts: body
requestOptionsOptional low-level RequestInit overrides passed to the fetch helper.NonefalsefalseNoneNone

Step-Level Validation Rules

Outputs

TypeDescriptionOptional
textDefault textual response when no outputs are configuredfalse
jsonParsed JSON response (if requested via outputs)true
blobBinary blob response (if requested via outputs)true
bytesRaw bytes as Uint8Array (if requested via outputs)true
arrayBufferArrayBuffer response (if requested via outputs)true
objectFull Response object (if requested via outputs)true

Examples

Simple GET request

- step: REST
url: "https://api.example.com/items"
method: "GET"
outputs:
- type: json
name: items

POST request with JSON

- step: REST
url: "https://api.example.com/items"
method: "POST"
parameters:
query: "{{ flowContext.somevar }}"
headers:
Authorization: Client-ID XXXXX-XXXXXXXXXXXXXXXXXXXXX
body:
myData:
supportsAlsoVars: {{ flowContext.myVar }}

See Also

General Resources: