n8n/packages
Iván Ovejero c857e42677
feat(core): Coordinate workflow activation in multiple main scenario in internal API (#7566)
Story: https://linear.app/n8n/issue/PAY-926

This PR coordinates workflow activation on instance startup and on
leadership change in multiple main scenario in the internal API. Part 3
on manual workflow activation and deactivation will be a separate PR.

### Part 1: Instance startup

In multi-main scenario, on starting an instance...
- [x] If the instance is the leader, it should add webhooks, triggers
and pollers.
- [x] If the instance is the follower, it should not add webhooks,
triggers or pollers.
- [x] Unit tests.

### Part 2: Leadership change 

In multi-main scenario, if the main instance leader dies…

- [x] The new main instance leader must activate all trigger- and
poller-based workflows, excluding webhook-based workflows.
- [x] The old main instance leader must deactivate all trigger- and
poller-based workflows, excluding webhook-based workflows.
- [x] Unit tests.

To test, start two instances and check behavior on startup and
leadership change:

```
EXECUTIONS_MODE=queue N8N_LEADER_SELECTION_ENABLED=true N8N_LICENSE_TENANT_ID=... N8N_LICENSE_ACTIVATION_KEY=... N8N_LOG_LEVEL=debug npm run start

EXECUTIONS_MODE=queue N8N_LEADER_SELECTION_ENABLED=true N8N_LICENSE_TENANT_ID=... N8N_LICENSE_ACTIVATION_KEY=... N8N_LOG_LEVEL=debug N8N_PORT=5679 npm run start
```
2023-11-07 13:48:48 +01:00
..
@n8n/client-oauth2 🚀 Release 1.10.0 (#7350) 2023-10-05 14:12:37 +02:00
@n8n_io/eslint-config refactor: Run lintfix (no-changelog) (#7537) 2023-10-27 14:15:02 +02:00
cli feat(core): Coordinate workflow activation in multiple main scenario in internal API (#7566) 2023-11-07 13:48:48 +01:00
core feat(core): Coordinate workflow activation in multiple main scenario in internal API (#7566) 2023-11-07 13:48:48 +01:00
design-system feat(editor): Improve performance by importing routes dynamically and add route guards (no-changelog) (#7567) 2023-11-03 16:22:37 +02:00
editor-ui fix(editor): Fix local storage flags defaulting to undefined string (#7603) 2023-11-07 10:06:08 +01:00
node-dev 🚀 Release 1.15.1 (#7592) 2023-11-02 14:52:11 +01:00
nodes-base refactor(Google Sheets Node): Stop reporting to Sentry sheet not found error (no-changelog) (#7617) 2023-11-06 11:36:22 +01:00
workflow feat(core): Coordinate workflow activation in multiple main scenario in internal API (#7566) 2023-11-07 13:48:48 +01:00