Use Fetch node to dynamically fetch data from an API endpoint in workflow.
"static value"
and dynamic data is referred as data.key
.
Field | Description |
---|---|
Method* | Only GET method is supported in Fetch. |
Endpoint* | A valid URL endpoint for the GET method. Add static URL as "https://static_url" and dynamic URL as {{data.url_endpoint}} . Data for dynamic URL will be picked from trigger payload. You can also combine static and dynamic part as "https://domain" + {{data.path}} . |
Params | Query Params to pass in the request, e.g. (limit 10) to fetch top 10 stories to show in digest notification. Similar to endpoint, you can pass both static and dynamic value in query params. |
Header | Any header to be passed in the request can be added as key-value pair with key being the header type and value as header value. |
Response key | Response of your GET request is appended against response key and merged in the workflow payload. Data is merged at parent level if response key is not set. |
data.<key>
and internal suprsend data as data["$brand"].<key>
. Here’s a list of variables supported in workflow engine:
Variable | Description | JSONNET format |
---|---|---|
Input Payload | data passed in your event or workflow trigger. | data.key |
Actor | properties of actor in your workflow trigger. In case of event, distinct_id works both as actor and recipient. | data["$actor"].key |
Recipient | properties of recipient in your workflow trigger. In case of event, distinct_id works both as actor and recipient, unless override recipient is set in workflow trigger settings. In case of override recipient, properties of overridden recipient is picked. | data["$recipient"].key |
Tenant | properties of the tenant passed in workflow trigger. | data["$brand"].key |
GET
request is first appended to the response key and then merged to the input workflow data. The response is merged at parent level if response key is empty.
The merged data result from a fetch function step then becomes the global trigger data for all subsequent steps in the workflow run.
Here’s how Fetch function data output would look like with response key and without response key