Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
Find a file
Inga c599006b91
fix(editor): Open only one tab with plans page (#7377)
## Issue

In community edition, clicking on "View plans" button on "Settings" ->
"Usage and plan" page (e.g. http://127.0.0.1:5678/settings/usage) opens
two new tabs with n8n pricing (one of them with UTM tracking, another
without).
This was introduced in #6317 , when click handler of "View plans" link
container [started
calling](https://github.com/n8n-io/n8n/pull/6317/files#diff-0bf26afac8a06e03b3d39d0668f22408859355b585a9ab420800c125e33f0691R109)
`uiStore.goToUpgrade(...)` which opens n8n pricing in a new tab, while
browser opens another tab for the link URL.

The simplest fix, implemented in this PR, is to prevent default event
handling (so that, after `onViewPlans` is called, browser will not
attempt to process the click additionally as clicking on the link),
similarly to how it is prevented on some other pages. It only solves the
immediate problem of browser opening two new tabs on clicking "View
plans".

Note that **I didn't implement any tests for the changed behavior**,
because it was not covered by tests before, and I couldn't quite figure
out how to cover it now within the existing test approach (considering
that testing the fact that only one new tab is open will likely require
to write entirely new tests relying on puppeteer; as far as I can see,
no existing `editor-ui` tests are doing anything like that). I'll gladly
implement tests for the new behavior if you tell me how you would like
them to look.
The existing tests for `editor-ui` still pass; I didn't run tests for
other subpackages (see "additional contribution notes" below).

## Additional notes on the issue.

I'm not sure that the change in this PR is the correct long-term
solution for the issue, because the URLs for these two methods (custom
click handler for link container and default link handling) are slightly
different:
* Custom click handler calls `useTelemetryStore().track('User clicked
upgrade CTA', ...)`; then calls `sendUsageTelemetry('view_plans')` (it
feels weird that two calls to telemetry are made); then opens new tab
for `https://n8n.io/pricing?utm_campaign=open&source=usage_page` (note
that prior to #7316 the second call to telemetry was done after the new
tab is opened, not before);
* Link itself refers to another page, with slightly different tracking
parameters:
`https://subscription.n8n.io/?instanceid=[REDACTED]&version=1.10.0&callback=http%3A%2F%2F127.0.0.1%3A5678%2Fsettings%2Fusage&source=usage_page`;
but this page redirects to `https://n8n.io/pricing/`.
It is not clear which one of the two is the right way of doing things.
Although `goToUpgrade` is called in 20 places throughout `editor-ui`,
while `viewPlansUrl`, as far as I can see, is used for this button only.

Additionally, since Settings pages don't work without JS anyway, I can
only think of two separate scenarios where any tab would be opened:
* Left-clicking the link (or Ctrl-clicking, or pressing Space or Enter
when the link is focused, or tapping): previously, both custom click
handler was executed and link's `href` was opened; in this PR, only
custom click handler is executed (similarly to how it is done in the
other places where `goToUpgrade` is called);
* Right-clicking (or long tapping, or opening context menu in any other
way) and selecting "open link in new tab" (or similar): opens a new tab
for URL from the `href` attribute (and does not send any telemetry at
all).

I'd say that the better permanent solution would probably be to get rid
of one of these methods entirely, and only rely on another in all cases
(for me, as an outside contributor, the preferred way would be for
custom click handler to only send telemetry, while letting my browser
handle the actual navigation). However, that would be a large change,
much more than one line in this PR.
Additionally, other similar places where `goToUpgrade` is currently
called (directly or indirectly) would also need to be adapted for this
change.

## Additional contribution notes

As a first-time contributor, I've encountered several things I didn't
expect; I'm not sure if they should be expected or are issues:

1. Tests for the entire monorepo consume a lot of RAM; 20GB free RAM was
not enough, so I couldn't run tests for the entire monorepo and had to
only run them for `packages/editor-ui`;
2. Linting is very slow; `pnpm lint` in `packages/editor-ui` takes ten
minutes to complete;
3. It seems that types are not checked. Code OSS highlights numerous
errors in code files: for example, `'debug'` is incompatible with
`CloudUpdateLinkSourceType` expected by `goToUpgrade` here:
3e7a4d3b2c/packages/editor-ui/src/composables/useExecutionDebugging.ts (L128)
However, I'm not getting any errors during build. There is a `typecheck`
script defined in `package.json`, but `pnpm typecheck` fails with:
    ```
    n8n-toy-demo:~/projects/n8n/packages/editor-ui$ pnpm typecheck

> n8n-editor-ui@1.10.0 typecheck
/home/inga/projects/n8n/packages/editor-ui
    > vue-tsc --emitDeclarationOnly

error TS5069: Option 'emitDeclarationOnly' cannot be specified without
specifying
    option 'declaration' or option 'composite'.


    Found 1 error.

     ELIFECYCLE  Command failed with exit code 1.
    n8n-toy-demo:~/projects/n8n/packages/editor-ui$ 
    ```
Replacing `--emitDeclarationsOnly` with `--noEmit` in `package.json`
unblocks typechecking and results in seemingly, at first glance, correct
"Found 1924 errors in 306 files" (at least several of the reported
errors that I've checked seem to be correct).
But maybe I'm missing something and there are not in fact two thousands
type errors in `editor-ui`?
2023-10-13 14:14:26 +02:00
.github ci: Fix wrong ref in PR workflows which broke external builds (#7431) 2023-10-13 10:44:26 +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: Fix flaky remote options loading test (no-changelog) (#7433) 2023-10-13 12:30:45 +02:00
docker docs: Mention UID in the docker examples (#7281) 2023-10-13 11:56:43 +01:00
packages fix(editor): Open only one tab with plans page (#7377) 2023-10-13 14:14:26 +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 refactor(core): Refactor nodes loading (no-changelog) (#7283) 2023-10-09 16:09:23 +02:00
.editorconfig ci: Ensure that eslint runs on all frontend code (no-changelog) (#4602) 2022-11-15 18:20:54 +01:00
.git-blame-ignore-revs refactor: Ignore large-scale revisions (no-changelog) (#7210) 2023-09-19 16:37:59 +02: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: Update pnpm-lock.yaml (no-changelog) (#7273) 2023-09-27 14:44:13 +02:00
.prettierrc.js 🎨 Set up linting and formatting (#2120) 2021-08-29 20:58:11 +02:00
CHANGELOG.md 🚀 Release 1.11.0 (#7402) 2023-10-11 13:38:34 +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.9 (no-changelog) (#7393) 2023-10-10 12:07:13 +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 ci: Refactor DB tests (no-changelog) (#7292) 2023-09-28 16:53:05 +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.11.0 (#7402) 2023-10-11 13:38:34 +02:00
pnpm-lock.yaml fix(editor): Implement canvas zoom UX improvements (#7376) 2023-10-10 11:07:58 +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 docs: Add information about LangChain/AI to the README 2023-10-04 08:33:04 +02:00
SECURITY.md Add SECURITY.md file 2021-09-28 14:32:16 -05:00
tsconfig.backend.json ci: Fix typescript incremental builds (no-changelog) (#7275) 2023-09-29 13:26:06 +02:00
tsconfig.build.json ci: Fix typescript incremental builds (no-changelog) (#7275) 2023-09-29 13:26:06 +02:00
tsconfig.json refactor: Consolidate tsconfig and eslintrc files (no-changelog) (#6816) 2023-08-01 17:32:43 +02:00
turbo.json feat(Loop Over Items (Split in Batches) Node): Automatically add a loop + rename (#7228) 2023-10-06 15:31:18 +02: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

Build with LangChain and AI in n8n (beta)

With n8n's LangChain nodes you can build AI-powered functionality within your workflows. The LangChain nodes are configurable, meaning you can choose your preferred agent, LLM, memory, and so on. Alongside the LangChain nodes, you can connect any n8n node as normal: this means you can integrate your LangChain logic with other data sources and services.

Learn more in the documentation.

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.