Requests

Learn more about making dynamic requests with the headers, queryParams, and body keywords.

Invocation

Data transformation must output:

{
    "lam.headers:": { ... },
    "lam.queryParams": { ... },
    "lam.body": { ... }
}
KeyDescriptionType

headers

The workflow ID to invoke after the current pending request is resolved.

Object (optional)

queryParams

The payload to pass the workflow we're invoking.

Object (optional)

body

The result we're resolving the pending request with

Object (optional)

Functionality

The headers, queryParams, and body keywords can be used to dynamically assign request metadata for our destination request as part of our flow execution. We can use these specific keywords to make GET requests with dynamic query parameters or headers that depend on data we've retrieved and have in our Global Workflow Object.

Examples

Making dynamic requests

In order to dynamically assign headers and query params to requests we're making on our destination API description, we output specific keywords:

.step_1.data.user |
map(
if .totalSpent > 20 then
{
    "lam.headers:": {
        "x-api-key": 12345
    },
    "lam.queryParams": {
        "email": .email
    },
    "lam.body": .
}
else
    empty
end
)

Specifying the body

In the case we specify any of the headers or queryParams keys, Laminar will not send any body unless explicitly specified by the body key.

Last updated