Node.js Code
Use this action to add a custom Node.js code to your workflow.
Using the Node.js Code Action
To use this action in your workflow, connect it to ThingWorx Flow. To connect to the flow, do the following:
1. Click and drag the Node.js Code action under the Developer Tools utility to the canvas, place the pointer on the action, and then click or double-click the action. The Node.js Code action window opens.
2. Edit the Label name, if needed. By default, the label name is same as the action name.
3. Add the custom Node.js code.
Note the following points:
The supported Node.js modules are 'assert', 'crypto', 'path', 'buffer', 'events', 'http', 'https', 'punycode', 'querystring', 'string_decoder', 'url', 'zlib', 'request', 'lodash', 'soap', 'xml2js', and 'ws'.
To complete this action and export the output of this action to the next action, use $export(error, data).
4. Click Done.
Output Schema
The Node.js Code action returns an output schema depending on the code that you enter. See a sample output schema in the figure that follows: