Compiled n8n Docs
Compiled n8n Docs
md
Banner image
n8n.io - Screenshot
Key Capabilities
● Code When You Need It: Write JavaScript/Python, add npm
packages, or use the visual interface
● AI-Native Platform: Build AI agent workflows based on LangChain
with your own data and models
● Full Control: Self-host with our fair-code license or use our cloud
offering
● Enterprise-Ready: Advanced permissions, SSO, and air-gapped
deployments
● Active Community: 400+ integrations and 900+ ready-to-use
templates
Quick Start
Try n8n instantly with npx (requires Node.js):
npx n8n
Resources
● 📚 Documentation
● 🔧 400+ Integrations
● 💡 Example Workflows
● 👥 Community Forum
● 📖 Community Tutorials
Support
Need help? Our community forum is the place to get support and connect
with other users: community.n8n.io
License
n8n is fair-code distributed under the Sustainable Use License and n8n
Enterprise License.
● Source Available: Always visible source code
Contributing
Found a bug 🐛 or have a feature idea ✨? Check our Contributing Guide to get
started.
cypress/README.md
Debugging Flaky End-to-End Tests - Usage
To debug flaky end-to-end (E2E) tests, use the following command:
pnpm run debug:flaky:e2e -- <grep_filter> <burn_count>
Parameters:
2. Run all tests containing “login” five times (default burn count):
3. Run all tests five times (default grep and burn count):
docker/images/n8n/README.md
Key Capabilities
● Code When You Need It: Write JavaScript/Python, add npm
packages, or use the visual interface
● AI-Native Platform: Build AI agent workflows based on LangChain
with your own data and models
● Full Control: Self-host with our fair-code license or use our cloud
offering
● Enterprise-Ready: Advanced permissions, SSO, and air-gapped
deployments
● Active Community: 400+ integrations and 900+ ready-to-use
templates
Contents
● n8n - Workflow automation tool
o Key Capabilities
o Contents
o Demo
o Available integrations
o Documentation
o Start n8n in Docker
o Start n8n with tunnel
o Use with PostgreSQL
o Passing sensitive data using files
o Example server setups
o Updating
▪ Pull latest (stable) version
Demo
This :tv: short video (< 4 min) goes over key concepts of creating workflows
in n8n.
Available integrations
n8n has 200+ different nodes to automate workflows. A full list can be found
at https://n8n.io/integrations.
Documentation
The official n8n documentation can be found at https://docs.n8n.io.
Additional information and example workflows are available on the website
at https://n8n.io.
This command will download the required n8n image and start your
container. You can then access n8n by opening: http://localhost:5678
To save your work between container restarts, it also mounts a docker
volume, n8n_data. The workflow data gets saved in an SQLite database in the
user folder (/home/node/.n8n). This folder also contains important data like
the webhook URL and the encryption key used for securing credentials.
If this data can’t be found at startup n8n automatically creates a new key
and any existing credentials can no longer be decrypted.
● DB_POSTGRESDB_DATABASE_FILE
● DB_POSTGRESDB_HOST_FILE
● DB_POSTGRESDB_PASSWORD_FILE
● DB_POSTGRESDB_PORT_FILE
● DB_POSTGRESDB_USER_FILE
● DB_POSTGRESDB_SCHEMA_FILE
Updating
Before you upgrade to the latest version make sure to check here if there are
any breaking changes which may affect you: Breaking Changes
From your Docker Desktop, navigate to the Images tab and select Pull from
the context menu to download the latest n8n image.
You can also use the command line to pull the latest, or a specific version:
Pull latest (stable) version
docker pull docker.n8n.io/n8nio/n8n
3. Remove the container (this does not remove your user data) with ID
container_id:
docker rm [container_id]
Build Docker-Image
docker buildx build --platform linux/amd64,linux/arm64 --build-arg
N8N_VERSION=<VERSION> -t n8n:<VERSION> .
# For example:
docker buildx build --platform linux/amd64,linux/arm64 --build-arg
N8N_VERSION=1.30.1 -t n8n:1.30.1 .
Support
If you need more help with n8n, you can ask for support in the n8n
community forum. This is the best source of answers, as both the n8n
support team and community members can help.
Jobs
If you are interested in working for n8n and so shape the future of the project
check out our job posts.
License
You can find the license information here.
packages/@n8n/api-types/README.md
@n8n/api-types
This package contains types and schema definitions for the n8n internal API,
so that these can be shared between the backend and the frontend code.
packages/@n8n/benchmark/README.md
Directory structure
packages/@n8n/benchmark
├── scenarios Benchmark scenarios
├── src Source code for the n8n-benchmark cli
├── Dockerfile Dockerfile for the n8n-benchmark cli
├── scripts Orchestration scripts
locally
pnpm benchmark-locally
In the cloud
pnpm benchmark-in-cloud
● k6
● Node.js v20 or higher
pnpm build
Benchmark scenarios
A benchmark scenario defines one or multiple steps to execute and measure.
It consists of:
n8n setups
A n8n setup defines a single n8n runtime configuration using Docker
compose. Different n8n setups are located in ./scripts/n8nSetups.
packages/@n8n/codemirror-lang/README.md
@n8n/codemirror-lang
Language support package for CodeMirror 6 in n8n
n8n Expression Language support
packages/@n8n/codemirror-lang/src/expressions/README.md
packages/@n8n/di/README.md
@n8n/di
@n8n/di is a dependency injection (DI) container library, based on typedi.
@Service()
class ExampleInjectedService {
printMessage() {
console.log('I am alive!');
}
}
@Service()
class ExampleService {
constructor(
// because we annotated ExampleInjectedService with the @Service()
// decorator TypeDI will automatically inject an instance of
// ExampleInjectedService here when the ExampleService class is
requested
// from TypeDI.
public injectedService: ExampleInjectedService
) {}
}
serviceInstance.injectedService.printMessage();
// logs "I am alive!" to the console
packages/@n8n/extension-sdk/README.md
@n8n/plugin-sdk
packages/@n8n/json-schema-to-zod/README.md
Json-Schema-to-Zod
A package to convert JSON schema (draft 4+) objects into Zod schemas in
the form of Zod objects at runtime.
Installation
npm install @n8n/json-schema-to-zod
Simple example
import { jsonSchemaToZod } from "json-schema-to-zod";
const jsonSchema = {
type: "object",
properties: {
hello: {
type: "string",
},
},
};
Overriding a parser
You can pass a function to the overrideParser option, which represents a
function that receives the current schema node and the reference object,
and should return a zod object when it wants to replace a default output. If
the default output should be used for the node just return undefined.
Acknowledgements
This is a fork of json-schema-to-zod.
packages/@n8n/nodes-langchain/README.md
Banner image
n8n-nodes-langchain
This repo contains nodes to use n8n in combination with LangChain.
These nodes are still in Beta state and are only compatible with the Docker
image docker.n8n.io/n8nio/n8n:ai-beta.
License
You can find the license information here
packages/@n8n/nodes-langchain/nodes/vector_store/shared/
createVectorStoreNode/README.md
Overview
createVectorStoreNode is a factory function that generates n8n nodes for
vector store operations. It abstracts the common functionality needed for
vector stores while allowing specific implementations to focus only on their
unique aspects.
Purpose
The function provides a standardized way to: 1. Create vector store nodes
with consistent UIs 2. Handle different operation modes (load, insert,
retrieve, update, retrieve-as-tool) 3. Process documents and embeddings 4.
Maintain connection to LLM services
Architecture
/createVectorStoreNode/ # Create Vector Store
Node
/constants.ts # Constants like operation modes
and descriptions
/types.ts # TypeScript interfaces and types
/utils.ts # Utility functions for node
configuration
/createVectorStoreNode.ts # Main factory function
/processDocuments.ts # Document processing helpers
/operations/ # Operation-specific logic
/loadOperation.ts # Handles 'load' mode
/insertOperation.ts # Handles 'insert' mode
/updateOperation.ts # Handles 'update' mode
/retrieveOperation.ts # Handles 'retrieve' mode
/retrieveAsToolOperation.ts # Handles 'retrieve-as-tool' mode
Usage
To create a new vector store node:
import { createVectorStoreNode } from './createVectorStoreNode';
Operation Modes
1. load Mode
● Retrieves documents from the vector store based on a query
2. insert Mode
● Processes documents from input
3. retrieve Mode
● Returns the vector store instance for use with AI nodes
4. retrieve-as-tool Mode
● Creates a tool that wraps the vector store
Key Components
1. NodeConstructorArgs Interface
Defines the configuration and callbacks that specific vector store
implementations must provide:
Note: In node version 1.1+, the populateVectorStore function must
handle receiving multiple documents at once for batch processing.
interface VectorStoreNodeConstructorArgs<T extends VectorStore> {
meta: NodeMeta; // Node metadata (name,
description, etc.)
methods?: { ... }; // Optional methods for list
searches
sharedFields: INodeProperties[]; // Fields shown in all modes
insertFields?: INodeProperties[]; // Fields specific to insert mode
loadFields?: INodeProperties[]; // Fields specific to load mode
retrieveFields?: INodeProperties[]; // Fields specific to retrieve
mode
updateFields?: INodeProperties[]; // Fields specific to update mode
2. Operation Handlers
Each operation mode has its own handler module with a well-defined
interface:
// Example: loadOperation.ts
export async function handleLoadOperation<T extends VectorStore>(
context: IExecuteFunctions,
args: VectorStoreNodeConstructorArgs<T>,
embeddings: Embeddings,
itemIndex: number
): Promise<INodeExecutionData[]>
3. Document Processing
The processDocument function standardizes how documents are handled:
const { processedDocuments, serializedDocuments } = await
processDocument(
documentInput,
itemData,
itemIndex
);
Implementation Details
Error Handling and Resource Management
Each operation handler includes error handling with proper resource cleanup.
The releaseVectorStoreClient function is called in a finally block to ensure
resources are released even if an error occurs:
try {
// Operation logic
} finally {
// Release resources even if an error occurs
args.releaseVectorStoreClient?.(vectorStore);
}
Performance Considerations
1. Resource Management: Each operation properly handles resource
cleanup with releaseVectorStoreClient.
packages/@n8n/utils/README.md
@n8n/utils
A collection of utility functions that provide common functionality for both
Front-End and Back-End packages.
Table of Contents
● Features
● Contributing
● License
Features
● Reusable Logic: Build complex, stateful functionality using modular
composable functions that you can easily reuse.
● Consistent Patterns: Enjoy a unified approach across n8n packages,
making integration and maintenance a breeze.
● Type-Safe & Reliable: Benefit from TypeScript support, which
improves the developer experience and code robustness.
● Universal Functionality: Designed to work seamlessly on both the
front-end and back-end.
● Easily Testable: A modular design that simplifies testing,
maintenance, and rapid development.
Contributing
For more details, please read our CONTRIBUTING.md.
License
For more details, please read our LICENSE.md.
packages/@n8n/utils/src/search/snapshots/README.md
Search snapshots
This directory contains snapshots containing real data fed into the
sublimeSearch function.
These were obtained via console.log(items) right before the sublimeSearch
call in editor-ui (currently in
packages/frontend/editor-ui/src/components/Node/NodeCreator/utils.ts)
Which is triggered by typing in the search bar in varying states of the
application:
● toplevel: From an empty workflow (so missing e.g. tools)
After typing in the search bar you should see an object in the console you
can copy via `Right Click->Copy Object” which will cleanly paste to json.
Please use Chrome for capturing these - the recovered object in
Chrome is about 3x larger than in Firefox due to Firefox dropping
some nested values
packages/core/README.md
n8n-core
Core components for n8n
npm install n8n-core
License
You can find the license information here
packages/extensions/insights/README.md
@n8n/n8n-extension-insights
packages/frontend/@n8n/chat/README.md
n8n Chat
This is an embeddable Chat widget for n8n. It allows the execution of AI-
Powered Workflows through a Chat window.
Windowed Example
Fullscreen Example
Prerequisites
Create a n8n workflow which you want to execute via chat. The workflow has
to be triggered using a Chat Trigger node.
Open the Chat Trigger node and add your domain to the Allowed Origins
(CORS) field. This makes sure that only requests from your domain are
accepted.
See example workflow
Make sure the workflow is Active.
How it works
Each Chat request is sent to the n8n Webhook endpoint, which then sends
back a response.
Each request is accompanied by an action query parameter, where action
can be one of: - loadPreviousSession - When the user opens the Chatbot
again and the previous chat session should be loaded - sendMessage - When
the user sends a message
Installation
Open the Webhook node and replace YOUR_PRODUCTION_WEBHOOK_URL with
your production URL. This is the URL that the Chat widget will use to send
requests to.
a. CDN Embed
Add the following code to your HTML page.
<link href="https://cdn.jsdelivr.net/npm/@n8n/chat/dist/style.css"
rel="stylesheet" />
<script type="module">
import { createChat } from
'https://cdn.jsdelivr.net/npm/@n8n/chat/dist/chat.bundle.es.js';
createChat({
webhookUrl: 'YOUR_PRODUCTION_WEBHOOK_URL'
});
</script>
b. Import Embed
Install and save n8n Chat as a production dependency.
npm install @n8n/chat
Import the CSS and use the createChat function to initialize your Chat
window.
import '@n8n/chat/style.css';
import { createChat } from '@n8n/chat';
createChat({
webhookUrl: 'YOUR_PRODUCTION_WEBHOOK_URL'
});
Vue.js
<script lang="ts" setup>
// App.vue
import { onMounted } from 'vue';
import '@n8n/chat/style.css';
import { createChat } from '@n8n/chat';
onMounted(() => {
createChat({
webhookUrl: 'YOUR_PRODUCTION_WEBHOOK_URL'
});
});
</script>
<template>
<div></div>
</template>
React
// App.tsx
import { useEffect } from 'react';
import '@n8n/chat/style.css';
import { createChat } from '@n8n/chat';
return (<div></div>);
};
Options
The default options are:
createChat({
webhookUrl: '',
webhookConfig: {
method: 'POST',
headers: {}
},
target: '#n8n-chat',
mode: 'window',
chatInputKey: 'chatInput',
chatSessionKey: 'sessionId',
loadPreviousSession: true,
metadata: {},
showWelcomeScreen: false,
defaultLanguage: 'en',
initialMessages: [
'Hi there! 👋',
'My name is Nathan. How can I assist you today?'
],
i18n: {
en: {
title: 'Hi there! 👋',
subtitle: "Start a chat. We're here to help you 24/7.",
footer: '',
getStarted: 'New Conversation',
inputPlaceholder: 'Type your question..',
},
},
});
webhookUrl
● Type: string
● Required: true
● Examples:
o https://yourname.app.n8n.cloud/webhook/513107b3-6f3a-4a1e-
af21-659f0ed14183
o http://localhost:5678/webhook/513107b3-6f3a-4a1e-af21-
659f0ed14183
target
● Type: string
● Default: '#n8n-chat'
● Description: The CSS selector of the element where the Chat window
should be embedded.
mode
● Default: 'window'
● Type: boolean
● Default: false
● Type: string
● Default: 'chatInput'
● Description: The key to use for sending the chat input for the AI
Agent node.
chatSessionKey
● Type: string
● Default: 'sessionId'
● Description: The key to use for sending the chat history session ID for
the AI Memory node.
loadPreviousSession
● Type: boolean
● Default: true
defaultLanguage
● Type: string
● Default: 'en'
● Type: string[]
allowFileUploads
● Default: false
● Default: ''
Customization
The Chat window is entirely customizable using CSS variables.
:root {
--chat--color-primary: #e74266;
--chat--color-primary-shade-50: #db4061;
--chat--color-primary-shade-100: #cf3c5c;
--chat--color-secondary: #20b69e;
--chat--color-secondary-shade-50: #1ca08a;
--chat--color-white: #ffffff;
--chat--color-light: #f2f4f8;
--chat--color-light-shade-50: #e6e9f1;
--chat--color-light-shade-100: #c2c5cc;
--chat--color-medium: #d2d4d9;
--chat--color-dark: #101330;
--chat--color-disabled: #777980;
--chat--color-typing: #404040;
--chat--spacing: 1rem;
--chat--border-radius: 0.25rem;
--chat--transition-duration: 0.15s;
--chat--window--width: 400px;
--chat--window--height: 600px;
--chat--header-height: auto;
--chat--header--padding: var(--chat--spacing);
--chat--header--background: var(--chat--color-dark);
--chat--header--color: var(--chat--color-light);
--chat--header--border-top: none;
--chat--header--border-bottom: none;
--chat--header--border-bottom: none;
--chat--header--border-bottom: none;
--chat--heading--font-size: 2em;
--chat--header--color: var(--chat--color-light);
--chat--subtitle--font-size: inherit;
--chat--subtitle--line-height: 1.8;
--chat--textarea--height: 50px;
--chat--message--font-size: 1rem;
--chat--message--padding: var(--chat--spacing);
--chat--message--border-radius: var(--chat--border-radius);
--chat--message-line-height: 1.8;
--chat--message--bot--background: var(--chat--color-white);
--chat--message--bot--color: var(--chat--color-dark);
--chat--message--bot--border: none;
--chat--message--user--background: var(--chat--color-secondary);
--chat--message--user--color: var(--chat--color-white);
--chat--message--user--border: none;
--chat--message--pre--background: rgba(0, 0, 0, 0.05);
--chat--toggle--background: var(--chat--color-primary);
--chat--toggle--hover--background: var(--chat--color-primary-
shade-50);
--chat--toggle--active--background: var(--chat--color-primary-
shade-100);
--chat--toggle--color: var(--chat--color-white);
--chat--toggle--size: 64px;
}
Caveats
Fullscreen mode
In fullscreen mode, the Chat window will take up the entire width and height
of its target container. Make sure that the container has a set width and
height.
html,
body,
#n8n-chat {
width: 100%;
height: 100%;
}
License
You can find the license information here
packages/frontend/@n8n/composables/README.md
@n8n/composables
A collection of Vue composables that provide common functionality across
n8n’s Front-End packages.
Table of Contents
● Features
● Contributing
● License
Features
● Reusable Logic: Encapsulate complex stateful logic into composable
functions.
● Consistency: Ensure consistent patterns and practices across our Vue
components.
● Extensible: Easily add new composables as our project grows.
Contributing
For more details, please read our CONTRIBUTING.md.
License
For more details, please read our LICENSE.md.
packages/frontend/@n8n/design-system/README.md
@n8n/design-system
A component system for n8n using Storybook to preview.
Project setup
pnpm install
License
You can find the license information here
packages/frontend/@n8n/stores/README.md
@n8n/stores
A collection of Pinia stores that provide common data-related functionality
across n8n’s Front-End packages.
Table of Contents
● Features
● Contributing
● License
Features
● Composable State Management: Share and reuse stateful logic
across multiple Vue components using Pinia stores.
● Consistent Patterns: Promote uniform state handling and best
practices throughout the front-end codebase.
● Easy Extensibility: Add or modify stores as project requirements
evolve, supporting scalable development.
● Composition API Support: Designed to work seamlessly with Vue’s
Composition API for modern, maintainable code.
Contributing
For more details, please read our CONTRIBUTING.md.
License
For more details, please read our LICENSE.md.
packages/frontend/editor-ui/README.md
n8n-editor-ui
The UI to create and update n8n workflows
npm install n8n -g
Project setup
pnpm install
Customize configuration
See Configuration Reference.
License
You can find the license information here
packages/frontend/editor-ui/src/plugins/i18n/docs/
README.md
i18n in n8n
Scope
n8n allows for internalization of the majority of UI text:
● base text, e.g. menu display items in the left-hand sidebar menu,
● node text, e.g. parameter display names and placeholders in the node
view,
● credential text, e.g. parameter display names and placeholders in the
credential modal,
● header text, e.g. node display names and descriptions at various spots.
● node subtitles, e.g. create: user or getAll: post below the node
name on the canvas,
● new version notification contents in the updates panel, e.g. Includes
node enhancements, and
Pending functionality:
Output:
Initializing n8n process
n8n ready on 0.0.0.0, port 5678
Version: 0.156.0
Locale: de
Base text
Base text is rendered with no dependencies, i.e. base text is fixed and does
not change in any circumstances. Base text is supplied by the user in one file
per locale in the /frontend/editor-ui package.
Dynamic text
Dynamic text relies on data specific to each node and credential:
The object for each node credential parameter allows for the keys
displayName, description, and placeholder.
{
"server.displayName": "🇩🇪 Github Server",
"server.description": "🇩🇪 The server to connect to. Only has to be
set if Github Enterprise is used.",
"user.placeholder": "🇩🇪 Hans",
"accessToken.placeholder": "🇩🇪 123"
}
The header section points to an object that may contain only two keys,
displayName and description, matching the node’s description.displayName
and description.description.
export class Github implements INodeType {
description: INodeTypeDescription = {
displayName: 'GitHub', // key to use in translation
description: 'Consume GitHub API', // key to use in
translation
name: 'github',
icon: 'file:github.svg',
group: ['input'],
version: 1,
{
"header": {
"displayName": "🇩🇪 GitHub",
"description": "🇩🇪 Consume GitHub API"
}
}
Header text is used wherever the node’s display name and description are
needed:
{
"nodeView.resource.displayName": "🇩🇪 Resource"
}
{
"nodeView.owner.displayName": "🇩🇪 Repository Owner",
"nodeView.owner.placeholder": "🇩🇪 n8n-io",
"nodeView.owner.description": "🇩🇪 Owner of the repository"
}
options parameter
{
displayName: 'Resource',
name: 'resource',
type: 'options',
options: [
{
name: 'File',
value: 'file', // key to use in translation
},
{
name: 'Issue',
value: 'issue', // key to use in translation
},
],
default: 'issue',
description: 'Resource to operate on',
},
{
"nodeView.resource.displayName": "🇩🇪 Resource",
"nodeView.resource.description": "🇩🇪 Resource to operate on",
"nodeView.resource.options.file.name": "🇩🇪 File",
"nodeView.resource.options.issue.name": "🇩🇪 Issue"
}
For nodes whose credentials may be used in the HTTP Request node, an
additional option Custom API Call is injected into the Resource and Operation
parameters. Use the __CUSTOM_API_CALL__ key to translate this additional
option.
{
"nodeView.resource.options.file.name": "🇩🇪 File",
"nodeView.resource.options.issue.name": "🇩🇪 Issue",
"nodeView.resource.options.__CUSTOM_API_CALL__.name": "🇩🇪 Custom
API Call"
}
{
"nodeView.labels.displayName": "🇩🇪 Labels",
"nodeView.labels.multipleValueButtonText": "🇩🇪 Add Label",
"nodeView.labels.options.label.displayName": "🇩🇪 Label",
"nodeView.labels.options.label.description": "🇩🇪 Label to add to
issue",
"nodeView.labels.options.label.placeholder": "🇩🇪 Some placeholder"
}
{
"nodeView.additionalParameters.displayName": "🇩🇪 Additional
Parameters",
"nodeView.additionalParameters.placeholder": "🇩🇪 Add Field",
"nodeView.additionalParameters.options.author.displayName": "🇩🇪
Author",
"nodeView.additionalParameters.options.author.values.name.displayName"
: "🇩🇪 Name",
"nodeView.additionalParameters.options.author.values.name.description"
: "🇩🇪 Name of the author of the commit",
"nodeView.additionalParameters.options.author.values.name.placeholder"
: "🇩🇪 Jan",
"nodeView.additionalParameters.options.author.values.email.displayName
": "🇩🇪 Email",
"nodeView.additionalParameters.options.author.values.email.description
": "🇩🇪 Email of the author of the commit",
"nodeView.additionalParameters.options.author.values.email.placeholder
": "🇩🇪 [email protected]"
}
Building translations
Base text
When translating a base text file at
/packages/frontend/editor-ui/src/plugins/i18n/locales/{localeIdentifie
r}.json:
1. Open a terminal:
export N8N_DEFAULT_LOCALE=de
pnpm start
Dynamic text
When translating a dynamic text file at
/packages/nodes-base/nodes/{node}/translations/{localeIdentifier}/
{node}.json,
1. Open a terminal:
export N8N_DEFAULT_LOCALE=de
pnpm start
packages/node-dev/README.md
n8n-node-dev
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
Contents
● Usage
● Commands
● Create a node
o Node Type
o Node Type Description
o Node Properties
o Node Property Options
● License
Usage
The commandline tool can be started with n8n-node-dev <COMMAND>
Commands
The following commands exist:
build
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”.
new
Creates new basic credentials or node of the selected type to have a first
starting point.
Create a node
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:
● defines one node property
// 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
● trigger
Webhook node
Method is called when webhook gets called.
● webhook
Node Type
Property overview
Node Properties
The following properties can be set in the node properties:
packages/nodes-base/README.md
n8n-nodes-base
The nodes which are included by default in n8n
npm install n8n-nodes-base -g
License
You can find the license information here
packages/nodes-base/nodes/Stripe/README.md
All Stripe webhook events are taken from docs:
https://stripe.com/docs/api/events/types#event_types
To get the entire list of events as a JS array, scrape the website:
1. manually add the id #event-types to <ul> that contains all event types
2. copy-paste the function in the JS console
3. the result is copied into in the clipboard
4. paste the prepared array in StripeTrigger.node.ts
types = [];
$$('ul#event-types li').forEach((el) => {
const value = el.querySelector('.method-list-item-label-
name').innerText;
types.push({
name: value
.replace(/(\.|_)/, ' ')
.split(' ')
.map((s) => s.charAt(0).toUpperCase() + s.substring(1))
.join(' '),
value,
description: el.querySelector('.method-list-item-
description').innerText,
});
});
copy(types);
packages/workflow/README.md
n8n-workflow
Workflow base code for n8n
npm install n8n-workflow
License
You can find the license information here
test-workflows/README.md
test-workflows
n8n workflows used for testing nodes