Commit Graph

106 Commits

Author SHA1 Message Date
Iván Ovejero
96e69ad5f2 refactor(core): Standardize filename casing for environments and eventbus (no-changelog) (#10527) 2024-08-26 11:10:06 +02:00
Iván Ovejero
f667b384c9 refactor(core): Standardize filenames in cli (no-changelog) (#10484)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
2024-08-22 11:10:37 +02:00
Iván Ovejero
d0fc9dee0e feat(core): Support bidirectional communication between specific mains and specific workers (#10377) 2024-08-20 12:32:31 +02:00
Iván Ovejero
56c4692c94 refactor(core): Move queue recovery to scaling service (no-changelog) (#10368) 2024-08-13 15:06:47 +02:00
Iván Ovejero
5255793afe fix(core): Enforce shutdown timer and sequence on SIGINT for main (#10346) 2024-08-12 11:41:21 +02:00
Iván Ovejero
9b977e80f6 refactor(core): Decouple lifecycle events from internal hooks (no-changelog) (#10305) 2024-08-07 16:09:42 +02:00
कारतोफ्फेलस्क्रिप्ट™
88086a41ff feat(core): Support community packages in scaling-mode (#10228) 2024-08-05 11:52:06 +02:00
Iván Ovejero
aa0a470dce refactor(core): Clean up event relays (no-changelog) (#10284) 2024-08-02 16:52:49 +02:00
कारतोफ्फेलस्क्रिप्ट™
0faf46f4f8 refactor(core): Move instanceRole to InstanceSettings (no-changelog) (#10242) 2024-08-02 15:18:33 +02:00
Iván Ovejero
1608d2527b refactor(core): Port endpoints config (no-changelog) (#10268) 2024-07-31 17:45:11 +02:00
Iván Ovejero
99dc56c7a1 refactor(core): Make instance role clearer (no-changelog) (#10188) 2024-07-30 10:20:21 +02:00
Iván Ovejero
7a30d845e9 refactor(core): Port path, host, port, listen_address and protocol config (no-changelog) (#10223) 2024-07-29 14:32:20 +02:00
Iván Ovejero
95b85dd5c1 refactor(core): Port nodes config (no-changelog) (#10140)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
2024-07-23 13:32:50 +02:00
Iván Ovejero
aba1c64500 refactor(core): Rename EventRelay to EventService (no-changelog) (#10110) 2024-07-19 12:55:38 +02:00
कारतोफ्फेलस्क्रिप्ट™
c7d4b471c4 refactor(core): Move backend config to a separate package (no-changelog) (#9325) 2024-07-05 11:43:27 +02:00
Iván Ovejero
7044d1ca28 fix(core): Filter out certain executions from crash recovery (#9904)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
2024-07-02 17:07:07 +02:00
Cornelius Suermann
8a09806c5a feat(core): Log a warning if automatic license renewal is disabled (no-changelog) (#9569)
Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
2024-06-26 09:00:07 +02:00
कारतोफ्फेलस्क्रिप्ट™
65c5609ab5 feat(core): Use WebCrypto to generate all random numbers and strings (#9786) 2024-06-19 13:33:57 +02:00
Iván Ovejero
c58621ab79 feat(core): Expand crash recovery to cover queue mode (#9676) 2024-06-18 15:22:02 +02:00
Iván Ovejero
f7352b6a8f refactor(core): Make PruningService.init and WaitTracker.init consistent (no-changelog) (#9761) 2024-06-17 12:49:40 +02:00
Iván Ovejero
797342343f perf(core): Introduce concurrency control for main mode (#9453) 2024-06-12 15:05:43 +02:00
Iván Ovejero
4b345bec03 fix(core): Allow graceful shutdown for main with active executions (#9661) 2024-06-07 10:58:26 +02:00
कारतोफ्फेलस्क्रिप्ट™
08d9c9a787 fix(core): Start WaitTracker only in the main container (#9600) 2024-06-03 17:43:24 +02:00
कारतोफ्फेलस्क्रिप्ट™
d361b42c70 fix(editor): Replace more variants of BASE_PATH in static assets (#9564) 2024-05-31 14:32:20 +02:00
Iván Ovejero
7b925ab871 refactor(core): Rename ActiveWorkflowRunner to ActiveWorkflowManager (no-changelog) (#9280) 2024-05-06 17:54:05 +02:00
Iván Ovejero
22b6f90950 fix(core): Prevent occassional 429s on license init in multi-main setup (#9284) 2024-05-06 09:04:16 +02:00
Iván Ovejero
7bda92cc7c refactor(core): Use logger for packages/cli messages (no-changelog) (#9302) 2024-05-03 15:24:27 +02:00
Iván Ovejero
217b07d735 fix(core): Ensure only leader handles waiting executions (#9014) 2024-04-04 13:28:20 +02:00
कारतोफ्फेलस्क्रिप्ट™
c04f92f7fd refactor(core): Couple of refactors on WorkflowRunner and ActiveExecutions (no-changelog) (#8487) 2024-02-06 18:09:50 +01:00
Iván Ovejero
c4e39451db refactor(core): Continue breaking dependency cycles (no-changelog) (#8545) 2024-02-06 10:08:46 +01:00
Iván Ovejero
dc5ec8f946 refactor(core): Streamline flows in multi-main mode (no-changelog) (#8446) 2024-02-05 09:26:55 +01:00
कारतोफ्फेलस्क्रिप्ट™
5cb55270b7 refactor(core): Replace promisify-d node calls with native promises (no-changelog) (#8464) 2024-01-30 09:49:23 +01:00
कारतोफ्फेलस्क्रिप्ट™
7c49004018 refactor(core): Use DI for eventBus code - Part 1 (no-changelog) (#8434) 2024-01-26 12:21:15 +01:00
कारतोफ्फेलस्क्रिप्ट™
cc2f0ada76 ci: Enforce noUnusedLocals on all backend and nodes packages (no-changelog) (#8428) 2024-01-25 14:33:35 +01:00
कारतोफ्फेलस्क्रिप्ट™
913c8c6b0c feat(core): Upgrade oclif (no-changelog) (#8381) 2024-01-22 18:25:36 +01:00
Iván Ovejero
f35d4fcbd8 refactor(core): Simplify OrchestrationService (no-changelog) (#8364) 2024-01-22 11:16:29 +01:00
Tomi Turtiainen
9a1cc56806 fix: Set '@typescript-eslint/return-await' rule to 'always' for node code (no-changelog) (#8363)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
2024-01-17 17:08:50 +02:00
Omar Ajoue
e1acb5911a refactor: Make execution IDs mandatory in BE (#8299)
Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
2024-01-16 09:53:17 +00:00
कारतोफ्फेलस्क्रिप्ट™
baee47a276 refactor(core): Move all base URLs to UrlService (no-changelog) (#8141)
This change kept coming up in #6713, #7773, and #8135. 
So this PR moves the existing code without actually changing anything,
to help get rid of some of the circular dependencies.


## Review / Merge checklist
- [x] PR title and summary are descriptive.
2023-12-22 15:19:50 +01:00
Tomi Turtiainen
3a881be6c2 feat(core): Unify application components shutdown (#8097)
## Summary

Add `ShutdownService` and `OnShutdown` decorator for more unified way to
shutdown different components. Use this new way in the following
components:

- HTTP(S) server
- Pruning service
- Push connection
- License

---------

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
2023-12-22 12:39:58 +02:00
कारतोफ्फेलस्क्रिप्ट™
c158ca2471 refactor(core): Upgrade more dependencies to remove axios 0.x (no-changelog) (#8105)
Had to [fork localtunnel](https://github.com/n8n-io/localtunnel) to get
the axios upgrade, since localtunnel doesn't seem to be actively maintained.
2023-12-22 11:39:20 +01:00
कारतोफ्फेलस्क्रिप्ट™
464b565283 ci: Remove unnecessary async/await, enable await-thenable linting rule (no-changelog) (#8076)
## Summary
We accidentally made some functions `async` in
https://github.com/n8n-io/n8n/pull/7846
This PR reverts that change. 

## Review / Merge checklist
- [x] PR title and summary are descriptive.
2023-12-19 13:52:42 +01:00
Tomi Turtiainen
4cae976a3b fix(core): Consider timeout in shutdown an error (#8050)
If the process doesn't shutdown within a time limit, exit with error
code.

1. conceptually something timing out is an error.
2. on successful exit we close down the DB connection gracefully. On an
exit timeout we rather not do that, since it will wait for any active
connections to close and would possible block the exit.
2023-12-18 10:53:34 +02:00
Tomi Turtiainen
6ae2f5efea fix(core): Fix shutdown if terminating before hooks are initialized (#8047)
If the app receives termination signal before hooks have been
initialised, the would be objet is undefined error. This PR fixes that.
2023-12-18 09:23:10 +02:00
Iván Ovejero
1c6178759c refactor(core): Reorganize error hierarchy in cli package (no-changelog) (#7839)
Ensure all errors in `cli` inherit from `ApplicationError` to continue
normalizing all the errors we report to Sentry

Follow-up to: https://github.com/n8n-io/n8n/pull/7820
2023-11-28 10:19:27 +01:00
Csaba Tuncsik
152883eed1 build: Upgrade lint related packages (#7790) 2023-11-27 09:11:52 +01:00
Iván Ovejero
fdb2c18ecc fix(core): Tighten checks for multi-main setup usage (#7788)
https://n8nio.slack.com/archives/C05HRPLSGTT/p1700731476321999?thread_ts=1700729359.746899&cid=C05HRPLSGTT
2023-11-23 12:18:39 +01:00
Iván Ovejero
4c4082503c feat(core): Coordinate manual workflow activation and deactivation in multi-main scenario (#7643)
Followup to #7566 | Story: https://linear.app/n8n/issue/PAY-926

### Manual workflow activation and deactivation

In a multi-main scenario, if the user manually activates or deactivates
a workflow, the process (whether leader or follower) that handles the
PATCH request and updates its internal state should send a message into
the command channel, so that all other main processes update their
internal state accordingly:

- Add to `ActiveWorkflows` if activating
- Remove from `ActiveWorkflows` if deactivating
- Remove and re-add to `ActiveWorkflows` if the update did not change
activation status.

After updating their internal state, if activating or deactivating, the
recipient main processes should push a message to all connected
frontends so that these can update their stores and so reflect the value
in the UI.

### Workflow activation errors

On failure to activate a workflow, the main instance should record the
error in Redis - main instances should always pull activation errors
from Redis in a multi-main scenario.

### Leadership change

On leadership change...

- The old leader should stop pruning and the new leader should start
pruning.
- The old leader should remove trigger- and poller-based workflows and
the new leader should add them.
2023-11-17 15:58:50 +01:00
कारतोफ्फेलस्क्रिप्ट™
3460eb5eeb fix(core): Initialize JWT Secret before it's used anywhere (#7707)
HELP-394
2023-11-15 12:17:18 +01:00
कारतोफ्फेलस्क्रिप्ट™
000e76e3b4 ci(core): Reduce memory usage in tests (part-2) (no-changelog) (#7671)
This also gets rid of `Db.collection`, which was another source of
circular dependencies.
2023-11-10 15:04:26 +01:00