Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
n8n-node-dev
Advanced tools
Currently very simple and not very sophisticated CLI which makes it easier to create credentials and nodes in TypeScript for n8n.
npm install n8n-node-dev -g
The commandline tool can be started with n8n-node-dev <COMMAND>
The following commands exist:
Builds credentials and nodes in the current folder and copies them into the
n8n custom extension folder (~/.n8n/custom/
) unless destination path is
overwritten with --destination <FOLDER_PATH>
When "--watch" gets set it starts in watch mode and automatically builds and copies files whenever they change. To stop press "ctrl + c".
Creates new basic credentials or node of the selected type to have a first starting point.
The easiest way to create a new node is via the "n8n-node-dev" cli. It sets up all the basics.
A n8n node is a JavaScript file (normally written in TypeScript) which describes some basic information (like name, description, ...) and also at least one method. Depending on which method gets implemented defines if it is a regular-, trigger- or webhook-node.
A simple regular node which:
would look like this:
File named: MyNode.node.ts
import {
IExecuteFunctions,
INodeExecutionData,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';
export class MyNode implements INodeType {
description: INodeTypeDescription = {
displayName: 'My Node',
name: 'myNode',
group: ['transform'],
version: 1,
description: 'Adds "myString" on all items to defined value.',
defaults: {
name: 'My Node',
color: '#772244',
},
inputs: ['main'],
outputs: ['main'],
properties: [
// Node properties which the user gets displayed and
// can change on the node.
{
displayName: 'My String',
name: 'myString',
type: 'string',
default: '',
placeholder: 'Placeholder value',
description: 'The description text',
}
]
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
let item: INodeExecutionData;
let myString: string;
// Itterates over all input items and add the key "myString" with the
// value the parameter "myString" resolves to.
// (This could be a different value for each item in case it contains an expression)
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
myString = this.getNodeParameter('myString', itemIndex, '') as string;
item = items[itemIndex];
item.json['myString'] = myString;
}
return [items];
}
}
The "description" property has to be set on all nodes because it contains all the base information. Additionally all nodes have to have exactly one of the following methods defined which contains the actual logic:
Regular node
Method is called when the workflow gets executed
execute
: Executed once no matter how many itemsBy default, execute
should always be used, especially when creating a
third-party integration. The reason for this is that it provides much more
flexibility and allows, for example, returning a different number of items than
it received as input. This becomes crucial when a node needs to query data such as return
all users. In such cases, the node typically receives only one input item but returns as
many items as there are users. Therefore, when in doubt, it is recommended to use execute
!
Trigger node
Method is called once when the workflow gets activated. It can then trigger workflow runs and provide the necessary data by itself.
trigger
Webhook node
Method is called when webhook gets called.
webhook
Property overview
Node Type Description
bellow.The following properties can be set in the node description:
The following properties can be set in the node properties:
The following properties can be set in the node property options:
All properties are optional. However, most only work when the node-property is of a specfic type.
n8n is fair-code distributed under the Sustainable Use License.
Proprietary licenses are available for enterprise customers. Get in touch
Additional information about the license can be found in the docs.
1.22.0 (2023-12-21)
use
permission (#8023) (329e5bf)returnIntermediateSteps
for AI agents (#8113) (7806a65)FAQs
CLI to simplify n8n credentials/node development
The npm package n8n-node-dev receives a total of 109 weekly downloads. As such, n8n-node-dev popularity was classified as not popular.
We found that n8n-node-dev demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.