@n8n/engine 0.17.0 → 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 +2 -1
- package/dist/auth/authenticate.js +3 -2
- package/dist/auth/authenticate.js.map +1 -1
- package/dist/auth/identity-token.d.ts +3 -5
- package/dist/auth/identity-token.js +17 -38
- package/dist/auth/identity-token.js.map +1 -1
- package/dist/auth/index.d.ts +3 -1
- package/dist/auth/index.js +7 -5
- package/dist/auth/index.js.map +1 -1
- 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 +2 -0
- 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 +0 -1
- package/dist/database/entities/workflow-execution.entity.js +0 -11
- package/dist/database/entities/workflow-execution.entity.js.map +1 -1
- package/dist/database/entities/workflow-step-execution.entity.d.ts +1 -2
- 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 +3 -1
- package/dist/database/index.js.map +1 -1
- package/dist/database/typeorm-execution-store.d.ts +1 -3
- package/dist/database/typeorm-execution-store.js +0 -1
- 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 +3 -2
- package/dist/database/typeorm-step-store.js +6 -1
- 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.js.map +1 -1
- 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 +10 -1
- package/dist/execution/execution-start-handler.js.map +1 -1
- package/dist/execution/execution-store.d.ts +2 -3
- 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 +6 -0
- package/dist/execution/execution.types.js.map +1 -1
- package/dist/execution/index.d.ts +4 -2
- package/dist/execution/index.js +3 -1
- package/dist/execution/index.js.map +1 -1
- package/dist/execution/loop-ledger.d.ts +2 -2
- package/dist/execution/loop-ledger.js +4 -3
- package/dist/execution/loop-ledger.js.map +1 -1
- package/dist/execution/settlement.js.map +1 -1
- package/dist/execution/start-execution.service.d.ts +1 -0
- package/dist/execution/start-execution.service.js +5 -3
- package/dist/execution/start-execution.service.js.map +1 -1
- package/dist/execution/step-ready-handler.d.ts +4 -1
- package/dist/execution/step-ready-handler.js +37 -3
- package/dist/execution/step-ready-handler.js.map +1 -1
- package/dist/execution/step-settled-handler.d.ts +3 -1
- package/dist/execution/step-settled-handler.js +25 -7
- package/dist/execution/step-settled-handler.js.map +1 -1
- package/dist/execution/step-store.d.ts +2 -9
- 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/index.d.ts +2 -1
- package/dist/graph/index.js +3 -1
- package/dist/graph/index.js.map +1 -1
- package/dist/graph/loops.d.ts +1 -1
- package/dist/graph/loops.js +11 -0
- package/dist/graph/loops.js.map +1 -1
- package/dist/graph/validate-executable-graph.js +4 -3
- 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 +9 -5
- package/dist/index.js +13 -1
- 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 +3 -1
- package/dist/runtime/create-engine-runtime.js +19 -7
- package/dist/runtime/create-engine-runtime.js.map +1 -1
- package/dist/serve.js +7 -4
- 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 -1
- package/dist/server/create-engine-server.js +3 -3
- package/dist/server/create-engine-server.js.map +1 -1
- package/dist/server/index.d.ts +2 -0
- 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 +10 -13
- package/dist/server/routes/workflow-executions.js.map +1 -1
- package/dist/testing/start-engine-server.d.ts +2 -3
- package/dist/testing/start-engine-server.js +2 -2
- package/dist/testing/start-engine-server.js.map +1 -1
- package/package.json +10 -9
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,8 +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
5
|
export interface EngineStores {
|
|
5
6
|
executionStore: ExecutionStore;
|
|
6
7
|
stepStore: StepStore;
|
|
8
|
+
executionViewStore: ExecutionViewStore;
|
|
7
9
|
}
|
|
8
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"}
|
|
@@ -11,7 +11,6 @@ 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;
|
|
@@ -22,10 +21,6 @@ let WorkflowExecution = class WorkflowExecution {
|
|
|
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([
|
|
@@ -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;IAGrB,KAAK,CAAiB;IAGtB,cAAc,CAAyB;IAGvC,SAAS,CAAQ;IAGjB,SAAS,CAAQ;IAGjB,UAAU,CAAe;CACzB,CAAA;;AAzBA;IADC,IAAA,uBAAa,EAAC,MAAM,CAAC;;6CACV;AAGZ;IADC,IAAA,gBAAM,EAAC,SAAS,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;;qDACvB;AAGpB;IADC,IAAA,gBAAM,EAAC,SAAS,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;iDACT;AAGzB;IADC,IAAA,gBAAM,EAAC,SAAS,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;+CACb;AAGrB;IADC,IAAA,gBAAM,EAAC,OAAO,CAAC;;gDACM;AAGtB;IADC,IAAA,gBAAM,EAAC,OAAO,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACtB;AAGvC;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;8BAChE,IAAI;oDAAC;AAGjB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;8BAChE,IAAI;oDAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;;qDAC1D;4BA1Bb,iBAAiB;IAH7B,IAAA,gBAAM,EAAC,oBAAoB,CAAC;IAC5B,IAAA,eAAK,EAAC,oCAAoC,EAAE,CAAC,YAAY,CAAC,CAAC;IAC3D,IAAA,eAAK,EAAC,+BAA+B,EAAE,CAAC,QAAQ,CAAC,CAAC;GACtC,iBAAiB,CA2B7B"}
|
|
@@ -1,5 +1,4 @@
|
|
|
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;
|
|
@@ -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,qBAA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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
|
@@ -2,5 +2,6 @@ export { createDataSource } from './data-source';
|
|
|
2
2
|
export { createStores } from './create-stores';
|
|
3
3
|
export type { EngineStores } from './create-stores';
|
|
4
4
|
export { WorkflowExecution, WorkflowStepExecution } from './entities';
|
|
5
|
+
export { TypeOrmExecutionViewStore } from './typeorm-execution-view-store';
|
|
5
6
|
export { TypeOrmExecutionStore } from './typeorm-execution-store';
|
|
6
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;AAErB,uCAAsE;AAA7D,6GAAA,iBAAiB,OAAA;AAAE,iHAAA,qBAAqB,OAAA;AACjD,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA;AAC9B,2DAAwD;AAA/C,sHAAA,gBAAgB,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"}
|
|
@@ -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,7 +10,6 @@ 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
15
|
const row = await this.repo.findOne({ where: { id } });
|
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
import { type Repository } from '@n8n/typeorm';
|
|
2
2
|
import { WorkflowStepExecution } from './entities';
|
|
3
|
-
import { type StepKey, type StepKeyId, 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>);
|
|
@@ -17,6 +17,7 @@ export declare class TypeOrmStepStore implements StepStore {
|
|
|
17
17
|
loadStepsByKeys(executionId: string, keys: StepKey[]): Promise<Record<StepKeyId, StepRecord>>;
|
|
18
18
|
loadStepSummariesByKeys(executionId: string, keys: StepKey[]): Promise<Record<StepKeyId, StepSummary>>;
|
|
19
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
|
}
|
|
@@ -91,7 +91,6 @@ class TypeOrmStepStore {
|
|
|
91
91
|
iteration: row.iteration,
|
|
92
92
|
status: 'running',
|
|
93
93
|
outputs: null,
|
|
94
|
-
error: null,
|
|
95
94
|
};
|
|
96
95
|
});
|
|
97
96
|
}
|
|
@@ -159,6 +158,12 @@ class TypeOrmStepStore {
|
|
|
159
158
|
.getRawMany();
|
|
160
159
|
return Object.fromEntries(rows.map((row) => [row.nodeId, row]));
|
|
161
160
|
}
|
|
161
|
+
async loadAllSteps(executionId) {
|
|
162
|
+
return await this.repo.find({
|
|
163
|
+
where: { executionId },
|
|
164
|
+
order: { nodeId: 'ASC', iteration: 'ASC' },
|
|
165
|
+
});
|
|
166
|
+
}
|
|
162
167
|
async countSettledSteps(executionId) {
|
|
163
168
|
return await this.repo.count({
|
|
164
169
|
where: { executionId, status: (0, typeorm_1.In)([...execution_types_1.SETTLED_STEP_STATUSES]) },
|
|
@@ -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":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AM,iBAAiB,GAA0B,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;AAMpF,SAAS,qBAAqB,CAAC,MAK9B;IACA,IAAI,CAAC,MAAM,CAAC,SAAS,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
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type JsonValue } from '../common';
|
|
2
|
+
import type { BatchStepConfig } from '../graph';
|
|
3
|
+
import type { StepSlots } from './execution.types';
|
|
4
|
+
export interface LoopReader {
|
|
5
|
+
readOriginalItems(): Promise<JsonValue>;
|
|
6
|
+
readArrivals(iteration: number): Promise<JsonValue[]>;
|
|
7
|
+
}
|
|
8
|
+
export declare function runBatchStep(config: BatchStepConfig, iteration: number, reader: LoopReader): Promise<StepSlots>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runBatchStep = runBatchStep;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const loop_ledger_1 = require("./loop-ledger");
|
|
6
|
+
async function runBatchStep(config, iteration, reader) {
|
|
7
|
+
const originalItems = asList(await reader.readOriginalItems(), 'the batch node input');
|
|
8
|
+
const start = iteration * config.batchSize;
|
|
9
|
+
const slice = originalItems.slice(start, start + config.batchSize);
|
|
10
|
+
if (slice.length > 0)
|
|
11
|
+
return slot(loop_ledger_1.LOOP_SLOT, slice);
|
|
12
|
+
const arrivals = await reader.readArrivals(iteration);
|
|
13
|
+
const accumulated = arrivals.flatMap((arrival, index) => asList(arrival, `arrival ${index} of the batch node`));
|
|
14
|
+
if (accumulated.length === 0)
|
|
15
|
+
return [null, null];
|
|
16
|
+
return slot(loop_ledger_1.DONE_SLOT, accumulated);
|
|
17
|
+
}
|
|
18
|
+
function slot(filled, value) {
|
|
19
|
+
return filled === loop_ledger_1.DONE_SLOT ? [value, null] : [null, value];
|
|
20
|
+
}
|
|
21
|
+
function asList(value, displayName) {
|
|
22
|
+
if (value === null || value === undefined)
|
|
23
|
+
return [];
|
|
24
|
+
if (Array.isArray(value))
|
|
25
|
+
return value;
|
|
26
|
+
throw new common_1.UnexpectedError(`${displayName} holds ${typeof value}, and a batch node slices a list`);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=batch-step.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-step.js","sourceRoot":"","sources":["../../src/execution/batch-step.ts"],"names":[],"mappings":";;;AAAA,sCAA4D;AAG5D,+CAAqD;AAqB9C,KAAK,uBACX,MAAuB,EACvB,SAAiB,EACjB,MAAkB;IAElB,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,MAAM,CAAC,iBAAiB,EAAE,EAAE,sBAAsB,CAAC,CAAC;IACvF,MAAM,KAAK,GAAG,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IAC3C,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAEnE,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC,uBAAS,EAAE,KAAK,CAAC,CAAC;IAEpD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACtD,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CACvD,MAAM,CAAC,OAAO,EAAE,WAAW,KAAK,oBAAoB,CAAC,CACrD,CAAC;IAEF,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAElD,OAAO,IAAI,CAAC,uBAAS,EAAE,WAAW,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,IAAI,CAAC,MAAc,EAAE,KAAkB;IAC/C,OAAO,MAAM,KAAK,uBAAS,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,MAAM,CAAC,KAAgB,EAAE,WAAmB;IACpD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACrD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACvC,MAAM,IAAI,wBAAe,CAAC,GAAG,WAAW,UAAU,OAAO,KAAK,kCAAkC,CAAC,CAAC;AACnG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completion.js","sourceRoot":"","sources":["../../src/execution/completion.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"completion.js","sourceRoot":"","sources":["../../src/execution/completion.ts"],"names":[],"mappings":";;;AAaA,mCACC,KAAqB,EACrB,SAAsB,EACtB,kBAAuC;IAEvC,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAElC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC;QACtE,MAAM,QAAQ,GAAG,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC1D,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QAI7C,QAAQ,IAAI,QAAQ,GAAG,CAAC,GAAG,QAAQ,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;QAChE,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS;YAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,MAAM,MAAM,IAAI,SAAS,EAAE,CAAC;QAChC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,QAAQ,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ExecutionViewStore, ExecutionView, StepView } from './execution-view-store';
|
|
2
|
+
export declare class ExecutionQueryService {
|
|
3
|
+
private readonly viewStore;
|
|
4
|
+
constructor(viewStore: ExecutionViewStore);
|
|
5
|
+
getExecution(id: string): Promise<ExecutionView>;
|
|
6
|
+
getSteps(id: string): Promise<StepView[]>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExecutionQueryService = void 0;
|
|
4
|
+
class ExecutionQueryService {
|
|
5
|
+
viewStore;
|
|
6
|
+
constructor(viewStore) {
|
|
7
|
+
this.viewStore = viewStore;
|
|
8
|
+
}
|
|
9
|
+
async getExecution(id) {
|
|
10
|
+
return await this.viewStore.loadExecutionView(id);
|
|
11
|
+
}
|
|
12
|
+
async getSteps(id) {
|
|
13
|
+
return await this.viewStore.loadStepViews(id);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.ExecutionQueryService = ExecutionQueryService;
|
|
17
|
+
//# sourceMappingURL=execution-query.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-query.service.js","sourceRoot":"","sources":["../../src/execution/execution-query.service.ts"],"names":[],"mappings":";;;AAOA;IAC8B,SAAS;IAAtC,YAA6B,SAA6B;yBAA7B,SAAS;IAAuB,CAAC;IAG9D,KAAK,CAAC,YAAY,CAAC,EAAU;QAC5B,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;IACnD,CAAC;IAGD,KAAK,CAAC,QAAQ,CAAC,EAAU;QACxB,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC;CACD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LifecycleEventPublisher } from '../lifecycle-events';
|
|
1
2
|
import type { ExecutionEnqueuedEvent, OrchestrationMessage, WorkQueue } from '../queue';
|
|
2
3
|
import type { ExecutionStore } from './execution-store';
|
|
3
4
|
import type { StepStore } from './step-store';
|
|
@@ -5,6 +6,7 @@ export declare class ExecutionStartHandler {
|
|
|
5
6
|
private readonly executionStore;
|
|
6
7
|
private readonly stepStore;
|
|
7
8
|
private readonly orchestrationQueue;
|
|
8
|
-
|
|
9
|
+
private readonly lifecycleEventPublisher;
|
|
10
|
+
constructor(executionStore: ExecutionStore, stepStore: StepStore, orchestrationQueue: WorkQueue<OrchestrationMessage>, lifecycleEventPublisher: LifecycleEventPublisher);
|
|
9
11
|
handle(event: ExecutionEnqueuedEvent): Promise<void>;
|
|
10
12
|
}
|
|
@@ -8,16 +8,25 @@ class ExecutionStartHandler {
|
|
|
8
8
|
executionStore;
|
|
9
9
|
stepStore;
|
|
10
10
|
orchestrationQueue;
|
|
11
|
-
|
|
11
|
+
lifecycleEventPublisher;
|
|
12
|
+
constructor(executionStore, stepStore, orchestrationQueue, lifecycleEventPublisher) {
|
|
12
13
|
this.executionStore = executionStore;
|
|
13
14
|
this.stepStore = stepStore;
|
|
14
15
|
this.orchestrationQueue = orchestrationQueue;
|
|
16
|
+
this.lifecycleEventPublisher = lifecycleEventPublisher;
|
|
15
17
|
}
|
|
16
18
|
async handle(event) {
|
|
17
19
|
const claimed = await this.executionStore.transitionStatus(event.executionId, 'queued', 'running');
|
|
18
20
|
if (!claimed)
|
|
19
21
|
return;
|
|
20
22
|
const execution = await this.executionStore.loadExecution(event.executionId);
|
|
23
|
+
this.lifecycleEventPublisher.publish({
|
|
24
|
+
type: 'execution:started',
|
|
25
|
+
executionId: execution.id,
|
|
26
|
+
workflowId: execution.workflowId,
|
|
27
|
+
mode: execution.mode,
|
|
28
|
+
at: new Date().toISOString(),
|
|
29
|
+
});
|
|
21
30
|
const trigger = (0, graph_1.findTriggerNode)(execution.graph);
|
|
22
31
|
if (!trigger) {
|
|
23
32
|
throw new common_1.UnexpectedError(`Execution ${event.executionId} has no trigger node in its graph`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-start-handler.js","sourceRoot":"","sources":["../../src/execution/execution-start-handler.ts"],"names":[],"mappings":";;;AAAA,sCAA4C;AAC5C,oCAA2C;
|
|
1
|
+
{"version":3,"file":"execution-start-handler.js","sourceRoot":"","sources":["../../src/execution/execution-start-handler.ts"],"names":[],"mappings":";;;AAAA,sCAA4C;AAC5C,oCAA2C;AAI3C,uDAA4D;AAW5D;IAEmB,cAAc;IACd,SAAS;IACT,kBAAkB;IAClB,uBAAuB;IAJzC,YACkB,cAA8B,EAC9B,SAAoB,EACpB,kBAAmD,EACnD,uBAAgD;8BAHhD,cAAc;yBACd,SAAS;kCACT,kBAAkB;uCAClB,uBAAuB;IACtC,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,KAA6B;QAEzC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,gBAAgB,CACzD,KAAK,CAAC,WAAW,EACjB,QAAQ,EACR,SAAS,CACT,CAAC;QACF,IAAI,CAAC,OAAO;YAAE,OAAO;QAErB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAI7E,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC;YACpC,IAAI,EAAE,mBAAmB;YACzB,WAAW,EAAE,SAAS,CAAC,EAAE;YACzB,UAAU,EAAE,SAAS,CAAC,UAAU;YAChC,IAAI,EAAE,SAAS,CAAC,IAAI;YACpB,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SAC5B,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,IAAA,uBAAe,EAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACjD,IAAI,CAAC,OAAO,EAAE,CAAC;YAGd,MAAM,IAAI,wBAAe,CAAC,aAAa,KAAK,CAAC,WAAW,mCAAmC,CAAC,CAAC;QAC9F,CAAC;QAOD,MAAM,CAAC,WAAW,CAAC,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,WAAW,EAAE;YACzE;gBACC,MAAM,EAAE,OAAO,CAAC,EAAE;gBAClB,SAAS,EAAE,CAAC;gBACZ,MAAM,EAAE,WAAW;gBACnB,OAAO,EAAE,SAAS,CAAC,cAAc,IAAI,yCAAuB;aAC5D;SACD,CAAC,CAAC;QACH,IAAI,CAAC,WAAW,EAAE,CAAC;YAClB,MAAM,IAAI,wBAAe,CACxB,8BAA8B,KAAK,CAAC,WAAW,oCAAoC,CACnF,CAAC;QACH,CAAC;QAGD,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC;YACrC,IAAI,EAAE,cAAc;YACpB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,MAAM,EAAE,WAAW,CAAC,EAAE;SACtB,CAAC,CAAC;IACJ,CAAC;CACD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { WorkflowGraph } from '../graph';
|
|
2
2
|
import type { ExecutionMode, ExecutionStatus, TriggerOutputs } from './execution.types';
|
|
3
3
|
export interface NewExecutionRecord {
|
|
4
|
+
id: string;
|
|
4
5
|
workflowId: string;
|
|
5
6
|
status: ExecutionStatus;
|
|
6
7
|
mode: ExecutionMode;
|
|
@@ -20,9 +21,7 @@ export declare class ExecutionNotFoundError extends Error {
|
|
|
20
21
|
constructor(executionId: string);
|
|
21
22
|
}
|
|
22
23
|
export interface ExecutionStore {
|
|
23
|
-
createExecution(record: NewExecutionRecord): Promise<
|
|
24
|
-
id: string;
|
|
25
|
-
}>;
|
|
24
|
+
createExecution(record: NewExecutionRecord): Promise<void>;
|
|
26
25
|
loadExecution(id: string): Promise<ExecutionRecord>;
|
|
27
26
|
transitionStatus(id: string, from: ExecutionStatus, to: ExecutionStatus): Promise<boolean>;
|
|
28
27
|
finishExecution(id: string, status: 'completed' | 'failed'): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-store.js","sourceRoot":"","sources":["../../src/execution/execution-store.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"execution-store.js","sourceRoot":"","sources":["../../src/execution/execution-store.ts"],"names":[],"mappings":";;;AA6BA,4BAAoC,SAAQ,KAAK;IAC3B,WAAW;IAAhC,YAAqB,WAAmB;QACvC,KAAK,CAAC,wBAAwB,WAAW,EAAE,CAAC,CAAC;2BADzB,WAAW;QAE/B,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACtC,CAAC;CACD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { WorkflowGraph } from '../graph';
|
|
2
|
+
import type { ExecutionMode, ExecutionStatus, StepError, StepSlots, StepStatus } from './execution.types';
|
|
3
|
+
export interface ExecutionView {
|
|
4
|
+
id: string;
|
|
5
|
+
workflowId: string;
|
|
6
|
+
status: ExecutionStatus;
|
|
7
|
+
mode: ExecutionMode;
|
|
8
|
+
graph: WorkflowGraph;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
updatedAt: Date;
|
|
11
|
+
finishedAt: Date | null;
|
|
12
|
+
}
|
|
13
|
+
export interface StepView {
|
|
14
|
+
id: string;
|
|
15
|
+
nodeId: string;
|
|
16
|
+
iteration: number;
|
|
17
|
+
status: StepStatus;
|
|
18
|
+
outputs: StepSlots | null;
|
|
19
|
+
error: StepError | null;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
updatedAt: Date;
|
|
22
|
+
}
|
|
23
|
+
export interface ExecutionViewStore {
|
|
24
|
+
loadExecutionView(id: string): Promise<ExecutionView>;
|
|
25
|
+
loadStepViews(executionId: string): Promise<StepView[]>;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-view-store.js","sourceRoot":"","sources":["../../src/execution/execution-view-store.ts"],"names":[],"mappings":""}
|
|
@@ -7,6 +7,12 @@ export declare function isSettledStatus(status: StepStatus): boolean;
|
|
|
7
7
|
export type StepSlots = JsonValue[];
|
|
8
8
|
export type TriggerOutputs = StepSlots;
|
|
9
9
|
export declare const DEFAULT_TRIGGER_OUTPUTS: TriggerOutputs;
|
|
10
|
+
export interface StepError {
|
|
11
|
+
name: string;
|
|
12
|
+
message: string;
|
|
13
|
+
stack?: string;
|
|
14
|
+
details?: JsonValue;
|
|
15
|
+
}
|
|
10
16
|
export interface StepKey {
|
|
11
17
|
nodeId: string;
|
|
12
18
|
iteration: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution.types.js","sourceRoot":"","sources":["../../src/execution/execution.types.ts"],"names":[],"mappings":";;;;;AAoBa,QAAA,qBAAqB,GAA0B;IAC3D,WAAW;IACX,QAAQ;IACR,SAAS;IACT,WAAW;CACX,CAAC;AAEF,yBAAgC,MAAkB;IACjD,OAAO,QAAA,qBAAqB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC/C,CAAC;AAuBY,QAAA,uBAAuB,GAAmB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"execution.types.js","sourceRoot":"","sources":["../../src/execution/execution.types.ts"],"names":[],"mappings":";;;;;AAoBa,QAAA,qBAAqB,GAA0B;IAC3D,WAAW;IACX,QAAQ;IACR,SAAS;IACT,WAAW;CACX,CAAC;AAEF,yBAAgC,MAAkB;IACjD,OAAO,QAAA,qBAAqB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC/C,CAAC;AAuBY,QAAA,uBAAuB,GAAmB,EAAE,CAAC;AA0B1D,mBAA0B,EAAE,MAAM,EAAE,SAAS,EAAW;IACvD,OAAO,GAAG,MAAM,IAAI,SAAS,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
export { StartExecutionService } from './start-execution.service';
|
|
2
2
|
export type { StartExecutionRequest, StartExecutionResult, } from './start-execution.service';
|
|
3
3
|
export { stepKeyId } from './execution.types';
|
|
4
|
-
export type { ExecutionMode, ExecutionStatus, StepKey, StepKeyId, StepSlots, StepStatus, TriggerOutputs, } from './execution.types';
|
|
4
|
+
export type { ExecutionMode, ExecutionStatus, StepError, StepKey, StepKeyId, StepSlots, StepStatus, TriggerOutputs, } from './execution.types';
|
|
5
5
|
export { ExecutionNotFoundError } from './execution-store';
|
|
6
6
|
export type { ExecutionRecord, ExecutionStore, NewExecutionRecord } from './execution-store';
|
|
7
|
+
export type { ExecutionViewStore, ExecutionView, StepView } from './execution-view-store';
|
|
7
8
|
export { StepNotFoundError } from './step-store';
|
|
8
|
-
export type { NewStepRecord,
|
|
9
|
+
export type { NewStepRecord, StepRecord, StepStore, StepSummary } from './step-store';
|
|
9
10
|
export { ExecutionStartHandler } from './execution-start-handler';
|
|
11
|
+
export { ExecutionQueryService } from './execution-query.service';
|
|
10
12
|
export { OrchestrationWorker } from './orchestration-worker';
|
|
11
13
|
export { StepSettledHandler } from './step-settled-handler';
|
|
12
14
|
export { StepReadyHandler } from './step-ready-handler';
|