n8n 2.42.0 → 2.42.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/auth.service.d.ts +2 -0
- package/dist/auth/auth.service.js +23 -0
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/credentials/credentials.service.js +1 -1
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/credentials-helper.js +6 -0
- package/dist/credentials-helper.js.map +1 -1
- package/dist/evaluation.ee/evaluation-dataset.service.d.ts +3 -1
- package/dist/evaluation.ee/evaluation-dataset.service.js +8 -5
- package/dist/evaluation.ee/evaluation-dataset.service.js.map +1 -1
- package/dist/events/maps/queue-metrics.event-map.d.ts +4 -0
- package/dist/events/maps/relay.event-map.d.ts +2 -4
- package/dist/execution-lifecycle/execute-error-workflow.js +2 -1
- package/dist/execution-lifecycle/execute-error-workflow.js.map +1 -1
- package/dist/instance-settings-loader/loaders/community-packages.instance-settings-loader.js +4 -14
- package/dist/instance-settings-loader/loaders/community-packages.instance-settings-loader.js.map +1 -1
- package/dist/metrics/prometheus/queue-metrics.service.js +8 -0
- package/dist/metrics/prometheus/queue-metrics.service.js.map +1 -1
- package/dist/modules/agents/agents.service.js +2 -1
- package/dist/modules/agents/agents.service.js.map +1 -1
- package/dist/modules/agents/builder/get-resource-locator-options.tool.d.ts +2 -2
- package/dist/modules/agents/repositories/agent.repository.d.ts +1 -0
- package/dist/modules/agents/repositories/agent.repository.js +3 -0
- package/dist/modules/agents/repositories/agent.repository.js.map +1 -1
- package/dist/modules/agents/utils/extract-agent-credential-ids.d.ts +2 -1
- package/dist/modules/agents/utils/extract-agent-credential-ids.js +9 -6
- package/dist/modules/agents/utils/extract-agent-credential-ids.js.map +1 -1
- package/dist/modules/community-packages/community-node-types-utils.d.ts +4 -0
- package/dist/modules/community-packages/community-node-types-utils.js +8 -0
- package/dist/modules/community-packages/community-node-types-utils.js.map +1 -1
- package/dist/modules/community-packages/community-packages.controller.d.ts +5 -3
- package/dist/modules/community-packages/community-packages.controller.js +12 -8
- package/dist/modules/community-packages/community-packages.controller.js.map +1 -1
- package/dist/modules/community-packages/community-packages.lifecycle.service.d.ts +0 -3
- package/dist/modules/community-packages/community-packages.lifecycle.service.js +27 -26
- package/dist/modules/community-packages/community-packages.lifecycle.service.js.map +1 -1
- package/dist/modules/insights/database/repositories/insights-by-period.repository.js +12 -11
- package/dist/modules/insights/database/repositories/insights-by-period.repository.js.map +1 -1
- package/dist/modules/insights/insights.service.d.ts +5 -0
- package/dist/modules/insights/insights.service.js +13 -0
- package/dist/modules/insights/insights.service.js.map +1 -1
- package/dist/modules/instance-ai/onboarding-opening.js +2 -2
- package/dist/modules/instance-ai/onboarding-opening.js.map +1 -1
- package/dist/modules/instance-reporting.ee/instance-reporting.service.d.ts +4 -3
- package/dist/modules/instance-reporting.ee/instance-reporting.service.js +37 -25
- package/dist/modules/instance-reporting.ee/instance-reporting.service.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +5 -3
- package/dist/modules/mcp/mcp.service.js +8 -6
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/tools/get-execution.tool.d.ts +2 -1
- package/dist/modules/mcp/tools/get-execution.tool.js +4 -1
- package/dist/modules/mcp/tools/get-execution.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/install-community-node.tool.js +1 -1
- package/dist/modules/mcp/tools/workflow-builder/install-community-node.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.d.ts +2 -3
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +26 -51
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js +1 -1
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js +1 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js.map +1 -1
- package/dist/modules/oauth-server/oauth-server.service.js +5 -1
- package/dist/modules/oauth-server/oauth-server.service.js.map +1 -1
- package/dist/modules/source-control.ee/constants.d.ts +3 -0
- package/dist/modules/source-control.ee/constants.js +16 -1
- package/dist/modules/source-control.ee/constants.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-git.service.ee.d.ts +5 -0
- package/dist/modules/source-control.ee/source-control-git.service.ee.js +112 -16
- package/dist/modules/source-control.ee/source-control-git.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-import.service.ee.js +7 -0
- package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
- package/dist/modules/sso-saml/errors/saml-email-not-verified.error.d.ts +5 -0
- package/dist/modules/sso-saml/errors/saml-email-not-verified.error.js +12 -0
- package/dist/modules/sso-saml/errors/saml-email-not-verified.error.js.map +1 -0
- package/dist/modules/sso-saml/saml-helpers.js +6 -0
- package/dist/modules/sso-saml/saml-helpers.js.map +1 -1
- package/dist/modules/sso-saml/saml.controller.ee.d.ts +4 -0
- package/dist/modules/sso-saml/saml.controller.ee.js +3 -1
- package/dist/modules/sso-saml/saml.controller.ee.js.map +1 -1
- package/dist/modules/sso-saml/saml.service.ee.d.ts +4 -2
- package/dist/modules/sso-saml/saml.service.ee.js +53 -34
- package/dist/modules/sso-saml/saml.service.ee.js.map +1 -1
- package/dist/public-api/v1/controllers/community-packages.public.controller.js +2 -2
- package/dist/public-api/v1/controllers/community-packages.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/executions.public.controller.js +10 -1
- package/dist/public-api/v1/controllers/executions.public.controller.js.map +1 -1
- package/dist/public-api/v1/handlers/sso-saml/sso-saml.mapper.js +2 -0
- package/dist/public-api/v1/handlers/sso-saml/sso-saml.mapper.js.map +1 -1
- package/dist/public-api/v1/openapi-gen/decorator-routes.js +2 -0
- package/dist/public-api/v1/openapi-gen/decorator-routes.js.map +1 -1
- package/dist/public-api/v1/openapi-gen/generate.js +2 -0
- package/dist/public-api/v1/openapi-gen/generate.js.map +1 -1
- package/dist/public-api/v1/openapi-gen/untyped-nullable.d.ts +1 -0
- package/dist/public-api/v1/openapi-gen/untyped-nullable.js +27 -0
- package/dist/public-api/v1/openapi-gen/untyped-nullable.js.map +1 -0
- package/dist/public-api/v1/openapi.yml +45 -48
- package/dist/requests.d.ts +0 -7
- package/dist/scaling/constants.d.ts +1 -0
- package/dist/scaling/constants.js +2 -1
- package/dist/scaling/constants.js.map +1 -1
- package/dist/scaling/job-outcome-tracker.d.ts +37 -0
- package/dist/scaling/job-outcome-tracker.js +162 -0
- package/dist/scaling/job-outcome-tracker.js.map +1 -0
- package/dist/scaling/scaling.service.d.ts +4 -2
- package/dist/scaling/scaling.service.js +23 -10
- package/dist/scaling/scaling.service.js.map +1 -1
- package/dist/server.js +15 -4
- package/dist/server.js.map +1 -1
- package/dist/webhooks/waiting-webhooks.d.ts +1 -0
- package/dist/webhooks/waiting-webhooks.js +9 -1
- package/dist/webhooks/waiting-webhooks.js.map +1 -1
- package/dist/webhooks/webhook.service.js +6 -3
- package/dist/webhooks/webhook.service.js.map +1 -1
- package/dist/workflow-execute-additional-data.js +1 -3
- package/dist/workflow-execute-additional-data.js.map +1 -1
- package/dist/workflow-runner.js +19 -6
- package/dist/workflow-runner.js.map +1 -1
- package/dist/workflows/error-workflow-validation.service.d.ts +35 -0
- package/dist/workflows/error-workflow-validation.service.js +87 -0
- package/dist/workflows/error-workflow-validation.service.js.map +1 -0
- package/dist/workflows/workflow.service.d.ts +5 -1
- package/dist/workflows/workflow.service.ee.d.ts +2 -0
- package/dist/workflows/workflow.service.ee.js +24 -0
- package/dist/workflows/workflow.service.ee.js.map +1 -1
- package/dist/workflows/workflow.service.js +33 -3
- package/dist/workflows/workflow.service.js.map +1 -1
- package/package.json +26 -26
|
@@ -1566,8 +1566,7 @@ paths:
|
|
|
1566
1566
|
- filePath
|
|
1567
1567
|
settings:
|
|
1568
1568
|
type: object
|
|
1569
|
-
additionalProperties:
|
|
1570
|
-
nullable: true
|
|
1569
|
+
additionalProperties: {}
|
|
1571
1570
|
nextVersions:
|
|
1572
1571
|
type: array
|
|
1573
1572
|
items:
|
|
@@ -1682,8 +1681,7 @@ paths:
|
|
|
1682
1681
|
- filePath
|
|
1683
1682
|
settings:
|
|
1684
1683
|
type: object
|
|
1685
|
-
additionalProperties:
|
|
1686
|
-
nullable: true
|
|
1684
|
+
additionalProperties: {}
|
|
1687
1685
|
nextVersions:
|
|
1688
1686
|
type: array
|
|
1689
1687
|
items:
|
|
@@ -1801,8 +1799,7 @@ paths:
|
|
|
1801
1799
|
- filePath
|
|
1802
1800
|
settings:
|
|
1803
1801
|
type: object
|
|
1804
|
-
additionalProperties:
|
|
1805
|
-
nullable: true
|
|
1802
|
+
additionalProperties: {}
|
|
1806
1803
|
nextVersions:
|
|
1807
1804
|
type: array
|
|
1808
1805
|
items:
|
|
@@ -1920,8 +1917,7 @@ paths:
|
|
|
1920
1917
|
- filePath
|
|
1921
1918
|
settings:
|
|
1922
1919
|
type: object
|
|
1923
|
-
additionalProperties:
|
|
1924
|
-
nullable: true
|
|
1920
|
+
additionalProperties: {}
|
|
1925
1921
|
nextVersions:
|
|
1926
1922
|
type: array
|
|
1927
1923
|
items:
|
|
@@ -2036,8 +2032,7 @@ paths:
|
|
|
2036
2032
|
- filePath
|
|
2037
2033
|
settings:
|
|
2038
2034
|
type: object
|
|
2039
|
-
additionalProperties:
|
|
2040
|
-
nullable: true
|
|
2035
|
+
additionalProperties: {}
|
|
2041
2036
|
nextVersions:
|
|
2042
2037
|
type: array
|
|
2043
2038
|
items:
|
|
@@ -2063,8 +2058,7 @@ paths:
|
|
|
2063
2058
|
nodeName: Webhook
|
|
2064
2059
|
nodeType: n8n-nodes-base.webhook
|
|
2065
2060
|
- type: array
|
|
2066
|
-
items:
|
|
2067
|
-
nullable: true
|
|
2061
|
+
items: {}
|
|
2068
2062
|
maxItems: 0
|
|
2069
2063
|
'400':
|
|
2070
2064
|
$ref: '#/components/responses/badRequest'
|
|
@@ -2167,10 +2161,7 @@ paths:
|
|
|
2167
2161
|
description: npm package name. Unscoped names start with n8n-nodes-. Scoped names use the @[author]/n8n-nodes- form.
|
|
2168
2162
|
version:
|
|
2169
2163
|
type: string
|
|
2170
|
-
description: Semver version or npm dist-tag, such as latest or beta
|
|
2171
|
-
verify:
|
|
2172
|
-
type: boolean
|
|
2173
|
-
description: Whether to verify the package against the n8n-vetted package list. Required when the instance has N8N_UNVERIFIED_PACKAGES_ENABLED=false.
|
|
2164
|
+
description: Semver version or npm dist-tag, such as latest or beta. When unverified packages are disabled, only versions verified by n8n can be installed.
|
|
2174
2165
|
required:
|
|
2175
2166
|
- name
|
|
2176
2167
|
responses:
|
|
@@ -2214,10 +2205,7 @@ paths:
|
|
|
2214
2205
|
properties:
|
|
2215
2206
|
version:
|
|
2216
2207
|
type: string
|
|
2217
|
-
description: Semver version or npm dist-tag to update to, such as latest or beta
|
|
2218
|
-
verify:
|
|
2219
|
-
type: boolean
|
|
2220
|
-
description: Whether to verify the package against the n8n-vetted package list. Setting to false will allow installing or updating to an unverified version. Default is true.
|
|
2208
|
+
description: Semver version or npm dist-tag to update to, such as latest or beta. When unverified packages are disabled, only versions verified by n8n can be installed.
|
|
2221
2209
|
responses:
|
|
2222
2210
|
'200':
|
|
2223
2211
|
description: Operation successful.
|
|
@@ -2956,8 +2944,7 @@ paths:
|
|
|
2956
2944
|
example: githubApi
|
|
2957
2945
|
data:
|
|
2958
2946
|
type: object
|
|
2959
|
-
additionalProperties:
|
|
2960
|
-
nullable: true
|
|
2947
|
+
additionalProperties: {}
|
|
2961
2948
|
writeOnly: true
|
|
2962
2949
|
example:
|
|
2963
2950
|
accessToken: ada612vad6fa5df4adf5a5dsf4389adsf76da7s
|
|
@@ -3073,8 +3060,7 @@ paths:
|
|
|
3073
3060
|
example: githubApi
|
|
3074
3061
|
data:
|
|
3075
3062
|
type: object
|
|
3076
|
-
additionalProperties:
|
|
3077
|
-
nullable: true
|
|
3063
|
+
additionalProperties: {}
|
|
3078
3064
|
description: The credential data. Required when changing credential type.
|
|
3079
3065
|
writeOnly: true
|
|
3080
3066
|
example:
|
|
@@ -3307,8 +3293,7 @@ paths:
|
|
|
3307
3293
|
- object
|
|
3308
3294
|
properties:
|
|
3309
3295
|
type: object
|
|
3310
|
-
additionalProperties:
|
|
3311
|
-
nullable: true
|
|
3296
|
+
additionalProperties: {}
|
|
3312
3297
|
description: JSON Schema fragment for each of the credential type's fields, keyed by field name.
|
|
3313
3298
|
example:
|
|
3314
3299
|
apiKey:
|
|
@@ -3325,8 +3310,7 @@ paths:
|
|
|
3325
3310
|
- domain
|
|
3326
3311
|
allOf:
|
|
3327
3312
|
type: array
|
|
3328
|
-
items:
|
|
3329
|
-
nullable: true
|
|
3313
|
+
items: {}
|
|
3330
3314
|
required:
|
|
3331
3315
|
- additionalProperties
|
|
3332
3316
|
- type
|
|
@@ -12004,12 +11988,10 @@ paths:
|
|
|
12004
11988
|
- 80
|
|
12005
11989
|
parameters:
|
|
12006
11990
|
type: object
|
|
12007
|
-
additionalProperties:
|
|
12008
|
-
nullable: true
|
|
11991
|
+
additionalProperties: {}
|
|
12009
11992
|
credentials:
|
|
12010
11993
|
type: object
|
|
12011
|
-
additionalProperties:
|
|
12012
|
-
nullable: true
|
|
11994
|
+
additionalProperties: {}
|
|
12013
11995
|
example:
|
|
12014
11996
|
jiraSoftwareCloudApi:
|
|
12015
11997
|
name: jiraApi
|
|
@@ -12192,17 +12174,15 @@ paths:
|
|
|
12192
12174
|
- type: string
|
|
12193
12175
|
format: jsonString
|
|
12194
12176
|
- type: object
|
|
12195
|
-
additionalProperties:
|
|
12196
|
-
|
|
12197
|
-
- nullable: true
|
|
12177
|
+
additionalProperties: {}
|
|
12178
|
+
- {}
|
|
12198
12179
|
description: Data the workflow keeps between executions
|
|
12199
12180
|
example:
|
|
12200
12181
|
lastId: 1
|
|
12201
12182
|
pinData:
|
|
12202
12183
|
type: object
|
|
12203
12184
|
nullable: true
|
|
12204
|
-
additionalProperties:
|
|
12205
|
-
nullable: true
|
|
12185
|
+
additionalProperties: {}
|
|
12206
12186
|
description: Pinned sample data for nodes, keyed by node name
|
|
12207
12187
|
projectId:
|
|
12208
12188
|
type: string
|
|
@@ -13292,12 +13272,10 @@ paths:
|
|
|
13292
13272
|
- 80
|
|
13293
13273
|
parameters:
|
|
13294
13274
|
type: object
|
|
13295
|
-
additionalProperties:
|
|
13296
|
-
nullable: true
|
|
13275
|
+
additionalProperties: {}
|
|
13297
13276
|
credentials:
|
|
13298
13277
|
type: object
|
|
13299
|
-
additionalProperties:
|
|
13300
|
-
nullable: true
|
|
13278
|
+
additionalProperties: {}
|
|
13301
13279
|
example:
|
|
13302
13280
|
jiraSoftwareCloudApi:
|
|
13303
13281
|
name: jiraApi
|
|
@@ -13480,17 +13458,15 @@ paths:
|
|
|
13480
13458
|
- type: string
|
|
13481
13459
|
format: jsonString
|
|
13482
13460
|
- type: object
|
|
13483
|
-
additionalProperties:
|
|
13484
|
-
|
|
13485
|
-
- nullable: true
|
|
13461
|
+
additionalProperties: {}
|
|
13462
|
+
- {}
|
|
13486
13463
|
description: Data the workflow keeps between executions
|
|
13487
13464
|
example:
|
|
13488
13465
|
lastId: 1
|
|
13489
13466
|
pinData:
|
|
13490
13467
|
type: object
|
|
13491
13468
|
nullable: true
|
|
13492
|
-
additionalProperties:
|
|
13493
|
-
nullable: true
|
|
13469
|
+
additionalProperties: {}
|
|
13494
13470
|
description: Pinned sample data for nodes, keyed by node name
|
|
13495
13471
|
parentFolderId:
|
|
13496
13472
|
type: string
|
|
@@ -16098,6 +16074,7 @@ components:
|
|
|
16098
16074
|
- authnRequestsSigned
|
|
16099
16075
|
- wantAssertionsSigned
|
|
16100
16076
|
- wantMessageSigned
|
|
16077
|
+
- emailVerifiedRequired
|
|
16101
16078
|
- signingPrivateKey
|
|
16102
16079
|
- signingCertificate
|
|
16103
16080
|
- acsBinding
|
|
@@ -16123,6 +16100,7 @@ components:
|
|
|
16123
16100
|
- firstName
|
|
16124
16101
|
- lastName
|
|
16125
16102
|
- userPrincipalName
|
|
16103
|
+
- emailVerified
|
|
16126
16104
|
- n8nInstanceRole
|
|
16127
16105
|
- n8nProjectRoles
|
|
16128
16106
|
properties:
|
|
@@ -16138,6 +16116,10 @@ components:
|
|
|
16138
16116
|
userPrincipalName:
|
|
16139
16117
|
type: string
|
|
16140
16118
|
description: SAML attribute mapped to the user's principal name.
|
|
16119
|
+
emailVerified:
|
|
16120
|
+
type: string
|
|
16121
|
+
description: |
|
|
16122
|
+
SAML attribute that states whether the identity provider verified the user's email. An empty string when unused.
|
|
16141
16123
|
n8nInstanceRole:
|
|
16142
16124
|
type: string
|
|
16143
16125
|
description: SAML attribute mapped to the n8n instance role.
|
|
@@ -16185,6 +16167,11 @@ components:
|
|
|
16185
16167
|
type: boolean
|
|
16186
16168
|
description: Whether signed SAML messages are required.
|
|
16187
16169
|
example: true
|
|
16170
|
+
emailVerifiedRequired:
|
|
16171
|
+
type: boolean
|
|
16172
|
+
description: |
|
|
16173
|
+
Whether the identity provider must assert that the user's email address is verified before a login is linked to an existing user by email. When disabled, only an explicit negative assertion is rejected.
|
|
16174
|
+
example: false
|
|
16188
16175
|
signingPrivateKey:
|
|
16189
16176
|
type: string
|
|
16190
16177
|
description: |
|
|
@@ -16251,6 +16238,7 @@ components:
|
|
|
16251
16238
|
- authnRequestsSigned
|
|
16252
16239
|
- wantAssertionsSigned
|
|
16253
16240
|
- wantMessageSigned
|
|
16241
|
+
- emailVerifiedRequired
|
|
16254
16242
|
- signingPrivateKey
|
|
16255
16243
|
- signingCertificate
|
|
16256
16244
|
- acsBinding
|
|
@@ -16266,6 +16254,7 @@ components:
|
|
|
16266
16254
|
- firstName
|
|
16267
16255
|
- lastName
|
|
16268
16256
|
- userPrincipalName
|
|
16257
|
+
- emailVerified
|
|
16269
16258
|
- n8nInstanceRole
|
|
16270
16259
|
- n8nProjectRoles
|
|
16271
16260
|
properties:
|
|
@@ -16281,6 +16270,10 @@ components:
|
|
|
16281
16270
|
userPrincipalName:
|
|
16282
16271
|
type: string
|
|
16283
16272
|
description: SAML attribute mapped to the user's principal name.
|
|
16273
|
+
emailVerified:
|
|
16274
|
+
type: string
|
|
16275
|
+
description: |
|
|
16276
|
+
SAML attribute that states whether the identity provider verified the user's email. Accepted values are `true` and `false`, case-insensitive. Use an empty string when unused.
|
|
16284
16277
|
n8nInstanceRole:
|
|
16285
16278
|
type: string
|
|
16286
16279
|
description: SAML attribute mapped to the n8n instance role. Use an empty string when unused.
|
|
@@ -16329,6 +16322,11 @@ components:
|
|
|
16329
16322
|
type: boolean
|
|
16330
16323
|
description: Whether signed SAML messages are required.
|
|
16331
16324
|
example: true
|
|
16325
|
+
emailVerifiedRequired:
|
|
16326
|
+
type: boolean
|
|
16327
|
+
description: |
|
|
16328
|
+
Whether the identity provider must assert that the user's email address is verified before a login is linked to an existing user by email. When disabled, only an explicit negative assertion is rejected.
|
|
16329
|
+
example: false
|
|
16332
16330
|
signingPrivateKey:
|
|
16333
16331
|
type: string
|
|
16334
16332
|
description: |
|
|
@@ -18411,8 +18409,7 @@ components:
|
|
|
18411
18409
|
type: string
|
|
18412
18410
|
nodes:
|
|
18413
18411
|
type: array
|
|
18414
|
-
items:
|
|
18415
|
-
nullable: true
|
|
18412
|
+
items: {}
|
|
18416
18413
|
createdAt:
|
|
18417
18414
|
type: string
|
|
18418
18415
|
description:
|
package/dist/requests.d.ts
CHANGED
|
@@ -162,16 +162,9 @@ export declare namespace AnnotationTagsRequest {
|
|
|
162
162
|
}
|
|
163
163
|
export declare namespace NodeRequest {
|
|
164
164
|
type GetAll = AuthenticatedRequest;
|
|
165
|
-
type Post = AuthenticatedRequest<{}, {}, {
|
|
166
|
-
name?: string;
|
|
167
|
-
verify?: boolean;
|
|
168
|
-
version?: string;
|
|
169
|
-
checksum?: string;
|
|
170
|
-
}>;
|
|
171
165
|
type Delete = AuthenticatedRequest<{}, {}, {}, {
|
|
172
166
|
name: string;
|
|
173
167
|
}>;
|
|
174
|
-
type Update = Post;
|
|
175
168
|
}
|
|
176
169
|
export declare namespace LicenseRequest {
|
|
177
170
|
type Activate = AuthenticatedRequest<{}, {}, {
|
|
@@ -7,3 +7,4 @@ export declare const SUBSCRIBER_LIVENESS_TIMEOUT_MS: number;
|
|
|
7
7
|
export declare const MAX_PUBSUB_PAYLOAD_BYTES: number;
|
|
8
8
|
export declare const SELF_SEND_COMMANDS: Set<"add-webhooks-triggers-and-pollers" | "agent-chat-integration-changed" | "agent-chat-leader-channel-request" | "agent-chat-leader-channel-result" | "agent-chat-subscription-changed" | "agent-config-changed" | "agent-tasks-changed" | "cancel-agent-background-job" | "cancel-agent-chat-execution" | "cancel-collection" | "cancel-test-run" | "clear-test-webhooks" | "community-package-install" | "community-package-uninstall" | "community-package-update" | "display-workflow-activation" | "display-workflow-activation-error" | "display-workflow-deactivation" | "display-workflow-publication-status" | "get-worker-id" | "get-worker-status" | "redaction-floor-changed" | "relay-agent-background-tasks-update" | "relay-agent-execution-update" | "relay-agent-message-queue-update" | "relay-agent-queued-chat" | "relay-agent-update" | "relay-chat-human-message" | "relay-chat-message-edit" | "relay-chat-stream-event" | "relay-execution-lifecycle-event" | "relay-instance-ai-event" | "relay-instance-ai-task-control" | "reload-external-secrets-providers" | "reload-instance-ai-settings" | "reload-license" | "reload-mcp-registry" | "reload-oidc-config" | "reload-otel-config" | "reload-overwrite-credentials" | "reload-saml-config" | "reload-source-control-config" | "reload-sso-provisioning-configuration" | "remove-triggers-and-pollers" | "restart-event-bus" | "resume-agent-workflow-tool" | "stop-execution" | "wake-agent-background-job" | "workflow-publish-wake-up">;
|
|
9
9
|
export declare const IMMEDIATE_COMMANDS: Set<"add-webhooks-triggers-and-pollers" | "agent-chat-integration-changed" | "agent-chat-leader-channel-request" | "agent-chat-leader-channel-result" | "agent-chat-subscription-changed" | "agent-config-changed" | "agent-tasks-changed" | "cancel-agent-background-job" | "cancel-agent-chat-execution" | "cancel-collection" | "cancel-test-run" | "clear-test-webhooks" | "community-package-install" | "community-package-uninstall" | "community-package-update" | "display-workflow-activation" | "display-workflow-activation-error" | "display-workflow-deactivation" | "display-workflow-publication-status" | "get-worker-id" | "get-worker-status" | "redaction-floor-changed" | "relay-agent-background-tasks-update" | "relay-agent-execution-update" | "relay-agent-message-queue-update" | "relay-agent-queued-chat" | "relay-agent-update" | "relay-chat-human-message" | "relay-chat-message-edit" | "relay-chat-stream-event" | "relay-execution-lifecycle-event" | "relay-instance-ai-event" | "relay-instance-ai-task-control" | "reload-external-secrets-providers" | "reload-instance-ai-settings" | "reload-license" | "reload-mcp-registry" | "reload-oidc-config" | "reload-otel-config" | "reload-overwrite-credentials" | "reload-saml-config" | "reload-source-control-config" | "reload-sso-provisioning-configuration" | "remove-triggers-and-pollers" | "restart-event-bus" | "resume-agent-workflow-tool" | "stop-execution" | "wake-agent-background-job" | "workflow-publish-wake-up">;
|
|
10
|
+
export declare const JOB_WAIT_RECHECK_INTERVAL_MS: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IMMEDIATE_COMMANDS = exports.SELF_SEND_COMMANDS = exports.MAX_PUBSUB_PAYLOAD_BYTES = exports.SUBSCRIBER_LIVENESS_TIMEOUT_MS = exports.SUBSCRIBER_LIVENESS_INTERVAL_MS = exports.MCP_RELAY_PUBSUB_CHANNEL = exports.WORKER_RESPONSE_PUBSUB_CHANNEL = exports.COMMAND_PUBSUB_CHANNEL = exports.JOB_TYPE_NAME = void 0;
|
|
3
|
+
exports.JOB_WAIT_RECHECK_INTERVAL_MS = exports.IMMEDIATE_COMMANDS = exports.SELF_SEND_COMMANDS = exports.MAX_PUBSUB_PAYLOAD_BYTES = exports.SUBSCRIBER_LIVENESS_TIMEOUT_MS = exports.SUBSCRIBER_LIVENESS_INTERVAL_MS = exports.MCP_RELAY_PUBSUB_CHANNEL = exports.WORKER_RESPONSE_PUBSUB_CHANNEL = exports.COMMAND_PUBSUB_CHANNEL = exports.JOB_TYPE_NAME = void 0;
|
|
4
4
|
const constants_1 = require("@n8n/constants");
|
|
5
5
|
exports.JOB_TYPE_NAME = 'job';
|
|
6
6
|
exports.COMMAND_PUBSUB_CHANNEL = 'n8n.commands';
|
|
@@ -42,4 +42,5 @@ exports.IMMEDIATE_COMMANDS = new Set([
|
|
|
42
42
|
'display-workflow-publication-status',
|
|
43
43
|
'workflow-publish-wake-up',
|
|
44
44
|
]);
|
|
45
|
+
exports.JOB_WAIT_RECHECK_INTERVAL_MS = 60 * constants_1.Time.seconds.toMilliseconds;
|
|
45
46
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/scaling/constants.ts"],"names":[],"mappings":";;;AAAA,8CAAsC;AAIzB,QAAA,aAAa,GAAG,KAAK,CAAC;AAGtB,QAAA,sBAAsB,GAAG,cAAc,CAAC;AAGxC,QAAA,8BAA8B,GAAG,qBAAqB,CAAC;AAGvD,QAAA,wBAAwB,GAAG,eAAe,CAAC;AAG3C,QAAA,+BAA+B,GAAG,EAAE,GAAG,gBAAI,CAAC,OAAO,CAAC,cAAc,CAAC;AAGnE,QAAA,8BAA8B,GAAG,EAAE,GAAG,gBAAI,CAAC,OAAO,CAAC,cAAc,CAAC;AAMlE,QAAA,wBAAwB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAK3C,QAAA,kBAAkB,GAAG,IAAI,GAAG,CAA4B;IACpE,mCAAmC;IACnC,6BAA6B;IAE7B,0BAA0B;CAC1B,CAAC,CAAC;AAMU,QAAA,kBAAkB,GAAG,IAAI,GAAG,CAA4B;IACpE,mCAAmC;IACnC,6BAA6B;IAC7B,iCAAiC;IACjC,yBAAyB;IACzB,8BAA8B;IAC9B,yBAAyB;IACzB,6BAA6B;IAC7B,kCAAkC;IAClC,qCAAqC;IACrC,oBAAoB;I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B,mCAAmC;IACnC,qCAAqC;IACrC,0BAA0B;CAC1B,CAAC,CAAC;AAGU,QAAA,4BAA4B,GAAG,EAAE,GAAG,gBAAI,CAAC,OAAO,CAAC,cAAc,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Logger } from '@n8n/backend-common';
|
|
2
|
+
import { ExecutionRepository } from '@n8n/db';
|
|
3
|
+
import { ActiveExecutions } from '../active-executions';
|
|
4
|
+
import { EventService } from '../events/event.service';
|
|
5
|
+
import type { Job, JobFinishedProps, JobId } from './scaling.types';
|
|
6
|
+
type PendingJobWait = {
|
|
7
|
+
jobKey: string;
|
|
8
|
+
resolve: () => void;
|
|
9
|
+
reject: (error: Error) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare class JobOutcomeTracker {
|
|
12
|
+
private readonly logger;
|
|
13
|
+
private readonly activeExecutions;
|
|
14
|
+
private readonly executionRepository;
|
|
15
|
+
private readonly eventService;
|
|
16
|
+
private readonly results;
|
|
17
|
+
private readonly failures;
|
|
18
|
+
private readonly pendingWaits;
|
|
19
|
+
private readonly executionIdByJobKey;
|
|
20
|
+
private recheckTimer?;
|
|
21
|
+
private recheckInFlight?;
|
|
22
|
+
constructor(logger: Logger, activeExecutions: ActiveExecutions, executionRepository: ExecutionRepository, eventService: EventService);
|
|
23
|
+
recordFinished(executionId: string, result?: JobFinishedProps): void;
|
|
24
|
+
recordFailed(executionId: string, error: Error): void;
|
|
25
|
+
settleByJobKey(queueName: string, jobId: JobId, error?: Error): void;
|
|
26
|
+
waitFor(job: Job): Promise<void>;
|
|
27
|
+
popResult(executionId: string): JobFinishedProps | undefined;
|
|
28
|
+
drop(executionId: string): PendingJobWait | undefined;
|
|
29
|
+
clear(): void;
|
|
30
|
+
recheckAll(): Promise<void>;
|
|
31
|
+
private recheckPendingWaits;
|
|
32
|
+
private readStatuses;
|
|
33
|
+
private settle;
|
|
34
|
+
private startRecheckTimer;
|
|
35
|
+
private stopRecheckTimer;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.JobOutcomeTracker = void 0;
|
|
13
|
+
const backend_common_1 = require("@n8n/backend-common");
|
|
14
|
+
const db_1 = require("@n8n/db");
|
|
15
|
+
const di_1 = require("@n8n/di");
|
|
16
|
+
const active_executions_1 = require("../active-executions");
|
|
17
|
+
const event_service_1 = require("../events/event.service");
|
|
18
|
+
const constants_1 = require("./constants");
|
|
19
|
+
const toJobKey = (queueName, jobId) => `${queueName}:${jobId.toString()}`;
|
|
20
|
+
const IN_FLIGHT_STATUSES = new Set(['new', 'running', 'unknown']);
|
|
21
|
+
const SUCCEEDED_STATUSES = new Set(['success', 'waiting', 'deleted']);
|
|
22
|
+
const FAILED_RESPONSE = {
|
|
23
|
+
body: { message: 'Workflow execution failed' },
|
|
24
|
+
statusCode: 500,
|
|
25
|
+
};
|
|
26
|
+
let JobOutcomeTracker = class JobOutcomeTracker {
|
|
27
|
+
constructor(logger, activeExecutions, executionRepository, eventService) {
|
|
28
|
+
this.logger = logger;
|
|
29
|
+
this.activeExecutions = activeExecutions;
|
|
30
|
+
this.executionRepository = executionRepository;
|
|
31
|
+
this.eventService = eventService;
|
|
32
|
+
this.results = new Map();
|
|
33
|
+
this.failures = new Map();
|
|
34
|
+
this.pendingWaits = new Map();
|
|
35
|
+
this.executionIdByJobKey = new Map();
|
|
36
|
+
this.logger = this.logger.scoped('scaling');
|
|
37
|
+
}
|
|
38
|
+
recordFinished(executionId, result) {
|
|
39
|
+
if (result && this.activeExecutions.has(executionId)) {
|
|
40
|
+
this.results.set(executionId, result);
|
|
41
|
+
}
|
|
42
|
+
this.settle(executionId, { succeeded: result?.success ?? true });
|
|
43
|
+
}
|
|
44
|
+
recordFailed(executionId, error) {
|
|
45
|
+
const settled = this.settle(executionId, { error, succeeded: false });
|
|
46
|
+
if (settled)
|
|
47
|
+
return;
|
|
48
|
+
if (this.activeExecutions.has(executionId))
|
|
49
|
+
this.failures.set(executionId, error);
|
|
50
|
+
}
|
|
51
|
+
settleByJobKey(queueName, jobId, error) {
|
|
52
|
+
const executionId = this.executionIdByJobKey.get(toJobKey(queueName, jobId));
|
|
53
|
+
if (!executionId)
|
|
54
|
+
return;
|
|
55
|
+
this.settle(executionId, { error, succeeded: !error });
|
|
56
|
+
}
|
|
57
|
+
async waitFor(job) {
|
|
58
|
+
const { executionId } = job.data;
|
|
59
|
+
if (this.results.has(executionId))
|
|
60
|
+
return;
|
|
61
|
+
const earlyFailure = this.failures.get(executionId);
|
|
62
|
+
if (earlyFailure) {
|
|
63
|
+
this.failures.delete(executionId);
|
|
64
|
+
throw earlyFailure;
|
|
65
|
+
}
|
|
66
|
+
await new Promise((resolve, reject) => {
|
|
67
|
+
const jobKey = toJobKey(job.queue.name, job.id);
|
|
68
|
+
this.pendingWaits.set(executionId, { jobKey, resolve, reject });
|
|
69
|
+
this.executionIdByJobKey.set(jobKey, executionId);
|
|
70
|
+
this.startRecheckTimer();
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
popResult(executionId) {
|
|
74
|
+
const result = this.results.get(executionId);
|
|
75
|
+
this.results.delete(executionId);
|
|
76
|
+
this.failures.delete(executionId);
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
79
|
+
drop(executionId) {
|
|
80
|
+
const wait = this.pendingWaits.get(executionId);
|
|
81
|
+
if (!wait)
|
|
82
|
+
return undefined;
|
|
83
|
+
this.pendingWaits.delete(executionId);
|
|
84
|
+
this.executionIdByJobKey.delete(wait.jobKey);
|
|
85
|
+
if (this.pendingWaits.size === 0)
|
|
86
|
+
this.stopRecheckTimer();
|
|
87
|
+
return wait;
|
|
88
|
+
}
|
|
89
|
+
clear() {
|
|
90
|
+
for (const executionId of this.pendingWaits.keys())
|
|
91
|
+
this.drop(executionId);
|
|
92
|
+
}
|
|
93
|
+
async recheckAll() {
|
|
94
|
+
if (this.pendingWaits.size === 0)
|
|
95
|
+
return;
|
|
96
|
+
this.recheckInFlight ??= this.recheckPendingWaits().finally(() => {
|
|
97
|
+
this.recheckInFlight = undefined;
|
|
98
|
+
});
|
|
99
|
+
await this.recheckInFlight;
|
|
100
|
+
}
|
|
101
|
+
async recheckPendingWaits() {
|
|
102
|
+
const statusById = await this.readStatuses([...this.pendingWaits.keys()]);
|
|
103
|
+
if (!statusById)
|
|
104
|
+
return;
|
|
105
|
+
for (const [executionId, status] of statusById) {
|
|
106
|
+
if (IN_FLIGHT_STATUSES.has(status))
|
|
107
|
+
continue;
|
|
108
|
+
if (!this.pendingWaits.has(executionId))
|
|
109
|
+
continue;
|
|
110
|
+
this.logger.warn(`Execution ${executionId} ended without a completion event, resolving the wait from the DB`, { executionId, status });
|
|
111
|
+
this.eventService.emit('job-completion-missed', { status });
|
|
112
|
+
this.settle(executionId, { succeeded: SUCCEEDED_STATUSES.has(status) });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
async readStatuses(executionIds) {
|
|
116
|
+
try {
|
|
117
|
+
const rows = await this.executionRepository.findStatusesByIds(executionIds);
|
|
118
|
+
const statusById = new Map(rows.map((row) => [row.id, row.status]));
|
|
119
|
+
for (const executionId of executionIds) {
|
|
120
|
+
if (!statusById.has(executionId))
|
|
121
|
+
statusById.set(executionId, 'deleted');
|
|
122
|
+
}
|
|
123
|
+
return statusById;
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
this.logger.warn(`Failed to read the status of ${executionIds.length} executions, next recheck in ${constants_1.JOB_WAIT_RECHECK_INTERVAL_MS / 1000}s`, { executionIds, error });
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
settle(executionId, outcome) {
|
|
131
|
+
const wait = this.drop(executionId);
|
|
132
|
+
if (!wait)
|
|
133
|
+
return false;
|
|
134
|
+
this.activeExecutions.resolveResponsePromise(executionId, outcome.succeeded ? {} : FAILED_RESPONSE);
|
|
135
|
+
if (outcome.error) {
|
|
136
|
+
wait.reject(outcome.error);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
wait.resolve();
|
|
140
|
+
}
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
startRecheckTimer() {
|
|
144
|
+
if (this.recheckTimer)
|
|
145
|
+
return;
|
|
146
|
+
this.recheckTimer = setInterval(() => {
|
|
147
|
+
void this.recheckAll();
|
|
148
|
+
}, constants_1.JOB_WAIT_RECHECK_INTERVAL_MS).unref();
|
|
149
|
+
}
|
|
150
|
+
stopRecheckTimer() {
|
|
151
|
+
if (!this.recheckTimer)
|
|
152
|
+
return;
|
|
153
|
+
clearInterval(this.recheckTimer);
|
|
154
|
+
this.recheckTimer = undefined;
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
exports.JobOutcomeTracker = JobOutcomeTracker;
|
|
158
|
+
exports.JobOutcomeTracker = JobOutcomeTracker = __decorate([
|
|
159
|
+
(0, di_1.Service)(),
|
|
160
|
+
__metadata("design:paramtypes", [backend_common_1.Logger, active_executions_1.ActiveExecutions, db_1.ExecutionRepository, event_service_1.EventService])
|
|
161
|
+
], JobOutcomeTracker);
|
|
162
|
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AAO;QAG9B,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE;YACpC,KAAK,IAAI,CAAC,UAAU,EAAE,CAAC;QACxB,CAAC,EAAE,wCAA4B,CAAC,CAAC,KAAK,EAAE,CAAC;IAC1C,CAAC;IAEO,gBAAgB;QACvB,IAAI,CAAC,IAAI,CAAC,YAAY;YAAE,OAAO;QAE/B,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;IAC/B,CAAC;CACD,CAAA;;4BAzMY,iBAAiB;IAD7B,IAAA,YAAO,GAAE;qCAqBiB,uBAAM,EACI,oCAAgB,EACb,wBAAmB,EAC1B,4BAAY;GAvBhC,iBAAiB,CAyM7B"}
|
|
@@ -6,6 +6,7 @@ import { ActiveExecutions } from '../active-executions';
|
|
|
6
6
|
import { EventService } from '../events/event.service';
|
|
7
7
|
import { ExecutionCrashService } from '../executions/execution-crash.service';
|
|
8
8
|
import { ExecutionPersistence } from '../executions/execution-persistence';
|
|
9
|
+
import { JobOutcomeTracker } from './job-outcome-tracker';
|
|
9
10
|
import { JobProcessor } from './job-processor';
|
|
10
11
|
import type { JobQueue, Job, JobData, JobStatus, JobId, JobFinishedProps } from './scaling.types';
|
|
11
12
|
import { WebhookResponseRelay } from './webhook-response-relay';
|
|
@@ -21,11 +22,11 @@ export declare class ScalingService {
|
|
|
21
22
|
private readonly eventService;
|
|
22
23
|
private readonly webhookResponseRelay;
|
|
23
24
|
private readonly executionCrashService;
|
|
25
|
+
private readonly jobOutcomeTracker;
|
|
24
26
|
private readonly queueByName;
|
|
25
27
|
private initialQueueName;
|
|
26
28
|
private createBullQueue?;
|
|
27
|
-
|
|
28
|
-
constructor(logger: Logger, errorReporter: ErrorReporter, activeExecutions: ActiveExecutions, jobProcessor: JobProcessor, globalConfig: GlobalConfig, executionRepository: ExecutionRepository, executionPersistence: ExecutionPersistence, instanceSettings: InstanceSettings, eventService: EventService, webhookResponseRelay: WebhookResponseRelay, executionCrashService: ExecutionCrashService);
|
|
29
|
+
constructor(logger: Logger, errorReporter: ErrorReporter, activeExecutions: ActiveExecutions, jobProcessor: JobProcessor, globalConfig: GlobalConfig, executionRepository: ExecutionRepository, executionPersistence: ExecutionPersistence, instanceSettings: InstanceSettings, eventService: EventService, webhookResponseRelay: WebhookResponseRelay, executionCrashService: ExecutionCrashService, jobOutcomeTracker: JobOutcomeTracker);
|
|
29
30
|
private get defaultQueue();
|
|
30
31
|
getOrCreateQueue(queueName: string): Promise<JobQueue>;
|
|
31
32
|
setupQueue(): Promise<void>;
|
|
@@ -38,6 +39,7 @@ export declare class ScalingService {
|
|
|
38
39
|
private logExecutionsToDrain;
|
|
39
40
|
pingQueue(): Promise<void>;
|
|
40
41
|
popJobResult(executionId: string): JobFinishedProps | undefined;
|
|
42
|
+
waitForJob(job: Job): Promise<void>;
|
|
41
43
|
getPendingJobCounts(): Promise<{
|
|
42
44
|
active: number;
|
|
43
45
|
waiting: number;
|