id | title |
---|---|
results |
Configuring Results |
Users have the flexibility to customize the results returned by workflows. The Result node enables configuration of your output through JavaScript code.
Consider a workflow that integrates product data (from the products node) with sales data (from the sales node) via a JavaScript operation (in the collatedData node).
Within the Result node, specify the output by using a return statement that encapsulates an object within parentheses:
return ({collatedData})
You can also return data from other nodes. Either return the complete data set or specify only the required portions, as demonstrated below:
return ({collatedData: collatedData.data,
products: products.data,
sales: sales.data})
Refine your result by manipulating the data using JavaScript functions. For example, the slice function can be used to select a subset of data:
return ({collatedData: collatedData.data,
products: products.data.products.slice(0,2),
sales: sales.data.slice(0,2)})
When executing workflows with triggers, the configured data in the Result node will be included in the API response.