Trigger
A brief summary of the default trigger node.

Overview

All flows start with a default trigger node. This is where you'll set the response of your logic flow. To do so, simply click on the trigger node and a button will appear at the top right-hand side of the node. Pressing this button will open the code editor, allowing you to set your response data. In this node, you have access to the $trigger object and the $nodes object.
Setting a flow response from the trigger node
Property
Default Value
status
Response status code
200
status
Response headers
1
{
2
"cache-control": "no-cache",
3
"content-length": "1905",
4
"content-type": "application/json; charset=utf-8"
5
}
Copied!
body
Response body
1
{
2
status: "success",
3
data: {
4
message: "Hello World ⚡️"
5
}
6
}
Copied!

Example Response

Here's sample code you can copy when setting the Response within the Trigger Node of your Flow.
1
/**
2
* @param {Object} $trigger - This flow's request object
3
* @param {Object} $nodes - Data from above nodes
4
*/
5
const response = ({ $trigger, $nodes }) => {
6
return {
7
status: 200,
8
headers: {},
9
body: {
10
status: "success",
11
data: {
12
message: "Hello World ⚡️"
13
}
14
}
15
}
16
}
17
18
Copied!
Unlike other nodes, when accessing $nodesin the trigger, you will have access to all the nodes in your flow.
Last modified 1mo ago
Copy link