@n8n/engine 0.16.0 → 0.17.0
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/authenticate.d.ts +3 -0
- package/dist/auth/authenticate.js +29 -0
- package/dist/auth/authenticate.js.map +1 -0
- package/dist/auth/identity-token.d.ts +14 -0
- package/dist/auth/identity-token.js +66 -0
- package/dist/auth/identity-token.js.map +1 -0
- package/dist/auth/identity.types.d.ts +7 -0
- package/dist/auth/identity.types.js +3 -0
- package/dist/auth/identity.types.js.map +1 -0
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.js +15 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/build.tsbuildinfo +1 -1
- package/dist/database/create-stores.d.ts +3 -2
- package/dist/database/create-stores.js.map +1 -1
- package/dist/database/entities/workflow-execution.entity.d.ts +2 -3
- package/dist/database/entities/workflow-execution.entity.js +3 -3
- package/dist/database/entities/workflow-execution.entity.js.map +1 -1
- package/dist/database/entities/workflow-step-execution.entity.d.ts +1 -0
- package/dist/database/entities/workflow-step-execution.entity.js +7 -3
- package/dist/database/entities/workflow-step-execution.entity.js.map +1 -1
- package/dist/database/index.d.ts +1 -0
- package/dist/database/index.js.map +1 -1
- package/dist/database/migrations/1778529600000-CreateWorkflowExecution.js +1 -1
- package/dist/database/migrations/1784890100000-CreateWorkflowStepExecution.js +13 -2
- package/dist/database/migrations/1784890100000-CreateWorkflowStepExecution.js.map +1 -1
- package/dist/database/typeorm-execution-store.js +1 -1
- package/dist/database/typeorm-execution-store.js.map +1 -1
- package/dist/database/typeorm-step-store.d.ts +5 -5
- package/dist/database/typeorm-step-store.js +57 -13
- package/dist/database/typeorm-step-store.js.map +1 -1
- package/dist/execution/completion.d.ts +2 -0
- package/dist/execution/completion.js +21 -0
- package/dist/execution/completion.js.map +1 -0
- package/dist/execution/execution-start-handler.js +3 -1
- package/dist/execution/execution-start-handler.js.map +1 -1
- package/dist/execution/execution-store.d.ts +3 -4
- package/dist/execution/execution-store.js.map +1 -1
- package/dist/execution/execution.types.d.ts +8 -0
- package/dist/execution/execution.types.js +6 -1
- package/dist/execution/execution.types.js.map +1 -1
- package/dist/execution/index.d.ts +3 -2
- package/dist/execution/index.js +3 -1
- package/dist/execution/index.js.map +1 -1
- package/dist/execution/iteration-mapping.d.ts +14 -0
- package/dist/execution/iteration-mapping.js +48 -0
- package/dist/execution/iteration-mapping.js.map +1 -0
- package/dist/execution/loop-ledger.d.ts +7 -0
- package/dist/execution/loop-ledger.js +38 -0
- package/dist/execution/loop-ledger.js.map +1 -0
- package/dist/execution/settlement.d.ts +6 -4
- package/dist/execution/settlement.js +73 -17
- package/dist/execution/settlement.js.map +1 -1
- package/dist/execution/start-execution.service.d.ts +2 -3
- package/dist/execution/start-execution.service.js +1 -1
- package/dist/execution/start-execution.service.js.map +1 -1
- package/dist/execution/step-ready-handler.d.ts +7 -1
- package/dist/execution/step-ready-handler.js +29 -10
- package/dist/execution/step-ready-handler.js.map +1 -1
- package/dist/execution/step-settled-handler.d.ts +1 -2
- package/dist/execution/step-settled-handler.js +27 -23
- package/dist/execution/step-settled-handler.js.map +1 -1
- package/dist/execution/step-store.d.ts +8 -5
- package/dist/execution/step-store.js.map +1 -1
- package/dist/graph/graph-validation.error.d.ts +3 -0
- package/dist/graph/graph-validation.error.js +11 -0
- package/dist/graph/graph-validation.error.js.map +1 -0
- package/dist/graph/index.d.ts +4 -1
- package/dist/graph/index.js +7 -2
- package/dist/graph/index.js.map +1 -1
- package/dist/graph/loops.d.ts +10 -0
- package/dist/graph/loops.js +161 -0
- package/dist/graph/loops.js.map +1 -0
- package/dist/graph/validate-executable-graph.d.ts +1 -3
- package/dist/graph/validate-executable-graph.js +9 -15
- package/dist/graph/validate-executable-graph.js.map +1 -1
- package/dist/index.d.ts +9 -6
- package/dist/index.js +7 -12
- package/dist/index.js.map +1 -1
- package/dist/runtime/create-engine-runtime.d.ts +18 -0
- package/dist/runtime/create-engine-runtime.js +26 -0
- package/dist/runtime/create-engine-runtime.js.map +1 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +6 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/serve.js +18 -30
- package/dist/serve.js.map +1 -1
- package/dist/server/create-engine-server.d.ts +3 -9
- package/dist/server/create-engine-server.js +5 -9
- package/dist/server/create-engine-server.js.map +1 -1
- package/dist/server/error-response.d.ts +7 -0
- package/dist/server/error-response.js +12 -0
- package/dist/server/error-response.js.map +1 -0
- package/dist/server/index.d.ts +2 -1
- package/dist/server/index.js +3 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/routes/workflow-executions.js +7 -9
- package/dist/server/routes/workflow-executions.js.map +1 -1
- package/dist/testing/start-engine-server.d.ts +3 -2
- package/dist/testing/start-engine-server.js +2 -2
- package/dist/testing/start-engine-server.js.map +1 -1
- package/package.json +5 -3
|
@@ -6,6 +6,8 @@ const zod_1 = require("zod");
|
|
|
6
6
|
const admittance_1 = require("../../admittance");
|
|
7
7
|
const common_1 = require("../../common");
|
|
8
8
|
const graph_1 = require("../../graph");
|
|
9
|
+
const error_response_1 = require("../error-response");
|
|
10
|
+
const MAX_TRIGGER_SLOTS = graph_1.MAX_SLOT_INDEX + 1;
|
|
9
11
|
const jsonValueSchema = zod_1.z.lazy(() => zod_1.z.union([
|
|
10
12
|
zod_1.z.string(),
|
|
11
13
|
zod_1.z.number(),
|
|
@@ -14,7 +16,6 @@ const jsonValueSchema = zod_1.z.lazy(() => zod_1.z.union([
|
|
|
14
16
|
zod_1.z.array(jsonValueSchema),
|
|
15
17
|
zod_1.z.record(jsonValueSchema),
|
|
16
18
|
]));
|
|
17
|
-
const jsonObjectSchema = zod_1.z.record(jsonValueSchema);
|
|
18
19
|
const StepTypeSchema = zod_1.z.enum(['trigger', 'v1-node', 'wait', 'subworkflow', 'batch']);
|
|
19
20
|
const GraphNodeSchema = zod_1.z.object({
|
|
20
21
|
id: zod_1.z.string(),
|
|
@@ -36,7 +37,7 @@ const WorkflowGraphSchema = zod_1.z.object({
|
|
|
36
37
|
const StartExecutionBody = zod_1.z.object({
|
|
37
38
|
workflowId: zod_1.z.string().min(1),
|
|
38
39
|
graph: WorkflowGraphSchema,
|
|
39
|
-
|
|
40
|
+
triggerOutputs: zod_1.z.array(jsonValueSchema).min(1).max(MAX_TRIGGER_SLOTS).nullable().optional(),
|
|
40
41
|
mode: zod_1.z.enum(['production', 'manual']).optional(),
|
|
41
42
|
});
|
|
42
43
|
function createWorkflowExecutionsRouter(startExecution) {
|
|
@@ -44,10 +45,7 @@ function createWorkflowExecutionsRouter(startExecution) {
|
|
|
44
45
|
router.post('/', async (req, res) => {
|
|
45
46
|
const parsed = StartExecutionBody.safeParse(req.body);
|
|
46
47
|
if (!parsed.success) {
|
|
47
|
-
|
|
48
|
-
error: 'invalid_request',
|
|
49
|
-
details: parsed.error.flatten(),
|
|
50
|
-
});
|
|
48
|
+
(0, error_response_1.fail)(res, 400, { error: 'invalid_request', details: parsed.error.flatten() });
|
|
51
49
|
return;
|
|
52
50
|
}
|
|
53
51
|
try {
|
|
@@ -56,15 +54,15 @@ function createWorkflowExecutionsRouter(startExecution) {
|
|
|
56
54
|
}
|
|
57
55
|
catch (error) {
|
|
58
56
|
if (error instanceof admittance_1.AdmittanceRejectedError) {
|
|
59
|
-
|
|
57
|
+
(0, error_response_1.fail)(res, 429, { error: 'admittance_rejected', reason: error.reason });
|
|
60
58
|
return;
|
|
61
59
|
}
|
|
62
60
|
if (error instanceof graph_1.GraphValidationError) {
|
|
63
|
-
|
|
61
|
+
(0, error_response_1.fail)(res, 400, { error: 'invalid_graph', reason: error.message });
|
|
64
62
|
return;
|
|
65
63
|
}
|
|
66
64
|
if (error instanceof common_1.UnimplementedError) {
|
|
67
|
-
|
|
65
|
+
(0, error_response_1.fail)(res, 501, { error: 'unimplemented', reason: error.message });
|
|
68
66
|
return;
|
|
69
67
|
}
|
|
70
68
|
throw error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-executions.js","sourceRoot":"","sources":["../../../src/server/routes/workflow-executions.ts"],"names":[],"mappings":";;;AAAA,qCAA4D;AAC5D,6BAAwB;AAExB,iDAA2D;AAC3D,yCAAkE;AAElE,
|
|
1
|
+
{"version":3,"file":"workflow-executions.js","sourceRoot":"","sources":["../../../src/server/routes/workflow-executions.ts"],"names":[],"mappings":";;;AAAA,qCAA4D;AAC5D,6BAAwB;AAExB,iDAA2D;AAC3D,yCAAkE;AAElE,uCAAmE;AACnE,sDAAyC;AAEzC,MAAM,iBAAiB,GAAG,sBAAc,GAAG,CAAC,CAAC;AAE7C,MAAM,eAAe,GAAyB,OAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CACzD,OAAC,CAAC,KAAK,CAAC;IACP,OAAC,CAAC,MAAM,EAAE;IACV,OAAC,CAAC,MAAM,EAAE;IACV,OAAC,CAAC,OAAO,EAAE;IACX,OAAC,CAAC,IAAI,EAAE;IACR,OAAC,CAAC,KAAK,CAAC,eAAe,CAAC;IACxB,OAAC,CAAC,MAAM,CAAC,eAAe,CAAC;CACzB,CAAC,CACF,CAAC;AAEF,MAAM,cAAc,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;AAEtF,MAAM,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IAChC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IAChC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IAGd,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,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AM,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YAC9E,OAAO;QACR,CAAC;QAED,IAAI,CAAC;YACJ,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACvD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,KAAK,YAAY,oCAAuB,EAAE,CAAC;gBAC9C,IAAA,qBAAI,EAAC,GAAG,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;gBACvE,OAAO;YACR,CAAC;YACD,IAAI,KAAK,YAAY,4BAAoB,EAAE,CAAC;gBAC3C,IAAA,qBAAI,EAAC,GAAG,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;gBAClE,OAAO;YACR,CAAC;YACD,IAAI,KAAK,YAAY,2BAAkB,EAAE,CAAC;gBACzC,IAAA,qBAAI,EAAC,GAAG,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;gBAClE,OAAO;YACR,CAAC;YACD,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { IdentityVerifier } from '../auth/identity.types';
|
|
2
|
+
import type { StartExecutionService } from '../execution';
|
|
3
|
+
export declare function startEngineServer(startExecution: StartExecutionService, identityVerifier: IdentityVerifier): Promise<{
|
|
3
4
|
url: string;
|
|
4
5
|
stop: () => Promise<void>;
|
|
5
6
|
}>;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.startEngineServer = startEngineServer;
|
|
4
4
|
const server_1 = require("../server");
|
|
5
|
-
async function startEngineServer(
|
|
6
|
-
const { app } = (0, server_1.createEngineServer)(
|
|
5
|
+
async function startEngineServer(startExecution, identityVerifier) {
|
|
6
|
+
const { app } = (0, server_1.createEngineServer)(startExecution, identityVerifier);
|
|
7
7
|
const server = await new Promise((resolve, reject) => {
|
|
8
8
|
const s = app.listen(0, '127.0.0.1', () => resolve(s));
|
|
9
9
|
s.on('error', reject);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-engine-server.js","sourceRoot":"","sources":["../../src/testing/start-engine-server.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"start-engine-server.js","sourceRoot":"","sources":["../../src/testing/start-engine-server.ts"],"names":[],"mappings":";;;AAIA,sCAA+C;AAExC,KAAK,4BACX,cAAqC,EACrC,gBAAkC;IAKlC,MAAM,EAAE,GAAG,EAAE,GAAG,IAAA,2BAAkB,EAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;IAErE,MAAM,MAAM,GAAG,MAAM,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC5D,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACvD,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;IACjC,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,GAAG,GAAG,oBAAoB,OAAO,CAAC,IAAI,EAAE,CAAC;IAE/C,MAAM,IAAI,GAAG,KAAK,IAAmB,EAAE;QACtC,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC3C,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;gBACtB,IAAI,KAAK;oBAAE,MAAM,CAAC,KAAK,CAAC,CAAC;;oBACpB,OAAO,EAAE,CAAC;YAChB,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n/engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "n8n workflow execution engine (v2)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -11,17 +11,19 @@
|
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"express": "5.1.0",
|
|
14
|
+
"jsonwebtoken": "9.0.3",
|
|
14
15
|
"pg": "8.21.0",
|
|
15
16
|
"reflect-metadata": "0.2.2",
|
|
16
17
|
"uuid": "11.1.1",
|
|
17
18
|
"zod": "3.25.76",
|
|
18
|
-
"@n8n/config": "2.
|
|
19
|
+
"@n8n/config": "2.35.0",
|
|
19
20
|
"@n8n/di": "0.16.0",
|
|
20
|
-
"@n8n/typeorm": "0.
|
|
21
|
+
"@n8n/typeorm": "0.9.0"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
24
|
"@testcontainers/postgresql": "^11.13.0",
|
|
24
25
|
"@types/express": "^5.0.1",
|
|
26
|
+
"@types/jsonwebtoken": "9.0.10",
|
|
25
27
|
"@types/pg": "^8.15.6",
|
|
26
28
|
"@types/supertest": "^6.0.3",
|
|
27
29
|
"supertest": "^7.1.1",
|