Using the Node Dev CLI#
Using the Node Dev CLI makes sense if you do not want to ever share the node that you create. For example, for internal systems or something very specific to your internal tooling. Also, the CLI only works if there are no additional dependencies required by the node as it does not support installing additional node modules.
If that is not the case, it is best to do follow the creating your first node tutorial or create your own custom node-package.
Create the first basic node#
- Install the WF²-node-dev CLI:
npm install -g WF²-node-dev
- Create and go into the newly created folder in which you want to keep the code of the node
- Use CLI to create boilerplate node code:
- Answer the questions (the “Execute” node type is the regular node type that you probably want to create). It will then create the node in the current folder.
- Program… Add the functionality to the node
- Build the node and copy to correct location:
- Restart Doc² and refresh the window so that the new node gets displayed
Create own custom WF²-nodes-module#
If you want to create multiple custom nodes which are either:
- Only for yourself/your company
- Are only useful for a small number of people
- Require many or large dependencies
To learn how to develop and test WF²-nodes-module, refer to the Create WF²-nodes-module documentation.
It is best to create your own
WF²-nodes-module which can be installed separately.
That is an npm package that contains the nodes and is set up in a way
that Doc² can automatically find and load them on startup.
When creating such a module the following rules have to be followed that WF² can automatically find the nodes in the module:
- The name of the module has to start with
package.jsonfile has to contain a key
WF²with the paths to nodes and credentials
- The module has to be installed alongside WF²
An example starter module which contains one node and credentials and implements the above can be found here:
Setup to use WF²-nodes-module#
To use a custom
WF²-nodes-module, it needs to be installed alongside Workflow².
For example like this:
1 2 3 4 5 6 7 8 9 10 11 12
Development/Testing of custom WF²-nodes-module#
This works in the same way as for any other npm module.
Execute in the folder which contains the code of the custom
which should be loaded with WF²:
1 2 3 4 5
Then in the folder in which Doc² is installed:
1 2 3 4 5