@n8n/engine 0.16.2 → 0.18.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/action-token.d.ts +7 -0
- package/dist/auth/action-token.js +30 -0
- package/dist/auth/action-token.js.map +1 -0
- package/dist/auth/authenticate.d.ts +4 -0
- package/dist/auth/authenticate.js +30 -0
- package/dist/auth/authenticate.js.map +1 -0
- package/dist/auth/identity-token.d.ts +12 -0
- package/dist/auth/identity-token.js +45 -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 +5 -0
- package/dist/auth/index.js +17 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/shared-secret-token.d.ts +12 -0
- package/dist/auth/shared-secret-token.js +44 -0
- package/dist/auth/shared-secret-token.js.map +1 -0
- package/dist/build.tsbuildinfo +1 -1
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.js +3 -1
- package/dist/common/index.js.map +1 -1
- package/dist/common/json.schema.d.ts +3 -0
- package/dist/common/json.schema.js +13 -0
- package/dist/common/json.schema.js.map +1 -0
- package/dist/database/create-stores.d.ts +5 -2
- package/dist/database/create-stores.js +6 -2
- package/dist/database/create-stores.js.map +1 -1
- package/dist/database/entities/workflow-execution.entity.d.ts +2 -4
- package/dist/database/entities/workflow-execution.entity.js +3 -14
- package/dist/database/entities/workflow-execution.entity.js.map +1 -1
- package/dist/database/entities/workflow-step-execution.entity.d.ts +2 -2
- 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 +2 -0
- package/dist/database/index.js +3 -1
- 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.d.ts +1 -3
- package/dist/database/typeorm-execution-store.js +1 -2
- package/dist/database/typeorm-execution-store.js.map +1 -1
- package/dist/database/typeorm-execution-view-store.d.ts +10 -0
- package/dist/database/typeorm-execution-view-store.js +49 -0
- package/dist/database/typeorm-execution-view-store.js.map +1 -0
- package/dist/database/typeorm-step-store.d.ts +7 -6
- package/dist/database/typeorm-step-store.js +63 -14
- package/dist/database/typeorm-step-store.js.map +1 -1
- package/dist/dependencies/external-dependencies.d.ts +3 -0
- package/dist/execution/batch-step.d.ts +8 -0
- package/dist/execution/batch-step.js +28 -0
- package/dist/execution/batch-step.js.map +1 -0
- 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-query.service.d.ts +7 -0
- package/dist/execution/execution-query.service.js +17 -0
- package/dist/execution/execution-query.service.js.map +1 -0
- package/dist/execution/execution-start-handler.d.ts +3 -1
- package/dist/execution/execution-start-handler.js +13 -2
- package/dist/execution/execution-start-handler.js.map +1 -1
- package/dist/execution/execution-store.d.ts +5 -7
- package/dist/execution/execution-store.js.map +1 -1
- package/dist/execution/execution-view-store.d.ts +26 -0
- package/dist/execution/execution-view-store.js +3 -0
- package/dist/execution/execution-view-store.js.map +1 -0
- package/dist/execution/execution.types.d.ts +14 -0
- package/dist/execution/execution.types.js +6 -1
- package/dist/execution/execution.types.js.map +1 -1
- package/dist/execution/index.d.ts +5 -2
- package/dist/execution/index.js +5 -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 +39 -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 +3 -3
- package/dist/execution/start-execution.service.js +6 -4
- package/dist/execution/start-execution.service.js.map +1 -1
- package/dist/execution/step-ready-handler.d.ts +11 -2
- package/dist/execution/step-ready-handler.js +66 -13
- package/dist/execution/step-ready-handler.js.map +1 -1
- package/dist/execution/step-settled-handler.d.ts +4 -3
- package/dist/execution/step-settled-handler.js +52 -30
- package/dist/execution/step-settled-handler.js.map +1 -1
- package/dist/execution/step-store.d.ts +9 -13
- package/dist/execution/step-store.js.map +1 -1
- package/dist/execution/store-loop-reader.d.ts +4 -0
- package/dist/execution/store-loop-reader.js +48 -0
- package/dist/execution/store-loop-reader.js.map +1 -0
- 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 +6 -2
- package/dist/graph/index.js +9 -2
- package/dist/graph/index.js.map +1 -1
- package/dist/graph/loops.d.ts +10 -0
- package/dist/graph/loops.js +172 -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 +13 -18
- package/dist/graph/validate-executable-graph.js.map +1 -1
- package/dist/graph/workflow-graph.d.ts +4 -0
- package/dist/graph/workflow-graph.js +7 -0
- package/dist/graph/workflow-graph.js.map +1 -1
- package/dist/index.d.ts +14 -7
- package/dist/index.js +19 -12
- package/dist/index.js.map +1 -1
- package/dist/lifecycle-events/batching-lifecycle-event-publisher.d.ts +26 -0
- package/dist/lifecycle-events/batching-lifecycle-event-publisher.js +121 -0
- package/dist/lifecycle-events/batching-lifecycle-event-publisher.js.map +1 -0
- package/dist/lifecycle-events/index.d.ts +6 -0
- package/dist/lifecycle-events/index.js +15 -0
- package/dist/lifecycle-events/index.js.map +1 -0
- package/dist/lifecycle-events/lifecycle-event-publisher.d.ts +6 -0
- package/dist/lifecycle-events/lifecycle-event-publisher.js +8 -0
- package/dist/lifecycle-events/lifecycle-event-publisher.js.map +1 -0
- package/dist/lifecycle-events/lifecycle-event.schema.d.ts +339 -0
- package/dist/lifecycle-events/lifecycle-event.schema.js +39 -0
- package/dist/lifecycle-events/lifecycle-event.schema.js.map +1 -0
- package/dist/lifecycle-events/lifecycle-event.types.d.ts +4 -0
- package/dist/lifecycle-events/lifecycle-event.types.js +3 -0
- package/dist/lifecycle-events/lifecycle-event.types.js.map +1 -0
- package/dist/logging/console-logger.d.ts +2 -0
- package/dist/logging/console-logger.js +18 -0
- package/dist/logging/console-logger.js.map +1 -0
- package/dist/logging/index.d.ts +2 -0
- package/dist/logging/index.js +6 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/logging/logger.types.d.ts +6 -0
- package/dist/logging/logger.types.js +3 -0
- package/dist/logging/logger.types.js.map +1 -0
- package/dist/queue/in-memory-work-queue.d.ts +3 -0
- package/dist/queue/in-memory-work-queue.js +7 -2
- package/dist/queue/in-memory-work-queue.js.map +1 -1
- package/dist/runtime/create-engine-runtime.d.ts +20 -0
- package/dist/runtime/create-engine-runtime.js +38 -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 +25 -34
- package/dist/serve.js.map +1 -1
- package/dist/server/api.types.d.ts +25 -0
- package/dist/server/api.types.js +3 -0
- package/dist/server/api.types.js.map +1 -0
- package/dist/server/create-engine-server.d.ts +9 -7
- package/dist/server/create-engine-server.js +4 -8
- 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 +3 -0
- package/dist/server/index.js +3 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/routes/workflow-executions.d.ts +2 -2
- package/dist/server/routes/workflow-executions.handlers.d.ts +4 -0
- package/dist/server/routes/workflow-executions.handlers.js +68 -0
- package/dist/server/routes/workflow-executions.handlers.js.map +1 -0
- package/dist/server/routes/workflow-executions.js +16 -21
- package/dist/server/routes/workflow-executions.js.map +1 -1
- package/dist/testing/start-engine-server.d.ts +1 -1
- package/dist/testing/start-engine-server.js.map +1 -1
- package/package.json +10 -7
package/dist/common/index.d.ts
CHANGED
package/dist/common/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UnimplementedError = exports.UnexpectedError = void 0;
|
|
3
|
+
exports.UnimplementedError = exports.UnexpectedError = exports.jsonValueSchema = void 0;
|
|
4
|
+
var json_schema_1 = require("./json.schema");
|
|
5
|
+
Object.defineProperty(exports, "jsonValueSchema", { enumerable: true, get: function () { return json_schema_1.jsonValueSchema; } });
|
|
4
6
|
var errors_1 = require("./errors");
|
|
5
7
|
Object.defineProperty(exports, "UnexpectedError", { enumerable: true, get: function () { return errors_1.UnexpectedError; } });
|
|
6
8
|
Object.defineProperty(exports, "UnimplementedError", { enumerable: true, get: function () { return errors_1.UnimplementedError; } });
|
package/dist/common/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;AACA,mCAA+D;AAAtD,yGAAA,eAAe,OAAA;AAAE,4GAAA,kBAAkB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;AACA,6CAAgD;AAAvC,8GAAA,eAAe,OAAA;AACxB,mCAA+D;AAAtD,yGAAA,eAAe,OAAA;AAAE,4GAAA,kBAAkB,OAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.jsonValueSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.jsonValueSchema = zod_1.z.lazy(() => zod_1.z.union([
|
|
6
|
+
zod_1.z.string(),
|
|
7
|
+
zod_1.z.number(),
|
|
8
|
+
zod_1.z.boolean(),
|
|
9
|
+
zod_1.z.null(),
|
|
10
|
+
zod_1.z.array(exports.jsonValueSchema),
|
|
11
|
+
zod_1.z.record(exports.jsonValueSchema),
|
|
12
|
+
]));
|
|
13
|
+
//# sourceMappingURL=json.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.schema.js","sourceRoot":"","sources":["../../src/common/json.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAKX,QAAA,eAAe,GAAyB,OAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAChE,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,QAAA,eAAe,CAAC;IACxB,OAAC,CAAC,MAAM,CAAC,QAAA,eAAe,CAAC;CACzB,CAAC,CACF,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { DataSource } from '@n8n/typeorm';
|
|
2
2
|
import type { ExecutionStore } from '../execution/execution-store';
|
|
3
|
+
import type { ExecutionViewStore } from '../execution/execution-view-store';
|
|
3
4
|
import type { StepStore } from '../execution/step-store';
|
|
4
|
-
export
|
|
5
|
+
export interface EngineStores {
|
|
5
6
|
executionStore: ExecutionStore;
|
|
6
7
|
stepStore: StepStore;
|
|
7
|
-
|
|
8
|
+
executionViewStore: ExecutionViewStore;
|
|
9
|
+
}
|
|
10
|
+
export declare function createStores(dataSource: DataSource): EngineStores;
|
|
@@ -3,11 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createStores = createStores;
|
|
4
4
|
const entities_1 = require("./entities");
|
|
5
5
|
const typeorm_execution_store_1 = require("./typeorm-execution-store");
|
|
6
|
+
const typeorm_execution_view_store_1 = require("./typeorm-execution-view-store");
|
|
6
7
|
const typeorm_step_store_1 = require("./typeorm-step-store");
|
|
7
8
|
function createStores(dataSource) {
|
|
9
|
+
const executions = dataSource.getRepository(entities_1.WorkflowExecution);
|
|
10
|
+
const steps = dataSource.getRepository(entities_1.WorkflowStepExecution);
|
|
8
11
|
return {
|
|
9
|
-
executionStore: new typeorm_execution_store_1.TypeOrmExecutionStore(
|
|
10
|
-
stepStore: new typeorm_step_store_1.TypeOrmStepStore(
|
|
12
|
+
executionStore: new typeorm_execution_store_1.TypeOrmExecutionStore(executions),
|
|
13
|
+
stepStore: new typeorm_step_store_1.TypeOrmStepStore(steps),
|
|
14
|
+
executionViewStore: new typeorm_execution_view_store_1.TypeOrmExecutionViewStore(executions, steps),
|
|
11
15
|
};
|
|
12
16
|
}
|
|
13
17
|
//# sourceMappingURL=create-stores.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-stores.js","sourceRoot":"","sources":["../../src/database/create-stores.ts"],"names":[],"mappings":";;;AAEA,yCAAsE;AACtE,uEAAkE;AAClE,6DAAwD;
|
|
1
|
+
{"version":3,"file":"create-stores.js","sourceRoot":"","sources":["../../src/database/create-stores.ts"],"names":[],"mappings":";;;AAEA,yCAAsE;AACtE,uEAAkE;AAClE,iFAA2E;AAC3E,6DAAwD;AAaxD,sBAA6B,UAAsB;IAClD,MAAM,UAAU,GAAG,UAAU,CAAC,aAAa,CAAC,4BAAiB,CAAC,CAAC;IAC/D,MAAM,KAAK,GAAG,UAAU,CAAC,aAAa,CAAC,gCAAqB,CAAC,CAAC;IAC9D,OAAO;QACN,cAAc,EAAE,IAAI,+CAAqB,CAAC,UAAU,CAAC;QACrD,SAAS,EAAE,IAAI,qCAAgB,CAAC,KAAK,CAAC;QACtC,kBAAkB,EAAE,IAAI,wDAAyB,CAAC,UAAU,EAAE,KAAK,CAAC;KACpE,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ExecutionMode, ExecutionStatus } from '../../execution/execution.types';
|
|
1
|
+
import type { ExecutionMode, ExecutionStatus, TriggerOutputs } from '../../execution/execution.types';
|
|
3
2
|
import type { WorkflowGraph } from '../../graph';
|
|
4
3
|
export declare class WorkflowExecution {
|
|
5
4
|
id: string;
|
|
@@ -7,9 +6,8 @@ export declare class WorkflowExecution {
|
|
|
7
6
|
status: ExecutionStatus;
|
|
8
7
|
mode: ExecutionMode;
|
|
9
8
|
graph: WorkflowGraph;
|
|
10
|
-
|
|
9
|
+
triggerOutputs: TriggerOutputs | null;
|
|
11
10
|
createdAt: Date;
|
|
12
11
|
updatedAt: Date;
|
|
13
12
|
finishedAt: Date | null;
|
|
14
|
-
setId(): void;
|
|
15
13
|
}
|
|
@@ -11,21 +11,16 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.WorkflowExecution = void 0;
|
|
13
13
|
const typeorm_1 = require("@n8n/typeorm");
|
|
14
|
-
const generate_id_1 = require("../generate-id");
|
|
15
14
|
let WorkflowExecution = class WorkflowExecution {
|
|
16
15
|
id;
|
|
17
16
|
workflowId;
|
|
18
17
|
status;
|
|
19
18
|
mode;
|
|
20
19
|
graph;
|
|
21
|
-
|
|
20
|
+
triggerOutputs;
|
|
22
21
|
createdAt;
|
|
23
22
|
updatedAt;
|
|
24
23
|
finishedAt;
|
|
25
|
-
setId() {
|
|
26
|
-
if (!this.id)
|
|
27
|
-
this.id = (0, generate_id_1.generateId)();
|
|
28
|
-
}
|
|
29
24
|
};
|
|
30
25
|
exports.WorkflowExecution = WorkflowExecution;
|
|
31
26
|
__decorate([
|
|
@@ -49,9 +44,9 @@ __decorate([
|
|
|
49
44
|
__metadata("design:type", Object)
|
|
50
45
|
], WorkflowExecution.prototype, "graph", void 0);
|
|
51
46
|
__decorate([
|
|
52
|
-
(0, typeorm_1.Column)('jsonb', { name: '
|
|
47
|
+
(0, typeorm_1.Column)('jsonb', { name: 'trigger_outputs', nullable: true }),
|
|
53
48
|
__metadata("design:type", Object)
|
|
54
|
-
], WorkflowExecution.prototype, "
|
|
49
|
+
], WorkflowExecution.prototype, "triggerOutputs", void 0);
|
|
55
50
|
__decorate([
|
|
56
51
|
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', type: 'timestamptz', precision: 3 }),
|
|
57
52
|
__metadata("design:type", Date)
|
|
@@ -64,12 +59,6 @@ __decorate([
|
|
|
64
59
|
(0, typeorm_1.Column)({ name: 'finished_at', type: 'timestamptz', nullable: true, precision: 3 }),
|
|
65
60
|
__metadata("design:type", Object)
|
|
66
61
|
], WorkflowExecution.prototype, "finishedAt", void 0);
|
|
67
|
-
__decorate([
|
|
68
|
-
(0, typeorm_1.BeforeInsert)(),
|
|
69
|
-
__metadata("design:type", Function),
|
|
70
|
-
__metadata("design:paramtypes", []),
|
|
71
|
-
__metadata("design:returntype", void 0)
|
|
72
|
-
], WorkflowExecution.prototype, "setId", null);
|
|
73
62
|
exports.WorkflowExecution = WorkflowExecution = __decorate([
|
|
74
63
|
(0, typeorm_1.Entity)('workflow_execution'),
|
|
75
64
|
(0, typeorm_1.Index)('idx_workflow_execution_workflow_id', ['workflowId']),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-execution.entity.js","sourceRoot":"","sources":["../../../src/database/entities/workflow-execution.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"workflow-execution.entity.js","sourceRoot":"","sources":["../../../src/database/entities/workflow-execution.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAOsB;AAYf,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAE7B,EAAE,CAAU;IAGZ,UAAU,CAAU;IAGpB,MAAM,CAAmB;IAGzB,IAAI,CAAiB;I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
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { StepSlots, StepStatus } from '../../execution/execution.types';
|
|
2
|
-
import type { StepError } from '../../execution/step-store';
|
|
1
|
+
import type { StepError, StepSlots, StepStatus } from '../../execution/execution.types';
|
|
3
2
|
export declare class WorkflowStepExecution {
|
|
4
3
|
id: string;
|
|
5
4
|
executionId: string;
|
|
6
5
|
nodeId: string;
|
|
6
|
+
iteration: number;
|
|
7
7
|
status: StepStatus;
|
|
8
8
|
outputs: StepSlots | null;
|
|
9
9
|
error: StepError | null;
|
|
@@ -16,6 +16,7 @@ let WorkflowStepExecution = class WorkflowStepExecution {
|
|
|
16
16
|
id;
|
|
17
17
|
executionId;
|
|
18
18
|
nodeId;
|
|
19
|
+
iteration;
|
|
19
20
|
status;
|
|
20
21
|
outputs;
|
|
21
22
|
error;
|
|
@@ -39,6 +40,10 @@ __decorate([
|
|
|
39
40
|
(0, typeorm_1.Column)('varchar', { name: 'node_id' }),
|
|
40
41
|
__metadata("design:type", String)
|
|
41
42
|
], WorkflowStepExecution.prototype, "nodeId", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)('int', { default: 0 }),
|
|
45
|
+
__metadata("design:type", Number)
|
|
46
|
+
], WorkflowStepExecution.prototype, "iteration", void 0);
|
|
42
47
|
__decorate([
|
|
43
48
|
(0, typeorm_1.Column)('varchar', { length: 32 }),
|
|
44
49
|
__metadata("design:type", String)
|
|
@@ -67,8 +72,7 @@ __decorate([
|
|
|
67
72
|
], WorkflowStepExecution.prototype, "setId", null);
|
|
68
73
|
exports.WorkflowStepExecution = WorkflowStepExecution = __decorate([
|
|
69
74
|
(0, typeorm_1.Entity)('workflow_step_execution'),
|
|
70
|
-
(0, typeorm_1.Index)('
|
|
71
|
-
|
|
72
|
-
})
|
|
75
|
+
(0, typeorm_1.Index)('uniq_workflow_step_execution_execution_id_node_id_iteration', ['executionId', 'nodeId', 'iteration'], { unique: true }),
|
|
76
|
+
(0, typeorm_1.Index)('idx_workflow_step_execution_failed', ['executionId'], { where: "status = 'failed'" })
|
|
73
77
|
], WorkflowStepExecution);
|
|
74
78
|
//# sourceMappingURL=workflow-step-execution.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-step-execution.entity.js","sourceRoot":"","sources":["../../../src/database/entities/workflow-step-execution.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAQsB;
|
|
1
|
+
{"version":3,"file":"workflow-step-execution.entity.js","sourceRoot":"","sources":["../../../src/database/entities/workflow-step-execution.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAQsB;AAGtB,gDAA4C;AASrC,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAEjC,EAAE,CAAU;IAGZ,WAAW,CAAU;IAGrB,MAAM,CAAU;IAGhB,SAAS,CAAU;IAGnB,MAAM,CAAc;IAGpB,OAAO,CAAoB;IAG3B,KAAK,CAAoB;IAGzB,SAAS,CAAQ;IAGjB,SAAS,CAAQ;IAGjB,KAAK;QACJ,IAAI,CAAC,IAAI,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,GAAG,IAAA,wBAAU,GAAE,CAAC;IACtC,CAAC;CACD,CAAA;;AA9BA;IADC,IAAA,uBAAa,EAAC,MAAM,CAAC;;iDACV;AAGZ;IADC,IAAA,gBAAM,EAAC,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;;0DACpB;AAGrB;IADC,IAAA,gBAAM,EAAC,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;qDACvB;AAGhB;IADC,IAAA,gBAAM,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;wDACX;AAGnB;IADC,IAAA,gBAAM,EAAC,SAAS,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;qDACd;AAGpB;IADC,IAAA,gBAAM,EAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACT;AAG3B;IADC,IAAA,gBAAM,EAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACX;AAGzB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;8BAChE,IAAI;wDAAC;AAGjB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;8BAChE,IAAI;wDAAC;AAGjB;IADC,IAAA,sBAAY,GAAE;;;;kDAGd;gCA/BW,qBAAqB;IAPjC,IAAA,gBAAM,EAAC,yBAAyB,CAAC;IACjC,IAAA,eAAK,EACL,6DAA6D,EAC7D,CAAC,aAAa,EAAE,QAAQ,EAAE,WAAW,CAAC,EACtC,EAAE,MAAM,EAAE,IAAI,EAAE,CAChB;IACA,IAAA,eAAK,EAAC,oCAAoC,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC;GAChF,qBAAqB,CAgCjC"}
|
package/dist/database/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { createDataSource } from './data-source';
|
|
2
2
|
export { createStores } from './create-stores';
|
|
3
|
+
export type { EngineStores } from './create-stores';
|
|
3
4
|
export { WorkflowExecution, WorkflowStepExecution } from './entities';
|
|
5
|
+
export { TypeOrmExecutionViewStore } from './typeorm-execution-view-store';
|
|
4
6
|
export { TypeOrmExecutionStore } from './typeorm-execution-store';
|
|
5
7
|
export { TypeOrmStepStore } from './typeorm-step-store';
|
package/dist/database/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TypeOrmStepStore = exports.TypeOrmExecutionStore = exports.WorkflowStepExecution = exports.WorkflowExecution = exports.createStores = exports.createDataSource = void 0;
|
|
3
|
+
exports.TypeOrmStepStore = exports.TypeOrmExecutionStore = exports.TypeOrmExecutionViewStore = exports.WorkflowStepExecution = exports.WorkflowExecution = exports.createStores = exports.createDataSource = void 0;
|
|
4
4
|
var data_source_1 = require("./data-source");
|
|
5
5
|
Object.defineProperty(exports, "createDataSource", { enumerable: true, get: function () { return data_source_1.createDataSource; } });
|
|
6
6
|
var create_stores_1 = require("./create-stores");
|
|
@@ -8,6 +8,8 @@ Object.defineProperty(exports, "createStores", { enumerable: true, get: function
|
|
|
8
8
|
var entities_1 = require("./entities");
|
|
9
9
|
Object.defineProperty(exports, "WorkflowExecution", { enumerable: true, get: function () { return entities_1.WorkflowExecution; } });
|
|
10
10
|
Object.defineProperty(exports, "WorkflowStepExecution", { enumerable: true, get: function () { return entities_1.WorkflowStepExecution; } });
|
|
11
|
+
var typeorm_execution_view_store_1 = require("./typeorm-execution-view-store");
|
|
12
|
+
Object.defineProperty(exports, "TypeOrmExecutionViewStore", { enumerable: true, get: function () { return typeorm_execution_view_store_1.TypeOrmExecutionViewStore; } });
|
|
11
13
|
var typeorm_execution_store_1 = require("./typeorm-execution-store");
|
|
12
14
|
Object.defineProperty(exports, "TypeOrmExecutionStore", { enumerable: true, get: function () { return typeorm_execution_store_1.TypeOrmExecutionStore; } });
|
|
13
15
|
var typeorm_step_store_1 = require("./typeorm-step-store");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/database/index.ts"],"names":[],"mappings":";;;AAAA,6CAAiD;AAAxC,+GAAA,gBAAgB,OAAA;AACzB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/database/index.ts"],"names":[],"mappings":";;;AAAA,6CAAiD;AAAxC,+GAAA,gBAAgB,OAAA;AACzB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AAErB,uCAAsE;AAA7D,6GAAA,iBAAiB,OAAA;AAAE,iHAAA,qBAAqB,OAAA;AACjD,+EAA2E;AAAlE,yIAAA,yBAAyB,OAAA;AAClC,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA;AAC9B,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA"}
|
|
@@ -13,7 +13,7 @@ class CreateWorkflowExecution1778529600000 {
|
|
|
13
13
|
{ name: 'status', type: 'varchar', length: '32' },
|
|
14
14
|
{ name: 'mode', type: 'varchar', length: '32' },
|
|
15
15
|
{ name: 'graph', type: 'jsonb' },
|
|
16
|
-
{ name: '
|
|
16
|
+
{ name: 'trigger_outputs', type: 'jsonb', isNullable: true },
|
|
17
17
|
{
|
|
18
18
|
name: 'created_at',
|
|
19
19
|
type: 'timestamptz',
|
|
@@ -11,6 +11,12 @@ class CreateWorkflowStepExecution1784890100000 {
|
|
|
11
11
|
{ name: 'id', type: 'uuid', isPrimary: true },
|
|
12
12
|
{ name: 'execution_id', type: 'uuid' },
|
|
13
13
|
{ name: 'node_id', type: 'varchar' },
|
|
14
|
+
{
|
|
15
|
+
name: 'iteration',
|
|
16
|
+
type: 'int',
|
|
17
|
+
default: 0,
|
|
18
|
+
comment: 'Which pass over a loop body this row belongs to. 0 for non-loops.',
|
|
19
|
+
},
|
|
14
20
|
{ name: 'status', type: 'varchar', length: '32' },
|
|
15
21
|
{
|
|
16
22
|
name: 'outputs',
|
|
@@ -39,10 +45,15 @@ class CreateWorkflowStepExecution1784890100000 {
|
|
|
39
45
|
],
|
|
40
46
|
indices: [
|
|
41
47
|
{
|
|
42
|
-
name: '
|
|
43
|
-
columnNames: ['execution_id', 'node_id'],
|
|
48
|
+
name: 'uniq_workflow_step_execution_execution_id_node_id_iteration',
|
|
49
|
+
columnNames: ['execution_id', 'node_id', 'iteration'],
|
|
44
50
|
isUnique: true,
|
|
45
51
|
},
|
|
52
|
+
{
|
|
53
|
+
name: 'idx_workflow_step_execution_failed',
|
|
54
|
+
columnNames: ['execution_id'],
|
|
55
|
+
where: "status = 'failed'",
|
|
56
|
+
},
|
|
46
57
|
],
|
|
47
58
|
foreignKeys: [
|
|
48
59
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1784890100000-CreateWorkflowStepExecution.js","sourceRoot":"","sources":["../../../src/database/migrations/1784890100000-CreateWorkflowStepExecution.ts"],"names":[],"mappings":";;;AAAA,0CAAqC;AAGrC,MAAM,KAAK,GAAG,yBAAyB,CAAC;AAExC;IACC,KAAK,CAAC,EAAE,CAAC,WAAwB;QAChC,MAAM,WAAW,CAAC,WAAW,CAC5B,IAAI,eAAK,CAAC;YACT,IAAI,EAAE,KAAK;YACX,OAAO,EAAE;gBACR,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE;gBAC7C,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE;gBACtC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;gBACpC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE;gBACjD;oBACC,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,OAAO;oBACb,UAAU,EAAE,IAAI;oBAChB,OAAO,EACN,4GAA4G;iBAC7G;gBACD;oBACC,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,OAAO;oBACb,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,sDAAsD;iBAC/D;gBACD;oBACC,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,aAAa;oBACnB,SAAS,EAAE,CAAC;oBACZ,OAAO,EAAE,sBAAsB;iBAC/B;gBACD;oBACC,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,aAAa;oBACnB,SAAS,EAAE,CAAC;oBACZ,OAAO,EAAE,sBAAsB;iBAC/B;aACD;YACD,OAAO,EAAE;gBAIR;oBACC,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"1784890100000-CreateWorkflowStepExecution.js","sourceRoot":"","sources":["../../../src/database/migrations/1784890100000-CreateWorkflowStepExecution.ts"],"names":[],"mappings":";;;AAAA,0CAAqC;AAGrC,MAAM,KAAK,GAAG,yBAAyB,CAAC;AAExC;IACC,KAAK,CAAC,EAAE,CAAC,WAAwB;QAChC,MAAM,WAAW,CAAC,WAAW,CAC5B,IAAI,eAAK,CAAC;YACT,IAAI,EAAE,KAAK;YACX,OAAO,EAAE;gBACR,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE;gBAC7C,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE;gBACtC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;gBACpC;oBACC,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,KAAK;oBACX,OAAO,EAAE,CAAC;oBACV,OAAO,EAAE,mEAAmE;iBAC5E;gBACD,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE;gBACjD;oBACC,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,OAAO;oBACb,UAAU,EAAE,IAAI;oBAChB,OAAO,EACN,4GAA4G;iBAC7G;gBACD;oBACC,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,OAAO;oBACb,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,sDAAsD;iBAC/D;gBACD;oBACC,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,aAAa;oBACnB,SAAS,EAAE,CAAC;oBACZ,OAAO,EAAE,sBAAsB;iBAC/B;gBACD;oBACC,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,aAAa;oBACnB,SAAS,EAAE,CAAC;oBACZ,OAAO,EAAE,sBAAsB;iBAC/B;aACD;YACD,OAAO,EAAE;gBAIR;oBACC,IAAI,EAAE,6DAA6D;oBACnE,WAAW,EAAE,CAAC,cAAc,EAAE,SAAS,EAAE,WAAW,CAAC;oBACrD,QAAQ,EAAE,IAAI;iBACd;gBAGD;oBACC,IAAI,EAAE,oCAAoC;oBAC1C,WAAW,EAAE,CAAC,cAAc,CAAC;oBAC7B,KAAK,EAAE,mBAAmB;iBAC1B;aACD;YACD,WAAW,EAAE;gBACZ;oBACC,WAAW,EAAE,CAAC,cAAc,CAAC;oBAC7B,mBAAmB,EAAE,oBAAoB;oBACzC,qBAAqB,EAAE,CAAC,IAAI,CAAC;oBAC7B,QAAQ,EAAE,SAAS;iBACnB;aACD;YACD,MAAM,EAAE;gBACP;oBACC,IAAI,EAAE,oCAAoC;oBAC1C,UAAU,EACT,gFAAgF;iBACjF;aACD;SACD,CAAC,CACF,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,WAAwB;QAClC,MAAM,WAAW,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;CACD"}
|
|
@@ -5,9 +5,7 @@ import type { ExecutionStatus } from '../execution/execution.types';
|
|
|
5
5
|
export declare class TypeOrmExecutionStore implements ExecutionStore {
|
|
6
6
|
private readonly repo;
|
|
7
7
|
constructor(repo: Repository<WorkflowExecution>);
|
|
8
|
-
createExecution(record: NewExecutionRecord): Promise<
|
|
9
|
-
id: string;
|
|
10
|
-
}>;
|
|
8
|
+
createExecution(record: NewExecutionRecord): Promise<void>;
|
|
11
9
|
loadExecution(id: string): Promise<ExecutionRecord>;
|
|
12
10
|
transitionStatus(id: string, from: ExecutionStatus, to: ExecutionStatus): Promise<boolean>;
|
|
13
11
|
finishExecution(id: string, status: 'completed' | 'failed'): Promise<boolean>;
|
|
@@ -10,10 +10,9 @@ class TypeOrmExecutionStore {
|
|
|
10
10
|
async createExecution(record) {
|
|
11
11
|
const execution = this.repo.create({ ...record, finishedAt: null });
|
|
12
12
|
await this.repo.insert(execution);
|
|
13
|
-
return { id: execution.id };
|
|
14
13
|
}
|
|
15
14
|
async loadExecution(id) {
|
|
16
|
-
const row = await this.repo.
|
|
15
|
+
const row = await this.repo.findOne({ where: { id } });
|
|
17
16
|
if (!row)
|
|
18
17
|
throw new execution_store_1.ExecutionNotFoundError(id);
|
|
19
18
|
return row;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeorm-execution-store.js","sourceRoot":"","sources":["../../src/database/typeorm-execution-store.ts"],"names":[],"mappings":";;;AAGA,kEAKsC;AAUtC;IAC8B,IAAI;IAAjC,YAA6B,IAAmC;oBAAnC,IAAI;IAAkC,CAAC;IAEpE,KAAK,CAAC,eAAe,CAAC,MAA0B;QAC/C,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAIpE,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,SAAyB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"typeorm-execution-store.js","sourceRoot":"","sources":["../../src/database/typeorm-execution-store.ts"],"names":[],"mappings":";;;AAGA,kEAKsC;AAUtC;IAC8B,IAAI;IAAjC,YAA6B,IAAmC;oBAAnC,IAAI;IAAkC,CAAC;IAEpE,KAAK,CAAC,eAAe,CAAC,MAA0B;QAC/C,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAIpE,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,SAAyB,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,EAAU;QAG7B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACvD,IAAI,CAAC,GAAG;YAAE,MAAM,IAAI,wCAAsB,CAAC,EAAE,CAAC,CAAC;QAC/C,OAAO,GAAG,CAAC;IACZ,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,EAAU,EAAE,IAAqB,EAAE,EAAmB;QAC5E,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;QAC5E,OAAO,MAAM,CAAC,QAAQ,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,EAAU,EAAE,MAA8B;QAC/D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CACpC,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EACzB,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,IAAI,EAAE,EAAE,CAClC,CAAC;QACF,OAAO,MAAM,CAAC,QAAQ,KAAK,CAAC,CAAC;IAC9B,CAAC;CACD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Repository } from '@n8n/typeorm';
|
|
2
|
+
import type { WorkflowExecution, WorkflowStepExecution } from './entities';
|
|
3
|
+
import type { ExecutionViewStore, ExecutionView, StepView } from '../execution/execution-view-store';
|
|
4
|
+
export declare class TypeOrmExecutionViewStore implements ExecutionViewStore {
|
|
5
|
+
private readonly executions;
|
|
6
|
+
private readonly steps;
|
|
7
|
+
constructor(executions: Repository<WorkflowExecution>, steps: Repository<WorkflowStepExecution>);
|
|
8
|
+
loadExecutionView(id: string): Promise<ExecutionView>;
|
|
9
|
+
loadStepViews(executionId: string): Promise<StepView[]>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeOrmExecutionViewStore = void 0;
|
|
4
|
+
const execution_store_1 = require("../execution/execution-store");
|
|
5
|
+
class TypeOrmExecutionViewStore {
|
|
6
|
+
executions;
|
|
7
|
+
steps;
|
|
8
|
+
constructor(executions, steps) {
|
|
9
|
+
this.executions = executions;
|
|
10
|
+
this.steps = steps;
|
|
11
|
+
}
|
|
12
|
+
async loadExecutionView(id) {
|
|
13
|
+
const row = await this.executions
|
|
14
|
+
.createQueryBuilder('execution')
|
|
15
|
+
.select('execution.id', 'id')
|
|
16
|
+
.addSelect('execution.workflow_id', 'workflowId')
|
|
17
|
+
.addSelect('execution.status', 'status')
|
|
18
|
+
.addSelect('execution.mode', 'mode')
|
|
19
|
+
.addSelect('execution.graph', 'graph')
|
|
20
|
+
.addSelect('execution.created_at', 'createdAt')
|
|
21
|
+
.addSelect('execution.updated_at', 'updatedAt')
|
|
22
|
+
.addSelect('execution.finished_at', 'finishedAt')
|
|
23
|
+
.where('execution.id = :id', { id })
|
|
24
|
+
.getRawOne();
|
|
25
|
+
if (!row)
|
|
26
|
+
throw new execution_store_1.ExecutionNotFoundError(id);
|
|
27
|
+
return row;
|
|
28
|
+
}
|
|
29
|
+
async loadStepViews(executionId) {
|
|
30
|
+
const rows = await this.steps
|
|
31
|
+
.createQueryBuilder('step')
|
|
32
|
+
.select('step.id', 'id')
|
|
33
|
+
.addSelect('step.node_id', 'nodeId')
|
|
34
|
+
.addSelect('step.iteration', 'iteration')
|
|
35
|
+
.addSelect('step.status', 'status')
|
|
36
|
+
.addSelect('step.outputs', 'outputs')
|
|
37
|
+
.addSelect('step.error', 'error')
|
|
38
|
+
.addSelect('step.created_at', 'createdAt')
|
|
39
|
+
.addSelect('step.updated_at', 'updatedAt')
|
|
40
|
+
.where('step.execution_id = :executionId', { executionId })
|
|
41
|
+
.orderBy('step.created_at', 'ASC')
|
|
42
|
+
.addOrderBy('step.node_id', 'ASC')
|
|
43
|
+
.addOrderBy('step.iteration', 'ASC')
|
|
44
|
+
.getRawMany();
|
|
45
|
+
return rows;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.TypeOrmExecutionViewStore = TypeOrmExecutionViewStore;
|
|
49
|
+
//# sourceMappingURL=typeorm-execution-view-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeorm-execution-view-store.js","sourceRoot":"","sources":["../../src/database/typeorm-execution-view-store.ts"],"names":[],"mappings":";;;AAGA,kEAAsE;AAetE;IAEmB,UAAU;IACV,KAAK;IAFvB,YACkB,UAAyC,EACzC,KAAwC;0BADxC,UAAU;qBACV,KAAK;IACpB,CAAC;IAEJ,KAAK,CAAC,iBAAiB,CAAC,EAAU;QACjC,MAAM,GAAG,GAA8B,MAAM,IAAI,CAAC,UAAU;aAC1D,kBAAkB,CAAC,WAAW,CAAC;aAC/B,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC;aAC5B,SAAS,CAAC,uBAAuB,EAAE,YAAY,CAAC;aAChD,SAAS,CAAC,kBAAkB,EAAE,QAAQ,CAAC;aACvC,SAAS,CAAC,gBAAgB,EAAE,MAAM,CAAC;aACnC,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAC;aACrC,SAAS,CAAC,sBAAsB,EAAE,WAAW,CAAC;aAC9C,SAAS,CAAC,sBAAsB,EAAE,WAAW,CAAC;aAC9C,SAAS,CAAC,uBAAuB,EAAE,YAAY,CAAC;aAChD,KAAK,CAAC,oBAAoB,EAAE,EAAE,EAAE,EAAE,CAAC;aACnC,SAAS,EAAE,CAAC;QACd,IAAI,CAAC,GAAG;YAAE,MAAM,IAAI,wCAAsB,CAAC,EAAE,CAAC,CAAC;QAC/C,OAAO,GAAG,CAAC;IACZ,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,WAAmB;QACtC,MAAM,IAAI,GAAe,MAAM,IAAI,CAAC,KAAK;aACvC,kBAAkB,CAAC,MAAM,CAAC;aAC1B,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC;aACvB,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC;aACnC,SAAS,CAAC,gBAAgB,EAAE,WAAW,CAAC;aACxC,SAAS,CAAC,aAAa,EAAE,QAAQ,CAAC;aAClC,SAAS,CAAC,cAAc,EAAE,SAAS,CAAC;aACpC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC;aAChC,SAAS,CAAC,iBAAiB,EAAE,WAAW,CAAC;aACzC,SAAS,CAAC,iBAAiB,EAAE,WAAW,CAAC;aACzC,KAAK,CAAC,kCAAkC,EAAE,EAAE,WAAW,EAAE,CAAC;aAC1D,OAAO,CAAC,iBAAiB,EAAE,KAAK,CAAC;aACjC,UAAU,CAAC,cAAc,EAAE,KAAK,CAAC;aACjC,UAAU,CAAC,gBAAgB,EAAE,KAAK,CAAC;aACnC,UAAU,EAAE,CAAC;QACf,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { type Repository } from '@n8n/typeorm';
|
|
2
2
|
import { WorkflowStepExecution } from './entities';
|
|
3
|
-
import { type StepSlots } from '../execution/execution.types';
|
|
4
|
-
import { type NewStepRecord, type
|
|
3
|
+
import { type StepError, type StepKey, type StepKeyId, type StepSlots } from '../execution/execution.types';
|
|
4
|
+
import { type NewStepRecord, type StepRecord, type StepStore, type StepSummary } from '../execution/step-store';
|
|
5
5
|
export declare class TypeOrmStepStore implements StepStore {
|
|
6
6
|
private readonly repo;
|
|
7
7
|
constructor(repo: Repository<WorkflowStepExecution>);
|
|
8
8
|
createSteps(executionId: string, records: NewStepRecord[]): Promise<Array<{
|
|
9
9
|
id: string;
|
|
10
|
-
|
|
11
|
-
}>>;
|
|
10
|
+
} & StepKey>>;
|
|
12
11
|
loadStep(id: string): Promise<StepRecord>;
|
|
13
12
|
claimStep(id: string): Promise<StepRecord | null>;
|
|
14
13
|
completeStep(id: string, outputs: StepSlots): Promise<boolean>;
|
|
15
14
|
cancelQueuedSteps(executionId: string): Promise<void>;
|
|
16
15
|
failStep(id: string, error: StepError): Promise<boolean>;
|
|
17
16
|
private transition;
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
loadStepsByKeys(executionId: string, keys: StepKey[]): Promise<Record<StepKeyId, StepRecord>>;
|
|
18
|
+
loadStepSummariesByKeys(executionId: string, keys: StepKey[]): Promise<Record<StepKeyId, StepSummary>>;
|
|
19
|
+
loadLatestStepSummaries(executionId: string, nodeIds: string[]): Promise<Record<string, StepSummary>>;
|
|
20
|
+
loadAllSteps(executionId: string): Promise<StepRecord[]>;
|
|
20
21
|
countSettledSteps(executionId: string): Promise<number>;
|
|
21
22
|
hasFailedSteps(executionId: string): Promise<boolean>;
|
|
22
23
|
}
|
|
@@ -7,6 +7,21 @@ const generate_id_1 = require("./generate-id");
|
|
|
7
7
|
const common_1 = require("../common");
|
|
8
8
|
const execution_types_1 = require("../execution/execution.types");
|
|
9
9
|
const step_store_1 = require("../execution/step-store");
|
|
10
|
+
const FILLED_OUTPUT_SLOTS = `COALESCE(
|
|
11
|
+
(SELECT array_agg(jsonb_typeof(slot.value) <> 'null' ORDER BY slot.ordinality)
|
|
12
|
+
FROM jsonb_array_elements(step.outputs) WITH ORDINALITY AS slot),
|
|
13
|
+
'{}'
|
|
14
|
+
)`;
|
|
15
|
+
function stepKeyFilter(keys) {
|
|
16
|
+
const tuples = [];
|
|
17
|
+
const parameters = {};
|
|
18
|
+
keys.forEach(({ nodeId, iteration }, index) => {
|
|
19
|
+
tuples.push(`(:n${index}, :i${index})`);
|
|
20
|
+
parameters[`n${index}`] = nodeId;
|
|
21
|
+
parameters[`i${index}`] = iteration;
|
|
22
|
+
});
|
|
23
|
+
return { fragment: `(step.node_id, step.iteration) IN (${tuples.join(', ')})`, parameters };
|
|
24
|
+
}
|
|
10
25
|
class TypeOrmStepStore {
|
|
11
26
|
repo;
|
|
12
27
|
constructor(repo) {
|
|
@@ -33,9 +48,13 @@ class TypeOrmStepStore {
|
|
|
33
48
|
.into(entities_1.WorkflowStepExecution)
|
|
34
49
|
.values(rows)
|
|
35
50
|
.orIgnore()
|
|
36
|
-
.returning(['id', 'nodeId'])
|
|
51
|
+
.returning(['id', 'nodeId', 'iteration'])
|
|
37
52
|
.execute();
|
|
38
|
-
return result.raw.map(({ id, node_id: nodeId }) => ({
|
|
53
|
+
return result.raw.map(({ id, node_id: nodeId, iteration }) => ({
|
|
54
|
+
id,
|
|
55
|
+
nodeId,
|
|
56
|
+
iteration,
|
|
57
|
+
}));
|
|
39
58
|
});
|
|
40
59
|
}
|
|
41
60
|
async loadStep(id) {
|
|
@@ -60,7 +79,7 @@ class TypeOrmStepStore {
|
|
|
60
79
|
SELECT 1 FROM workflow_step_execution sibling
|
|
61
80
|
WHERE sibling.execution_id = :executionId AND sibling.status = 'failed'
|
|
62
81
|
)`, { executionId: execution.id })
|
|
63
|
-
.returning(['id', 'executionId', 'nodeId'])
|
|
82
|
+
.returning(['id', 'executionId', 'nodeId', 'iteration'])
|
|
64
83
|
.execute();
|
|
65
84
|
const [row] = result.raw;
|
|
66
85
|
if (!row)
|
|
@@ -69,9 +88,9 @@ class TypeOrmStepStore {
|
|
|
69
88
|
id: row.id,
|
|
70
89
|
executionId: row.execution_id,
|
|
71
90
|
nodeId: row.node_id,
|
|
91
|
+
iteration: row.iteration,
|
|
72
92
|
status: 'running',
|
|
73
93
|
outputs: null,
|
|
74
|
-
error: null,
|
|
75
94
|
};
|
|
76
95
|
});
|
|
77
96
|
}
|
|
@@ -94,30 +113,57 @@ class TypeOrmStepStore {
|
|
|
94
113
|
const result = await this.repo.update({ id, status: from }, { ...fields, status: to });
|
|
95
114
|
return result.affected === 1;
|
|
96
115
|
}
|
|
97
|
-
async
|
|
98
|
-
if (
|
|
116
|
+
async loadStepsByKeys(executionId, keys) {
|
|
117
|
+
if (keys.length === 0)
|
|
99
118
|
return {};
|
|
100
|
-
const
|
|
101
|
-
|
|
119
|
+
const { fragment, parameters } = stepKeyFilter(keys);
|
|
120
|
+
const rows = await this.repo
|
|
121
|
+
.createQueryBuilder('step')
|
|
122
|
+
.where('step.execution_id = :executionId', { executionId })
|
|
123
|
+
.andWhere(fragment, parameters)
|
|
124
|
+
.getMany();
|
|
125
|
+
return Object.fromEntries(rows.map((row) => [(0, execution_types_1.stepKeyId)(row), row]));
|
|
126
|
+
}
|
|
127
|
+
async loadStepSummariesByKeys(executionId, keys) {
|
|
128
|
+
if (keys.length === 0)
|
|
129
|
+
return {};
|
|
130
|
+
const { fragment, parameters } = stepKeyFilter(keys);
|
|
131
|
+
const rows = await this.repo
|
|
132
|
+
.createQueryBuilder('step')
|
|
133
|
+
.select('step.id', 'id')
|
|
134
|
+
.addSelect('step.node_id', 'nodeId')
|
|
135
|
+
.addSelect('step.iteration', 'iteration')
|
|
136
|
+
.addSelect('step.status', 'status')
|
|
137
|
+
.addSelect(FILLED_OUTPUT_SLOTS, 'filledOutputSlots')
|
|
138
|
+
.where('step.execution_id = :executionId', { executionId })
|
|
139
|
+
.andWhere(fragment, parameters)
|
|
140
|
+
.getRawMany();
|
|
141
|
+
return Object.fromEntries(rows.map((row) => [(0, execution_types_1.stepKeyId)(row), row]));
|
|
102
142
|
}
|
|
103
|
-
async
|
|
143
|
+
async loadLatestStepSummaries(executionId, nodeIds) {
|
|
104
144
|
if (nodeIds.length === 0)
|
|
105
145
|
return {};
|
|
106
146
|
const rows = await this.repo
|
|
107
147
|
.createQueryBuilder('step')
|
|
148
|
+
.distinctOn(['step.node_id'])
|
|
108
149
|
.select('step.id', 'id')
|
|
109
150
|
.addSelect('step.node_id', 'nodeId')
|
|
151
|
+
.addSelect('step.iteration', 'iteration')
|
|
110
152
|
.addSelect('step.status', 'status')
|
|
111
|
-
.addSelect(
|
|
112
|
-
(SELECT array_agg(jsonb_typeof(slot.value) <> 'null' ORDER BY slot.ordinality)
|
|
113
|
-
FROM jsonb_array_elements(step.outputs) WITH ORDINALITY AS slot),
|
|
114
|
-
'{}'
|
|
115
|
-
)`, 'filledOutputSlots')
|
|
153
|
+
.addSelect(FILLED_OUTPUT_SLOTS, 'filledOutputSlots')
|
|
116
154
|
.where('step.execution_id = :executionId', { executionId })
|
|
117
155
|
.andWhere('step.node_id IN (:...nodeIds)', { nodeIds })
|
|
156
|
+
.orderBy('step.node_id')
|
|
157
|
+
.addOrderBy('step.iteration', 'DESC')
|
|
118
158
|
.getRawMany();
|
|
119
159
|
return Object.fromEntries(rows.map((row) => [row.nodeId, row]));
|
|
120
160
|
}
|
|
161
|
+
async loadAllSteps(executionId) {
|
|
162
|
+
return await this.repo.find({
|
|
163
|
+
where: { executionId },
|
|
164
|
+
order: { nodeId: 'ASC', iteration: 'ASC' },
|
|
165
|
+
});
|
|
166
|
+
}
|
|
121
167
|
async countSettledSteps(executionId) {
|
|
122
168
|
return await this.repo.count({
|
|
123
169
|
where: { executionId, status: (0, typeorm_1.In)([...execution_types_1.SETTLED_STEP_STATUSES]) },
|
|
@@ -130,6 +176,9 @@ class TypeOrmStepStore {
|
|
|
130
176
|
exports.TypeOrmStepStore = TypeOrmStepStore;
|
|
131
177
|
const CREATION_STATUSES = ['queued', 'completed', 'skipped'];
|
|
132
178
|
function assertCreatableRecord(record) {
|
|
179
|
+
if (!Number.isInteger(record.iteration) || record.iteration < 0) {
|
|
180
|
+
throw new common_1.UnexpectedError(`step for node ${record.nodeId} is created with iteration ${record.iteration}; iterations are non-negative integers`);
|
|
181
|
+
}
|
|
133
182
|
if (!CREATION_STATUSES.includes(record.status)) {
|
|
134
183
|
throw new common_1.UnexpectedError(`step for node ${record.nodeId} is created ${record.status}, a status only reachable through its transition method`);
|
|
135
184
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeorm-step-store.js","sourceRoot":"","sources":["../../src/database/typeorm-step-store.ts"],"names":[],"mappings":";;;AAAA,0CAAmD;AAEnD,yCAAmD;AACnD,+CAA2C;AAC3C,sCAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"typeorm-step-store.js","sourceRoot":"","sources":["../../src/database/typeorm-step-store.ts"],"names":[],"mappings":";;;AAAA,0CAAmD;AAEnD,yCAAmD;AACnD,+CAA2C;AAC3C,sCAA4C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AAS,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,CAAC,SAAS,GAAG,CAAC,EAAE,CAAC;QACjE,MAAM,IAAI,wBAAe,CACxB,iBAAiB,MAAM,CAAC,MAAM,8BAA8B,MAAM,CAAC,SAAS,wCAAwC,CACpH,CAAC;IACH,CAAC;IACD,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,wBAAe,CACxB,iBAAiB,MAAM,CAAC,MAAM,eAAe,MAAM,CAAC,MAAM,yDAAyD,CACnH,CAAC;IACH,CAAC;IACD,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;QACnE,MAAM,IAAI,wBAAe,CACxB,iBAAiB,MAAM,CAAC,MAAM,eAAe,MAAM,CAAC,MAAM,8DAA8D,CACxH,CAAC;IACH,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,KAAK,WAAW,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QACrE,MAAM,IAAI,wBAAe,CACxB,iBAAiB,MAAM,CAAC,MAAM,wIAAwI,CACtK,CAAC;IACH,CAAC;AACF,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { ExecutionMode, StepSlots } from '../execution';
|
|
2
2
|
import type { GraphNode } from '../graph';
|
|
3
|
+
import type { LifecycleEventCallback } from '../lifecycle-events';
|
|
3
4
|
export interface StepExecutionContext {
|
|
4
5
|
executionId: string;
|
|
5
6
|
stepId: string;
|
|
6
7
|
workflowId: string;
|
|
7
8
|
mode: ExecutionMode;
|
|
9
|
+
iteration: number;
|
|
8
10
|
}
|
|
9
11
|
export interface StepExecutionRequest {
|
|
10
12
|
node: GraphNode;
|
|
@@ -19,4 +21,5 @@ export interface IStepExecutor {
|
|
|
19
21
|
}
|
|
20
22
|
export interface ExternalDependencies {
|
|
21
23
|
v1StepExecutor?: IStepExecutor;
|
|
24
|
+
lifecycleEventCallback?: LifecycleEventCallback;
|
|
22
25
|
}
|