Documentation
Community Node Development
A step-by-step guide on structuring a Community Node for nLink Workflow and the process of publishing it to the NPM registry.
Standard Directory Structure
Taking the nlink-community.discord node as an example, a standard project includes the following core files:
nlink-community.discord/
├── package.json # Package configuration, declares the node for nLink
├── definition.json # UI definition, input/output configuration parameters
├── execution.js # Business execution code (Backend JavaScript code)
├── icon.svg # Representative icon for the node
└── README.md # Usage instructionsExploring the Components
- package.json
Contains metadata identifying the package. Pay special attention to the"nlink"property - this helps the platform automatically detect nodes located within the directory.{ "name": "nlink-community-discord", "version": "1.0.6", "description": "Discord Webhook community node", "nlink": { "nodes": [ "nlink-community.discord" ] } } - definition.json
Defines the UI (User Interface) and structure of the Node on the Web Canvas. The most critical part is thepropertiesarray - determining the input fields that users must provide configuration for."properties": [ { "displayName": "Channel ID", "name": "channelId", "type": "string", "description": "Enter your Discord channel ID here.", "placeholder": "Example: 10123456789", "required": true, "displayOptions": { "show": { "operation": ["sendMessage"] } } } ]Standard structure of a Property:displayName: The label displayed on the user interface.name: The variable key used to access values inexecution.js(e.g.,params.channelId).type: Visual data type (e.g.,string,number,boolean,options,json).required: Defines whether this field is mandatory to fill (True/False).displayOptions: Visibility conditions. Helps create a smart interface by only showing fieldBwhen fieldAsatisfies a condition.
- execution.js
The JavaScript script that will be executed server-side. The Node JavaScript Runtime provides out-of-the-box state objects for you to read, such ascredentials,params, and helpers likehttp.// Construct output data for the Node $output = { status: "success", message_sent: params.content, auth_used: credentials.bot_token ? "bot" : "webhook" }; - icon.svg & README.md
icon.svg: The node's icon, preferably in vector format with square proportions.README.md: Community guidelines and documentation, ideally accompanied by screenshots of how the node operates.
Publishing to the NPM Registry
After polishing your code, to share it on the nLink Marketplace (which automatically syncs via NPM), you need to register an account on NPMJS.com.
# 1. Login to NPM via Terminal
npm login
# 2. Publish your Node!
npm publish --access publicPro Tip: Every time you modify your Node, you must bump the version inside both package.json and definition.json before repulishing.
