Skip to main content

Documentation Index

Fetch the complete documentation index at: https://messenger-docs.cogfy.com/llms.txt

Use this file to discover all available pages before exploring further.

The JavaScript Code node is able to execute arbitrary, pure javascript code and provide its results to the next nodes. Currently this node does not accept any library imports and/or calls.

Input

It’s important to say that you can also interpolate data from previous nodes in the JavaScript Code node by using the following notation:
$nodes['Node Name'].property
Example
// If you have a Message Received trigger node called 'Message Received',
// you can do:

if ($nodes['Message Received'].contact.firstName === 'Cogfy') {
  return 'That is me!'
} else {
  return 'That is not me'
}

Output Schema

The output schema defines the properties that will be available to the next nodes.
result
any
The result field will be whatever type you put in your return statement.In the example above, the result is of type string.