Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
Find a file
Michael Auerswald 0c6169ee22
refactor(core): Move event and telemetry handling into workers in queue mode (#7138)
# Motivation

In Queue mode, finished executions would cause the main instance to
always pull all execution data from the database, unflatten it and then
use it to send out event log events and telemetry events, as well as
required returns to Respond to Webhook nodes etc.

This could cause OOM errors when the data was large, since it had to be
fully unpacked and transformed on the main instance’s side, using up a
lot of memory (and time).

This PR attempts to limit this behaviour to only happen in those
required cases where the data has to be forwarded to some waiting
webhook, for example.

# Changes

Execution data is only required in cases, where the active execution has
a `postExecutePromise` attached to it. These usually forward the data to
some other endpoint (e.g. a listening webhook connection).

By adding a helper `getPostExecutePromiseCount()`, we can decide that in
cases where there is nothing listening at all, there is no reason to
pull the data on the main instance.

Previously, there would always be postExecutePromises because the
telemetry events were called. Now, these have been moved into the
workers, which have been given the various InternalHooks calls to their
hook function arrays, so they themselves issue these telemetry and event
calls.

This results in all event log messages to now be logged on the worker’s
event log, as well as the worker’s eventbus being the one to send out
the events to destinations. The main event log does…pretty much nothing.

We are not logging executions on the main event log any more, because
this would require all events to be replicated 1:1 from the workers to
the main instance(s) (this IS possible and implemented, see the worker’s
`replicateToRedisEventLogFunction` - but it is not enabled to reduce the
amount of traffic over redis).

Partial events in the main log could confuse the recovery process and
would result in, ironically, the recovery corrupting the execution data
by considering them crashed.

# Refactor

I have also used the opportunity to reduce duplicate code and move some
of the hook functionality into
`packages/cli/src/executionLifecycleHooks/shared/sharedHookFunctions.ts`
in preparation for a future full refactor of the hooks
2023-09-14 07:58:15 +02:00
.github ci: Add reusable unit test workflow (no-changelog) (#7159) 2023-09-13 15:24:02 +02:00
.vscode ci: Fix prettier auto-formatting (no-changelog) (#7063) 2023-09-01 13:29:31 +02:00
assets fix: Update app screenshot in README to match latest design (no-changelog) (#5314) 2023-02-01 16:50:52 +01:00
cypress fix(editor): Unbind workflow endpoint events in case of workspace reset (#7129) 2023-09-13 09:00:35 +02:00
docker ci: Trim FE package.json files before publishing (no-changelog) 2023-08-31 14:45:44 +02:00
packages refactor(core): Move event and telemetry handling into workers in queue mode (#7138) 2023-09-14 07:58:15 +02:00
patches fix(core): Setup websocket keep-live messages (#6866) 2023-08-28 10:26:27 +02:00
scripts ci: Trim FE package.json files before publishing (no-changelog) 2023-08-31 14:45:44 +02:00
.dockerignore ci: Refactor e2e tests to delete boilerplate code (no-changelog) (#6524) 2023-06-23 00:38:12 +02:00
.editorconfig ci: Ensure that eslint runs on all frontend code (no-changelog) (#4602) 2022-11-15 18:20:54 +01:00
.gitattributes fix: Add .gitattributes to preserve line endings (no-changelog) (#6442) 2023-06-15 14:31:35 +01:00
.gitignore feat(core): Add MFA (#4767) 2023-08-23 22:59:16 -04:00
.npmignore refactor: Phase out TSLint in editor-ui (no-changelog) (#4935) 2022-12-15 14:06:00 +01:00
.npmrc feat: Switch from npm to pnpm (#4429) 2022-11-09 17:32:05 +01:00
.prettierignore ci: Fix prettier auto-formatting (no-changelog) (#7063) 2023-09-01 13:29:31 +02:00
.prettierrc.js
CHANGELOG.md 🚀 Release 1.7.0 (#7162) 2023-09-13 14:55:52 +02:00
CHECKLIST.yml ci: Add checklist item hinting at not adding new dependencies for nodes (no-changelog) (#5985) 2023-04-16 16:51:48 +02:00
CODE_OF_CONDUCT.md refactor: Format root-level files (#3858) 2022-08-19 15:34:02 +02:00
CONTRIBUTING.md refactor: Upgrade to pnpm 8.7 (no-changelog) (#7025) 2023-08-28 10:10:59 +02:00
CONTRIBUTOR_LICENSE_AGREEMENT.md refactor: Format root-level files (#3858) 2022-08-19 15:34:02 +02:00
cypress.config.js fix(editor): Revert Fix telemetry initialization (no-changelog) (#6968) 2023-08-18 13:06:13 +02:00
jest.config.js refactor: Consolidate tsconfig and eslintrc files (no-changelog) (#6816) 2023-08-01 17:32:43 +02:00
LICENSE.md docs: scope Sustainable Use License to contents of the main branch (#4450) 2022-10-26 16:50:33 +02:00
LICENSE_EE.md docs(license): Introduce n8n Enterprise License (#3945) 2022-08-29 22:08:42 +02:00
package.json 🚀 Release 1.7.0 (#7162) 2023-09-13 14:55:52 +02:00
pnpm-lock.yaml fix(Code Node): Upgrade vm2 to address CVE-2023-37466 (#7123) 2023-09-07 14:18:15 +02:00
pnpm-workspace.yaml feat(core): Replace client-oauth2 with an in-repo package (#6266) 2023-05-17 16:40:53 +02:00
README.md refactor: Upgrade to Prettier 3 (no-changelog) (#6947) 2023-08-16 17:13:57 +02:00
SECURITY.md
tsconfig.backend.json refactor: Consolidate tsconfig and eslintrc files (no-changelog) (#6816) 2023-08-01 17:32:43 +02:00
tsconfig.build.json refactor: Consolidate tsconfig and eslintrc files (no-changelog) (#6816) 2023-08-01 17:32:43 +02:00
tsconfig.json refactor: Consolidate tsconfig and eslintrc files (no-changelog) (#6816) 2023-08-01 17:32:43 +02:00
turbo.json refactor: Format root-level dirs (no-changelog) (#4938) 2022-12-15 16:39:59 +01:00

n8n.io - Workflow Automation

n8n - Workflow automation tool

n8n is an extendable workflow automation tool. With a fair-code distribution model, n8n will always have visible source code, be available to self-host, and allow you to add your own custom functions, logic and apps. n8n's node-based approach makes it highly versatile, enabling you to connect anything to everything.

n8n.io - Screenshot

Demo

📺 A short video (< 5 min) that goes over key concepts of creating workflows in n8n.

Available integrations

n8n has 200+ different nodes to automate workflows. The list can be found on: https://n8n.io/integrations

Documentation

The official n8n documentation can be found on our documentation website

Additional information and example workflows on the n8n.io website

The release notes can be found here and the list of breaking changes here.

Usage

Start

You can try n8n without installing it using npx. You must have Node.js installed. From the terminal, run:

npx n8n

This command will download everything that is needed to start n8n. You can then access n8n and start building workflows by opening http://localhost:5678.

n8n cloud

Sign-up for an n8n cloud account.

While n8n cloud and n8n are the same in terms of features, n8n cloud provides certain conveniences such as:

  • Not having to set up and maintain your n8n instance
  • Managed OAuth for authentication
  • Easily upgrading to the newer n8n versions

Support

If you have problems or questions go to our forum, we will then try to help you asap:

https://community.n8n.io

Jobs

If you are interested in working for n8n and so shape the future of the project check out our job posts

What does n8n mean and how do you pronounce it?

Short answer: It means "nodemation" and it is pronounced as n-eight-n.

Long answer: "I get that question quite often (more often than I expected) so I decided it is probably best to answer it here. While looking for a good name for the project with a free domain I realized very quickly that all the good ones I could think of were already taken. So, in the end, I chose nodemation. 'node-' in the sense that it uses a Node-View and that it uses Node.js and '-mation' for 'automation' which is what the project is supposed to help with. However, I did not like how long the name was and I could not imagine writing something that long every time in the CLI. That is when I then ended up on 'n8n'." - Jan Oberhauser, Founder and CEO, n8n.io

Development setup

Have you found a bug 🐛 ? Or maybe you have a nice feature to contribute ? The CONTRIBUTING guide will help you get your development environment ready in minutes.

License

n8n is fair-code distributed under the Sustainable Use License and the n8n Enterprise License.

Proprietary licenses are available for enterprise customers. Get in touch

Additional information about the license model can be found in the docs.