Code
General
The Code
node is used to perform more complex manipulations in the received data and return back the result.
Input
Source: (optional) Receives 0 or more parameters of type
Object
,String
,Number
orBoolean
. The number of input parameters depends on the number of parameters variables in the code which are denoted as${...}
. Learn more on vm2.run.
Output
Out: Returns an
Object
,String
,Number
orBoolean
depending on the result of the executed code. The code snippet emulates a Javascript module and supports various module.exports syntax. Learn more on module.exports.
The EXPORTED
variable can be returned with any of the following:
exports = EXPORTED
module.exports = EXPORTED
EXPORTED
Use Cases
Call an external API parse and process the response.
Request (Get) ➡ Webhook ➡ Script ➡ Response (200)
Return a random number.
Request (Get) ➡ Script ➡ Response (200)
Last updated
Was this helpful?