Commit graph

1327 commits

Author SHA1 Message Date
कारतोफ्फेलस्क्रिप्ट™ 913c8c6b0c
feat(core): Upgrade oclif (no-changelog) (#8381) 2024-01-22 18:25:36 +01:00
Cornelius Suermann d597c2ab29
feat: Extend collection of usage metrics during license renewal (no-changelog) (#8369)
Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
2024-01-22 12:29:28 +01:00
Iván Ovejero f35d4fcbd8
refactor(core): Simplify OrchestrationService (no-changelog) (#8364) 2024-01-22 11:16:29 +01:00
Danny Martini 07e6705256
feat(core): Custom session timeout and refresh configuration (#8342) 2024-01-22 09:54:13 +01:00
Iván Ovejero 749ac2b407
fix(core): Adjust starter node priority for manual executions with pinned activators (#8386) 2024-01-19 10:18:04 +01:00
Tomi Turtiainen f31cc0743f
fix: Force posthog recording to be disabled outside cloud (#8374) 2024-01-18 14:44:27 +02:00
Jon fc94377036
fix: Fix issue preventing secrets with a - in the path from being imported (#8378) 2024-01-18 09:24:58 +00:00
Tomi Turtiainen 99457019f7
feat: Nudge users to become template creators if eligible (#8357) 2024-01-17 19:07:34 +02: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
Iván Ovejero 2eb829a6b4
refactor(core): Use DI in execution services (no-changelog) (#8358) 2024-01-17 15:42:19 +01:00
Iván Ovejero 771d2fa341
test(core): Fix cleanup in test teardown script (no-changelog) (#8361) 2024-01-17 14:01:56 +01:00
Omar Ajoue d5455d7acc
fix(core): Report when waitTill is invalid and handle it (#8356) 2024-01-17 13:08:20 +01:00
कारतोफ्फेलस्क्रिप्ट™ 7cdbb424e3
refactor(core): Move methods from WorkflowHelpers into various workflow services (no-changelog) (#8348) 2024-01-17 10:16:13 +01:00
Iván Ovejero d4c93b1607
fix(core): Prevent issues with missing or mismatching encryption key (#8332) 2024-01-16 18:25:53 +01:00
Iván Ovejero 7bb2d1799e
refactor(core): Consolidate executions controllers (no-changelog) (#8349) 2024-01-16 16:52:21 +01:00
कारतोफ्फेलस्क्रिप्ट™ 64ceb16af6
refactor(core): Use DI in PermissionChecker (no-changelog) (#8344) 2024-01-16 14:15:29 +01:00
Iván Ovejero 420b4271a9
refactor(core): Move typeorm operators from Public API (no-changelog) (#8319) 2024-01-16 13:35:43 +01: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
Iván Ovejero 0f4f472a72
refactor(core): Eliminate dead Redis code (no-changelog) (#8292) 2024-01-16 09:31:45 +01:00
Iván Ovejero 5fbd7971e0
fix(core): Account for immediate confirmation request during test webhook creation (#8329) 2024-01-16 09:17:41 +01:00
Ricardo Espinoza 3c2a4000ae
refactor(core): Use DI for LDAP code (no-changelog) (#8248)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
2024-01-15 09:01:48 -05:00
Iván Ovejero 1a0e285553
feat(core): Implement inter-main communication for test webhooks in multi-main setup (#8267) 2024-01-12 11:48:58 +01:00
oleg 884396ea0d
fix(API): Fix manual chat trigger execution (#8300)
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
2024-01-11 14:01:07 +01:00
Omar Ajoue 8c7f39907f
fix: Properly output saml validation errors (#8284) 2024-01-10 16:56:04 +01:00
Omar Ajoue 8a7c629ea1
fix: Store workflow settings when saving an execution (#8288) 2024-01-10 14:20:37 +00:00
Iván Ovejero 5032bf0e34
fix(core): Fix test webhook deregistration (#8247) 2024-01-09 16:02:32 +01:00
Iván Ovejero 0dabe5c74e
fix: Fix user reinvites on FE and BE (#8261) 2024-01-09 13:52:34 +01:00
Tomi Turtiainen 3b996a7da0
feat(core): Validate shutdown handlers on startup (#8260) 2024-01-08 17:46:45 +02:00
Tomi Turtiainen 8affdf680d
fix: Hide cred setup button from canvas (no-changelog) (#8255) 2024-01-08 13:59:04 +02:00
Iván Ovejero 90c065e999
refactor(core): Convert workflows controller to DI (no-changelog) (#8253) 2024-01-08 12:54:23 +01:00
कारतोफ्फेलस्क्रिप्ट™ ac1c642fdd
fix(core): Do not add Authentication header when authentication type is body (#8201) 2024-01-08 12:38:24 +01:00
Jan Oberhauser ccb2b076f8
fix: Resolve expressions in credentials following paired item (#8250)
## Summary
Fixes the issue that pairedItem information was not available in
expressions that got used in credentials


## Related tickets and issues

[PAY-1207](https://linear.app/n8n/issue/PAY-1207/paireditem-expressions-not-working-correctly-in-credentials)


## Review / Merge checklist
- [x] PR title and summary are descriptive. **Remember, the title
automatically goes into the changelog. Use `(no-changelog)` otherwise.**
([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md))
- [ ] [Docs updated](https://github.com/n8n-io/n8n-docs) or follow-up
ticket created.
- [ ] Tests included.
> A bug is not considered fixed, unless a test is added to prevent it
from happening again.
   > A feature is not complete without tests.

---------

Co-authored-by: Omar Ajoue <krynble@gmail.com>
2024-01-08 09:48:20 +00:00
Iván Ovejero f2939568cf
perf(core): Optimize workflow activation errors (#8242)
At https://github.com/n8n-io/n8n/pull/8213 we introduced Redis hashes
for workflow ownership and manual webhooks...

- to remove clutter from multiple related keys at the top level,
- to improve performance by preventing serializing-deserializing, and
- to guarantee atomicity during concurrent updates in multi-main setup.

Workflow activation errors can also benefit from this. Added test
coverage as well.

To test manually, create a workflow with a trigger with an invalid
credential, edit the workflow's `active` column to `true`, and restart.
The activation error should show as a red triangle on canvas and in the
workflow list.
2024-01-05 13:06:42 +01:00
Iván Ovejero 23a4ac96c0
refactor(core): Continue moving typeorm operators to repositories (no-changelog) (#8212)
Follow-up to: https://github.com/n8n-io/n8n/pull/8186
2024-01-05 13:06:24 +01:00
Iván Ovejero f53c482939
perf(core): Improve caching service (#8213)
Story: https://linear.app/n8n/issue/PAY-1188

- Implement Redis hashes on the caching service, based on Micha's work
in #7747, adapted from `node-cache-manager-ioredis-yet`. Optimize
workflow ownership lookups and manual webhook lookups with Redis hashes.
- Simplify the caching service by removing all currently unused methods
and options: `enable`, `disable`, `getCache`, `keys`, `keyValues`,
`refreshFunctionEach`, `refreshFunctionMany`, `refreshTtl`, etc.
- Remove the flag `N8N_CACHE_ENABLED`. Currently some features on
`master` are broken with caching disabled, and test webhooks now rely
entirely on caching, for multi-main setup support. We originally
introduced this flag to protect against excessive memory usage, but
total cache usage is low enough that we decided to drop this setting.
Apparently this flag was also never documented.
- Overall caching service refactor: use generics, reduce branching, add
discriminants for cache kinds for better type safety, type caching
events, improve readability, remove outdated docs, etc. Also refactor
and expand caching service tests.

Follow-up to: https://github.com/n8n-io/n8n/pull/8176

---------

Co-authored-by: Michael Auerswald <michael.auerswald@gmail.com>
2024-01-05 11:52:44 +01:00
Iván Ovejero 22a5f5258d
feat(core): Cache test webhook registrations (#8176)
In a multi-main setup, we have the following issue. The user's client
connects to main A and runs a test webhook, so main A starts listening
for a webhook call. A third-party service sends a request to the test
webhook URL. The request is forwarded by the load balancer to main B,
who is not listening for this webhook call. Therefore, the webhook call
is unhandled.

To start addressing this, cache test webhook registrations, using Redis
for queue mode and in-memory for regular mode. When the third-party
service sends a request to the test webhook URL, the request is
forwarded by the load balancer to main B, who fetches test webhooks from
the cache and, if it finds a match, executes the test webhook. This
should be transparent - test webhook behavior should remain the same as
so far.

Notes:
- Test webhook timeouts are not cached. A timeout is only relevant to
the process it was created in, so another process retrieving from Redis
a "foreign" timeout will be unable to act on it. A timeout also has
circular references, so `cache-manager-ioredis-yet` is unable to
serialize it.
- In a single-main scenario, the timeout remains in the single process
and is cleared on test webhook expiration, successful execution, and
manual cancellation - all as usual.
- In a multi-main scenario, we will need to have the process who
received the webhook call send a message to the process who created the
webhook directing this originating process to clear the timeout. This
will likely be implemented via execution lifecycle hooks and Redis
channel messages checking session ID. This implementation is out of
scope for this PR and will come next.
- Additional data in test webhooks is not cached. From what I can tell,
additional data is not needed for test webhooks to be executed.
Additional data also has circular references, so
`cache-manager-ioredis-yet` is unable to serialize it.

Follow-up to: #8155
2024-01-03 16:58:33 +01:00
कारतोफ्फेलस्क्रिप्ट™ cfe9525dd4
fix(core): Better input validation for the changeRole endpoint (#8189)
also refactored the code to
1. stop passing around `scope === 'global'`, since this code can be used
only for changing globalRole.
2. leak less details when input validation fails.

## Review / Merge checklist
- [x] PR title and summary are descriptive
- [x] Tests included
2024-01-03 09:33:35 +01:00
Iván Ovejero 40c1eeeddd
refactor(core): Continue moving typeorm operators to repositories (no-changelog) (#8186)
Follow-up to: #8163
2024-01-02 17:53:24 +01:00
Tomi Turtiainen e126ed74f3
feat(core): Add user.profile.beforeUpdate hook (#8144)
Add `user.profile.beforeUpdate` hook so we can prevent user email change
if it overlaps with other users email.
2024-01-02 10:15:12 +02:00
Iván Ovejero ece48d6a13
refactor(core): Unify workflow controllers (no-changelog) (#8175)
Combine EE workflows controller into main workflows controller,
protecting paid functionality behind feature flag checks.
2023-12-29 14:23:58 +01:00
Iván Ovejero 4bad43dd66
refactor(core): Move typeorm operators from WaitTracker to ExecutionRepository (no-changelog) (#8163)
Follow-up to: #8145

---------

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
2023-12-28 19:22:09 +01:00
Iván Ovejero e418d42450
refactor(core): Move typeorm operators from various sources into repositories (no-changelog) (#8174)
Follow-up to: #8165
2023-12-28 13:14:10 +01:00
कारतोफ्फेलस्क्रिप्ट™ c84d3c3bbf
refactor(core): Extract ActiveWebhooks out of ActiveWorkflowRunner (no-changelog) (#8171)
## Summary
This PR continues refactoring webhooks code for better modularity.
Continued from #8069 to bring back `ActiveWebhooks`, but this time
actually handling active webhook calls in this class.

## Review / Merge checklist
- [x] PR title and summary are descriptive
2023-12-28 10:04:32 +01:00
Iván Ovejero 639afcd7a5
refactor(core): Simplify state in test webhooks (no-changelog) (#8155)
This PR simplifies state in test webhooks so that it can be cached
easily. Caching this state will allow us to start using Redis for manual
webhooks, to support manual webhooks to work in multi-main setup.

- [x] Convert `workflowWebhooks` to a getter - no need to optimize for
deactivation
- [x] Remove array from value in `TestWebhooks.webhookUrls`
- [x] Consolidate `webhookUrls` and `registeredWebhooks`
2023-12-28 09:28:12 +01:00
Iván Ovejero 0e582594ea
refactor(core): Move more typeorm operators to UserRepository (no-changelog) (#8165)
Follow-up to: #8163
2023-12-28 09:27:47 +01:00
Iván Ovejero 5aee7a1d48
refactor(core): Move typeorm operators from SourceControlExportService to repositories (no-changelog) (#8168)
Follow-up to: #8165
2023-12-28 09:27:38 +01:00
Jan Oberhauser ea7e76fa3b
fix(core): Use pinned data only for manual mode (#8164)
## Summary
Fixes the issue that pinned data gets also used for production executions.

---------

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
2023-12-27 18:22:33 +01:00
Iván Ovejero 2c6ffb0153
fix(core): Minor improvements to multi-main setup (no-changelog) (#8012)
- Move webhook, poller and trigger activation logs closer to activation
event
- Enrich response of `/debug/multi-main-setup`
- Ensure workflow updates broadcast activation state changes only if
state changed
- Fix bug on workflow activation after leadership change
- Ensure debug controller is not available in production

---------

Co-authored-by: Omar Ajoue <krynble@gmail.com>
2023-12-27 16:55:01 +01:00
कारतोफ्फेलस्क्रिप्ट™ f69ddcd796
refactor(core): Use Dependency Injection for all Controller classes (no-changelog) (#8146)
## Review / Merge checklist
- [x] PR title and summary are descriptive
2023-12-27 11:50:43 +01:00
Jan Oberhauser fa8bd8b9eb
fix(core): Fix issue that pinnedData is not used with Test-Webhooks (#8123)
## Summary
When a workflow gets started via a Test-Webhook the pinned data does get
ignored and the nodes executed anyway.



## Related tickets and issues
> Include links to **Linear ticket** or Github issue or Community forum
post. Important in order to close *automatically* and provide context to
reviewers.



## Review / Merge checklist
- [x] PR title and summary are descriptive. **Remember, the title
automatically goes into the changelog. Use `(no-changelog)` otherwise.**
([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md))
- [ ] [Docs updated](https://github.com/n8n-io/n8n-docs) or follow-up
ticket created.
- [X] Tests included.
> A bug is not considered fixed, unless a test is added to prevent it
from happening again.
   > A feature is not complete without tests.

---------

Co-authored-by: Mutasem Aldmour <mutasem@n8n.io>
2023-12-27 10:51:53 +01:00