@n8n/engine 0.14.0 → 0.15.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/build.tsbuildinfo +1 -1
- package/dist/common/errors.d.ts +3 -0
- package/dist/common/errors.js +8 -1
- package/dist/common/errors.js.map +1 -1
- package/dist/common/index.d.ts +1 -1
- package/dist/common/index.js +2 -1
- package/dist/common/index.js.map +1 -1
- package/dist/database/entities/workflow-step-execution.entity.d.ts +2 -3
- package/dist/database/entities/workflow-step-execution.entity.js +3 -1
- package/dist/database/entities/workflow-step-execution.entity.js.map +1 -1
- package/dist/database/migrations/1784890100000-CreateWorkflowStepExecution.js +2 -1
- package/dist/database/migrations/1784890100000-CreateWorkflowStepExecution.js.map +1 -1
- package/dist/database/typeorm-execution-store.d.ts +1 -0
- package/dist/database/typeorm-execution-store.js +4 -0
- package/dist/database/typeorm-execution-store.js.map +1 -1
- package/dist/database/typeorm-step-store.d.ts +9 -4
- package/dist/database/typeorm-step-store.js +56 -4
- package/dist/database/typeorm-step-store.js.map +1 -1
- package/dist/dependencies/external-dependencies.d.ts +3 -4
- package/dist/execution/execution-start-handler.d.ts +3 -3
- package/dist/execution/execution-start-handler.js +18 -18
- package/dist/execution/execution-start-handler.js.map +1 -1
- package/dist/execution/execution-store.d.ts +1 -0
- package/dist/execution/execution.types.d.ts +2 -0
- package/dist/execution/index.d.ts +4 -1
- package/dist/execution/index.js +7 -1
- package/dist/execution/index.js.map +1 -1
- package/dist/execution/orchestration-worker.d.ts +3 -1
- package/dist/execution/orchestration-worker.js +10 -3
- package/dist/execution/orchestration-worker.js.map +1 -1
- package/dist/execution/start-execution.service.d.ts +3 -2
- package/dist/execution/start-execution.service.js +5 -1
- package/dist/execution/start-execution.service.js.map +1 -1
- package/dist/execution/step-completed-handler.d.ts +13 -0
- package/dist/execution/step-completed-handler.js +74 -0
- package/dist/execution/step-completed-handler.js.map +1 -0
- package/dist/execution/step-ready-handler.d.ts +16 -0
- package/dist/execution/step-ready-handler.js +112 -0
- package/dist/execution/step-ready-handler.js.map +1 -0
- package/dist/execution/step-store.d.ts +11 -5
- package/dist/execution/step-store.js.map +1 -1
- package/dist/execution/step-worker.d.ts +9 -0
- package/dist/execution/step-worker.js +30 -0
- package/dist/execution/step-worker.js.map +1 -0
- package/dist/execution/validate-step-context.d.ts +4 -0
- package/dist/execution/validate-step-context.js +15 -0
- package/dist/execution/validate-step-context.js.map +1 -0
- package/dist/graph/index.d.ts +2 -1
- package/dist/graph/index.js +5 -1
- package/dist/graph/index.js.map +1 -1
- package/dist/graph/validate-executable-graph.d.ts +5 -0
- package/dist/graph/validate-executable-graph.js +41 -0
- package/dist/graph/validate-executable-graph.js.map +1 -0
- package/dist/graph/workflow-graph-queries.d.ts +1 -0
- package/dist/graph/workflow-graph-queries.js +10 -0
- package/dist/graph/workflow-graph-queries.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/queue/index.d.ts +1 -1
- package/dist/queue/index.js.map +1 -1
- package/dist/queue/work-queue.types.d.ts +6 -1
- package/dist/serve.js +10 -5
- package/dist/serve.js.map +1 -1
- package/dist/server/routes/workflow-executions.js +10 -0
- package/dist/server/routes/workflow-executions.js.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StepCompletedHandler = void 0;
|
|
4
|
+
const graph_1 = require("../graph");
|
|
5
|
+
const validate_step_context_1 = require("./validate-step-context");
|
|
6
|
+
class StepCompletedHandler {
|
|
7
|
+
executionStore;
|
|
8
|
+
stepStore;
|
|
9
|
+
stepQueue;
|
|
10
|
+
constructor(executionStore, stepStore, stepQueue) {
|
|
11
|
+
this.executionStore = executionStore;
|
|
12
|
+
this.stepStore = stepStore;
|
|
13
|
+
this.stepQueue = stepQueue;
|
|
14
|
+
}
|
|
15
|
+
async handle(event) {
|
|
16
|
+
const [step, execution] = await Promise.all([
|
|
17
|
+
this.stepStore.loadStep(event.stepId),
|
|
18
|
+
this.executionStore.loadExecution(event.executionId),
|
|
19
|
+
]);
|
|
20
|
+
(0, validate_step_context_1.validateStepContext)(step, execution);
|
|
21
|
+
if (step.status === 'failed') {
|
|
22
|
+
await this.executionStore.finishExecution(execution.id, 'failed');
|
|
23
|
+
await this.stepStore.cancelQueuedSteps(execution.id);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (execution.status !== 'running')
|
|
27
|
+
return;
|
|
28
|
+
const planned = step.status === 'completed' ? await this.planSuccessors(execution, step.nodeId) : 0;
|
|
29
|
+
if (planned > 0)
|
|
30
|
+
return;
|
|
31
|
+
await this.finishExecutionIfDone(execution.id);
|
|
32
|
+
}
|
|
33
|
+
async finishExecutionIfDone(executionId) {
|
|
34
|
+
if (await this.stepStore.hasActiveSteps(executionId))
|
|
35
|
+
return;
|
|
36
|
+
const failed = await this.stepStore.hasFailedSteps(executionId);
|
|
37
|
+
await this.executionStore.finishExecution(executionId, failed ? 'failed' : 'completed');
|
|
38
|
+
}
|
|
39
|
+
async planSuccessors(execution, nodeId) {
|
|
40
|
+
const readyNodeIds = await this.readySuccessorNodeIds(execution, nodeId);
|
|
41
|
+
if (readyNodeIds.length === 0)
|
|
42
|
+
return 0;
|
|
43
|
+
const created = await this.stepStore.createSteps(readyNodeIds.map((readyNodeId) => ({
|
|
44
|
+
executionId: execution.id,
|
|
45
|
+
nodeId: readyNodeId,
|
|
46
|
+
status: 'queued',
|
|
47
|
+
})));
|
|
48
|
+
for (const { id: stepId } of created) {
|
|
49
|
+
await this.stepQueue.publish({
|
|
50
|
+
type: 'step:ready',
|
|
51
|
+
executionId: execution.id,
|
|
52
|
+
stepId,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return created.length;
|
|
56
|
+
}
|
|
57
|
+
async readySuccessorNodeIds(execution, nodeId) {
|
|
58
|
+
const successors = (0, graph_1.getSuccessorNodeIds)(execution.graph, nodeId).map((id) => ({
|
|
59
|
+
id,
|
|
60
|
+
predecessorIds: (0, graph_1.getPredecessorNodeIds)(execution.graph, id),
|
|
61
|
+
}));
|
|
62
|
+
const predecessorsToCheck = successors
|
|
63
|
+
.flatMap(({ predecessorIds }) => predecessorIds)
|
|
64
|
+
.filter((id) => id !== nodeId);
|
|
65
|
+
const completed = predecessorsToCheck.length === 0
|
|
66
|
+
? new Set()
|
|
67
|
+
: await this.stepStore.loadCompletedNodeIds(execution.id, predecessorsToCheck);
|
|
68
|
+
return successors
|
|
69
|
+
.filter(({ predecessorIds }) => predecessorIds.every((id) => id === nodeId || completed.has(id)))
|
|
70
|
+
.map(({ id }) => id);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.StepCompletedHandler = StepCompletedHandler;
|
|
74
|
+
//# sourceMappingURL=step-completed-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-completed-handler.js","sourceRoot":"","sources":["../../src/execution/step-completed-handler.ts"],"names":[],"mappings":";;;AAAA,oCAAsE;AAItE,mEAA8D;AAc9D;IAEmB,cAAc;IACd,SAAS;IACT,SAAS;IAH3B,YACkB,cAA8B,EAC9B,SAAoB,EACpB,SAAiC;8BAFjC,cAAc;yBACd,SAAS;yBACT,SAAS;IACxB,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,KAAyB;QACrC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC3C,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC;YACrC,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC;SACpD,CAAC,CAAC;QACH,IAAA,2CAAmB,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAIrC,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;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,CAAC,EAAE,CAAC,CAAC,CAChE;aACA,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;IACvB,CAAC;CACD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ExternalDependencies } from '../dependencies';
|
|
2
|
+
import type { OrchestrationMessage, StepReadyEvent, WorkQueue } from '../queue';
|
|
3
|
+
import type { ExecutionStore } from './execution-store';
|
|
4
|
+
import type { StepStore } from './step-store';
|
|
5
|
+
export declare class StepReadyHandler {
|
|
6
|
+
private readonly executionStore;
|
|
7
|
+
private readonly stepStore;
|
|
8
|
+
private readonly orchestrationQueue;
|
|
9
|
+
private readonly dependencies;
|
|
10
|
+
constructor(executionStore: ExecutionStore, stepStore: StepStore, orchestrationQueue: WorkQueue<OrchestrationMessage>, dependencies: ExternalDependencies);
|
|
11
|
+
handle(event: StepReadyEvent): Promise<void>;
|
|
12
|
+
private runStep;
|
|
13
|
+
private assertOutputFiredForSuccessors;
|
|
14
|
+
private gatherInputs;
|
|
15
|
+
private executorFor;
|
|
16
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StepReadyHandler = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const validate_step_context_1 = require("./validate-step-context");
|
|
6
|
+
class StepReadyHandler {
|
|
7
|
+
executionStore;
|
|
8
|
+
stepStore;
|
|
9
|
+
orchestrationQueue;
|
|
10
|
+
dependencies;
|
|
11
|
+
constructor(executionStore, stepStore, orchestrationQueue, dependencies) {
|
|
12
|
+
this.executionStore = executionStore;
|
|
13
|
+
this.stepStore = stepStore;
|
|
14
|
+
this.orchestrationQueue = orchestrationQueue;
|
|
15
|
+
this.dependencies = dependencies;
|
|
16
|
+
}
|
|
17
|
+
async handle(event) {
|
|
18
|
+
const step = await this.stepStore.claimStep(event.stepId);
|
|
19
|
+
if (!step)
|
|
20
|
+
return;
|
|
21
|
+
const execution = await this.executionStore.loadExecution(event.executionId);
|
|
22
|
+
const node = (0, validate_step_context_1.validateStepContext)(step, execution);
|
|
23
|
+
const executor = this.executorFor(step, node);
|
|
24
|
+
if (execution.status !== 'running') {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const inputs = await this.gatherInputs(execution, step);
|
|
28
|
+
let run;
|
|
29
|
+
try {
|
|
30
|
+
run = {
|
|
31
|
+
ok: true,
|
|
32
|
+
outputs: await this.runStep(step, execution, node, inputs, executor),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
run = { ok: false, error };
|
|
37
|
+
}
|
|
38
|
+
const recorded = run.ok
|
|
39
|
+
? await this.stepStore.completeStep(event.stepId, run.outputs)
|
|
40
|
+
: await this.stepStore.failStep(event.stepId, toStepError(run.error));
|
|
41
|
+
if (!recorded)
|
|
42
|
+
return;
|
|
43
|
+
await this.orchestrationQueue.publish({
|
|
44
|
+
type: 'step:completed',
|
|
45
|
+
executionId: event.executionId,
|
|
46
|
+
stepId: event.stepId,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
async runStep(step, execution, node, inputs, executor) {
|
|
50
|
+
const { outputs } = await executor.execute({
|
|
51
|
+
node,
|
|
52
|
+
inputs,
|
|
53
|
+
context: {
|
|
54
|
+
executionId: execution.id,
|
|
55
|
+
stepId: step.id,
|
|
56
|
+
workflowId: execution.workflowId,
|
|
57
|
+
mode: execution.mode,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
if (outputs.length > 1) {
|
|
61
|
+
throw new common_1.UnimplementedError(`step ${step.id} runs node ${step.nodeId}, which produced ${outputs.length} output slots; only output slot 0 is supported yet`);
|
|
62
|
+
}
|
|
63
|
+
this.assertOutputFiredForSuccessors(step, execution, outputs);
|
|
64
|
+
return outputs;
|
|
65
|
+
}
|
|
66
|
+
assertOutputFiredForSuccessors(step, execution, outputs) {
|
|
67
|
+
const hasSuccessors = execution.graph.edges.some((edge) => edge.from === step.nodeId);
|
|
68
|
+
if (hasSuccessors && (outputs.length === 0 || outputs[0] === null)) {
|
|
69
|
+
throw new common_1.UnimplementedError(`step ${step.id} runs node ${step.nodeId}, which did not fire output slot 0 despite having successors; branch selection is not supported yet`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async gatherInputs(execution, step) {
|
|
73
|
+
const incoming = execution.graph.edges.filter((edge) => edge.to === step.nodeId);
|
|
74
|
+
if (incoming.length === 0) {
|
|
75
|
+
throw new common_1.UnexpectedError(`step ${step.id} runs node ${step.nodeId}, which has no predecessor in the execution graph`);
|
|
76
|
+
}
|
|
77
|
+
if (incoming.length > 1) {
|
|
78
|
+
throw new common_1.UnexpectedError(`step ${step.id} runs node ${step.nodeId}, which has ${incoming.length} incoming edges; validated graphs have at most one edge per input slot`);
|
|
79
|
+
}
|
|
80
|
+
const [edge] = incoming;
|
|
81
|
+
if (edge.outputIndex !== 0 || edge.inputIndex !== 0) {
|
|
82
|
+
throw new common_1.UnexpectedError(`step ${step.id} runs node ${step.nodeId} through edge slots ${edge.outputIndex} → ${edge.inputIndex}; validated graphs only use slot 0`);
|
|
83
|
+
}
|
|
84
|
+
const outputsByNodeId = await this.stepStore.loadStepOutputs(execution.id, [edge.from]);
|
|
85
|
+
const predecessorOutputs = outputsByNodeId[edge.from];
|
|
86
|
+
if (!predecessorOutputs) {
|
|
87
|
+
throw new common_1.UnexpectedError(`step ${step.id} reads node ${edge.from}, whose step has not completed`);
|
|
88
|
+
}
|
|
89
|
+
if (predecessorOutputs.length > 1) {
|
|
90
|
+
throw new common_1.UnexpectedError(`step ${step.id} reads node ${edge.from}, whose step recorded more than one output slot; the write-time guard admits only slot 0`);
|
|
91
|
+
}
|
|
92
|
+
return [predecessorOutputs[0] ?? null];
|
|
93
|
+
}
|
|
94
|
+
executorFor(step, node) {
|
|
95
|
+
if (node.type === 'v1-node') {
|
|
96
|
+
const executor = this.dependencies.v1StepExecutor;
|
|
97
|
+
if (!executor) {
|
|
98
|
+
throw new common_1.UnimplementedError(`step ${step.id}: no executor configured for v1-node steps; the host must supply one in integrated mode`);
|
|
99
|
+
}
|
|
100
|
+
return executor;
|
|
101
|
+
}
|
|
102
|
+
throw new common_1.UnimplementedError(`step ${step.id}: no executor for step type ${node.type}`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.StepReadyHandler = StepReadyHandler;
|
|
106
|
+
function toStepError(error) {
|
|
107
|
+
if (error instanceof Error) {
|
|
108
|
+
return { name: error.name, message: error.message, stack: error.stack };
|
|
109
|
+
}
|
|
110
|
+
return { name: 'Error', message: String(error) };
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=step-ready-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-ready-handler.js","sourceRoot":"","sources":["../../src/execution/step-ready-handler.ts"],"names":[],"mappings":";;;AAAA,sCAAgE;AAOhE,mEAA8D;AAW9D;IAEmB,cAAc;IACd,SAAS;IACT,kBAAkB;IAClB,YAAY;IAJ9B,YACkB,cAA8B,EAC9B,SAAoB,EACpB,kBAAmD,EACnD,YAAkC;8BAHlC,cAAc;yBACd,SAAS;kCACT,kBAAkB;4BAClB,YAAY;IAC3B,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,KAAqB;QAEjC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC1D,IAAI,CAAC,IAAI;YAAE,OAAO;QAOlB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAC7E,MAAM,IAAI,GAAG,IAAA,2CAAmB,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAClD,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAA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AC;YAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC;YAClD,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACf,MAAM,IAAI,2BAAkB,CAC3B,QAAQ,IAAI,CAAC,EAAE,yFAAyF,CACxG,CAAC;YACH,CAAC;YACD,OAAO,QAAQ,CAAC;QACjB,CAAC;QAED,MAAM,IAAI,2BAAkB,CAAC,QAAQ,IAAI,CAAC,EAAE,+BAA+B,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IACzF,CAAC;CACD;;AAED,SAAS,WAAW,CAAC,KAAc;IAClC,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC5B,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;IACzE,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AAClD,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { JsonValue } from '../common';
|
|
2
|
-
import type { StepStatus } from './execution.types';
|
|
2
|
+
import type { StepSlots, StepStatus } from './execution.types';
|
|
3
3
|
export interface NewStepRecord {
|
|
4
4
|
executionId: string;
|
|
5
5
|
nodeId: string;
|
|
6
6
|
status: StepStatus;
|
|
7
|
+
outputs?: StepSlots;
|
|
7
8
|
}
|
|
8
9
|
export interface StepError {
|
|
9
10
|
name: string;
|
|
@@ -16,7 +17,7 @@ export interface StepRecord {
|
|
|
16
17
|
executionId: string;
|
|
17
18
|
nodeId: string;
|
|
18
19
|
status: StepStatus;
|
|
19
|
-
outputs:
|
|
20
|
+
outputs: StepSlots | null;
|
|
20
21
|
error: StepError | null;
|
|
21
22
|
}
|
|
22
23
|
export declare class StepNotFoundError extends Error {
|
|
@@ -26,10 +27,15 @@ export declare class StepNotFoundError extends Error {
|
|
|
26
27
|
export interface StepStore {
|
|
27
28
|
createSteps(records: NewStepRecord[]): Promise<Array<{
|
|
28
29
|
id: string;
|
|
30
|
+
nodeId: string;
|
|
29
31
|
}>>;
|
|
30
32
|
loadStep(id: string): Promise<StepRecord>;
|
|
31
|
-
claimStep(id: string): Promise<
|
|
32
|
-
completeStep(id: string, outputs:
|
|
33
|
+
claimStep(id: string): Promise<StepRecord | null>;
|
|
34
|
+
completeStep(id: string, outputs: StepSlots): Promise<boolean>;
|
|
33
35
|
failStep(id: string, error: StepError): Promise<boolean>;
|
|
34
|
-
|
|
36
|
+
cancelQueuedSteps(executionId: string): Promise<void>;
|
|
37
|
+
loadStepOutputs(executionId: string, nodeIds: string[]): Promise<Record<string, StepSlots | null>>;
|
|
38
|
+
loadCompletedNodeIds(executionId: string, nodeIds: string[]): Promise<Set<string>>;
|
|
39
|
+
hasActiveSteps(executionId: string): Promise<boolean>;
|
|
40
|
+
hasFailedSteps(executionId: string): Promise<boolean>;
|
|
35
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-store.js","sourceRoot":"","sources":["../../src/execution/step-store.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"step-store.js","sourceRoot":"","sources":["../../src/execution/step-store.ts"],"names":[],"mappings":";;;AAsCA,uBAA+B,SAAQ,KAAK;IACtB,MAAM;IAA3B,YAAqB,MAAc;QAClC,KAAK,CAAC,mBAAmB,MAAM,EAAE,CAAC,CAAC;sBADf,MAAM;QAE1B,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IACjC,CAAC;CACD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StepMessage, WorkQueue } from '../queue';
|
|
2
|
+
import type { StepReadyHandler } from './step-ready-handler';
|
|
3
|
+
export declare class StepWorker {
|
|
4
|
+
private readonly stepQueue;
|
|
5
|
+
private readonly readyHandler;
|
|
6
|
+
constructor(stepQueue: WorkQueue<StepMessage>, readyHandler: StepReadyHandler);
|
|
7
|
+
start(): void;
|
|
8
|
+
stop(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StepWorker = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
class StepWorker {
|
|
6
|
+
stepQueue;
|
|
7
|
+
readyHandler;
|
|
8
|
+
constructor(stepQueue, readyHandler) {
|
|
9
|
+
this.stepQueue = stepQueue;
|
|
10
|
+
this.readyHandler = readyHandler;
|
|
11
|
+
}
|
|
12
|
+
start() {
|
|
13
|
+
this.stepQueue.start(async (message) => {
|
|
14
|
+
switch (message.type) {
|
|
15
|
+
case 'step:ready':
|
|
16
|
+
await this.readyHandler.handle(message);
|
|
17
|
+
break;
|
|
18
|
+
default: {
|
|
19
|
+
const unhandled = message.type;
|
|
20
|
+
throw new common_1.UnimplementedError(`step worker received an unimplemented message type: ${String(unhandled)}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
async stop() {
|
|
26
|
+
await this.stepQueue.stop();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.StepWorker = StepWorker;
|
|
30
|
+
//# sourceMappingURL=step-worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-worker.js","sourceRoot":"","sources":["../../src/execution/step-worker.ts"],"names":[],"mappings":";;;AAAA,sCAA+C;AAQ/C;IAEmB,SAAS;IACT,YAAY;IAF9B,YACkB,SAAiC,EACjC,YAA8B;yBAD9B,SAAS;4BACT,YAAY;IAC3B,CAAC;IAEJ,KAAK;QACJ,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;YACtC,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;gBACtB,KAAK,YAAY;oBAChB,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;oBACxC,MAAM;gBACP,SAAS,CAAC;oBAGT,MAAM,SAAS,GAAU,OAAO,CAAC,IAAI,CAAC;oBACtC,MAAM,IAAI,2BAAkB,CAC3B,uDAAuD,MAAM,CAAC,SAAS,CAAC,EAAE,CAC1E,CAAC;gBACH,CAAC;YACF,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,IAAI;QACT,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;CACD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateStepContext = validateStepContext;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
function validateStepContext(step, execution) {
|
|
6
|
+
if (step.executionId !== execution.id) {
|
|
7
|
+
throw new common_1.UnexpectedError(`step ${step.id} belongs to execution ${step.executionId}, but the event claims ${execution.id}`);
|
|
8
|
+
}
|
|
9
|
+
const node = execution.graph.nodes.find((candidate) => candidate.id === step.nodeId);
|
|
10
|
+
if (!node) {
|
|
11
|
+
throw new common_1.UnexpectedError(`step ${step.id} references node ${step.nodeId}, which is absent from the execution graph`);
|
|
12
|
+
}
|
|
13
|
+
return node;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=validate-step-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-step-context.js","sourceRoot":"","sources":["../../src/execution/validate-step-context.ts"],"names":[],"mappings":";;;AAAA,sCAA4C;AAY5C,6BAAoC,IAAgB,EAAE,SAA0B;IAC/E,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,EAAE,EAAE,CAAC;QACvC,MAAM,IAAI,wBAAe,CACxB,QAAQ,IAAI,CAAC,EAAE,yBAAyB,IAAI,CAAC,WAAW,0BAA0B,SAAS,CAAC,EAAE,EAAE,CAChG,CAAC;IACH,CAAC;IAED,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC;IACrF,IAAI,CAAC,IAAI,EAAE,CAAC;QACX,MAAM,IAAI,wBAAe,CACxB,QAAQ,IAAI,CAAC,EAAE,oBAAoB,IAAI,CAAC,MAAM,4CAA4C,CAC1F,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC"}
|
package/dist/graph/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export type { GraphEdge, GraphNode, StepConfig, StepType, WorkflowGraph, } from './workflow-graph';
|
|
2
|
-
export { findTriggerNode, getSuccessorNodeIds } from './workflow-graph-queries';
|
|
2
|
+
export { findTriggerNode, getPredecessorNodeIds, getSuccessorNodeIds, } from './workflow-graph-queries';
|
|
3
|
+
export { GraphValidationError, validateExecutableGraph } from './validate-executable-graph';
|
package/dist/graph/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSuccessorNodeIds = exports.findTriggerNode = void 0;
|
|
3
|
+
exports.validateExecutableGraph = exports.GraphValidationError = exports.getSuccessorNodeIds = exports.getPredecessorNodeIds = exports.findTriggerNode = void 0;
|
|
4
4
|
var workflow_graph_queries_1 = require("./workflow-graph-queries");
|
|
5
5
|
Object.defineProperty(exports, "findTriggerNode", { enumerable: true, get: function () { return workflow_graph_queries_1.findTriggerNode; } });
|
|
6
|
+
Object.defineProperty(exports, "getPredecessorNodeIds", { enumerable: true, get: function () { return workflow_graph_queries_1.getPredecessorNodeIds; } });
|
|
6
7
|
Object.defineProperty(exports, "getSuccessorNodeIds", { enumerable: true, get: function () { return workflow_graph_queries_1.getSuccessorNodeIds; } });
|
|
8
|
+
var validate_executable_graph_1 = require("./validate-executable-graph");
|
|
9
|
+
Object.defineProperty(exports, "GraphValidationError", { enumerable: true, get: function () { return validate_executable_graph_1.GraphValidationError; } });
|
|
10
|
+
Object.defineProperty(exports, "validateExecutableGraph", { enumerable: true, get: function () { return validate_executable_graph_1.validateExecutableGraph; } });
|
|
7
11
|
//# sourceMappingURL=index.js.map
|
package/dist/graph/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/graph/index.ts"],"names":[],"mappings":";;;AAOA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/graph/index.ts"],"names":[],"mappings":";;;AAOA,mEAIkC;AAHjC,yHAAA,eAAe,OAAA;AACf,+HAAA,qBAAqB,OAAA;AACrB,6HAAA,mBAAmB,OAAA;AAEpB,yEAA4F;AAAnF,iIAAA,oBAAoB,OAAA;AAAE,oIAAA,uBAAuB,OAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GraphValidationError = void 0;
|
|
4
|
+
exports.validateExecutableGraph = validateExecutableGraph;
|
|
5
|
+
const common_1 = require("../common");
|
|
6
|
+
class GraphValidationError extends Error {
|
|
7
|
+
constructor(message) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.name = 'GraphValidationError';
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.GraphValidationError = GraphValidationError;
|
|
13
|
+
function validateExecutableGraph(graph) {
|
|
14
|
+
const triggers = graph.nodes.filter((node) => node.type === 'trigger');
|
|
15
|
+
if (triggers.length === 0) {
|
|
16
|
+
throw new GraphValidationError('Graph has no trigger node to start from');
|
|
17
|
+
}
|
|
18
|
+
if (triggers.length > 1) {
|
|
19
|
+
throw new GraphValidationError('Graph must have exactly one trigger node');
|
|
20
|
+
}
|
|
21
|
+
if (graph.edges.some((edge) => edge.isBackEdge)) {
|
|
22
|
+
throw new common_1.UnimplementedError('Graphs with back-edges (loops) are not supported yet');
|
|
23
|
+
}
|
|
24
|
+
for (const edge of graph.edges) {
|
|
25
|
+
if (edge.outputIndex !== 0) {
|
|
26
|
+
throw new common_1.UnimplementedError(`Edge ${edge.from} → ${edge.to} leaves output slot ${edge.outputIndex}; only output slot 0 is supported yet`);
|
|
27
|
+
}
|
|
28
|
+
if (edge.inputIndex !== 0) {
|
|
29
|
+
throw new common_1.UnimplementedError(`Edge ${edge.from} → ${edge.to} arrives at input slot ${edge.inputIndex}; only input slot 0 is supported yet`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const seenInputSlots = new Set();
|
|
33
|
+
for (const edge of graph.edges) {
|
|
34
|
+
const slot = `${edge.to}#${edge.inputIndex}`;
|
|
35
|
+
if (seenInputSlots.has(slot)) {
|
|
36
|
+
throw new common_1.UnimplementedError(`Node ${edge.to} has more than one edge into input slot ${edge.inputIndex}; converging branches on one slot is not supported yet`);
|
|
37
|
+
}
|
|
38
|
+
seenInputSlots.add(slot);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=validate-executable-graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-executable-graph.js","sourceRoot":"","sources":["../../src/graph/validate-executable-graph.ts"],"names":[],"mappings":";;;;AAAA,sCAA+C;AAI/C,0BAAkC,SAAQ,KAAK;IAC9C,YAAY,OAAe;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACpC,CAAC;CACD;;AAUD,iCAAwC,KAAoB;IAC3D,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;IACvE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAA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AAC,IAAI,CAAC,CAAC;IAC1B,CAAC;AACF,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { GraphNode, WorkflowGraph } from './workflow-graph';
|
|
2
2
|
export declare function findTriggerNode(graph: WorkflowGraph): GraphNode | undefined;
|
|
3
3
|
export declare function getSuccessorNodeIds(graph: WorkflowGraph, nodeId: string): string[];
|
|
4
|
+
export declare function getPredecessorNodeIds(graph: WorkflowGraph, nodeId: string): string[];
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findTriggerNode = findTriggerNode;
|
|
4
4
|
exports.getSuccessorNodeIds = getSuccessorNodeIds;
|
|
5
|
+
exports.getPredecessorNodeIds = getPredecessorNodeIds;
|
|
5
6
|
function findTriggerNode(graph) {
|
|
6
7
|
return graph.nodes.find((node) => node.type === 'trigger');
|
|
7
8
|
}
|
|
@@ -14,4 +15,13 @@ function getSuccessorNodeIds(graph, nodeId) {
|
|
|
14
15
|
}
|
|
15
16
|
return successors;
|
|
16
17
|
}
|
|
18
|
+
function getPredecessorNodeIds(graph, nodeId) {
|
|
19
|
+
const predecessors = [];
|
|
20
|
+
for (const edge of graph.edges) {
|
|
21
|
+
if (edge.to === nodeId && !predecessors.includes(edge.from)) {
|
|
22
|
+
predecessors.push(edge.from);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return predecessors;
|
|
26
|
+
}
|
|
17
27
|
//# sourceMappingURL=workflow-graph-queries.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-graph-queries.js","sourceRoot":"","sources":["../../src/graph/workflow-graph-queries.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workflow-graph-queries.js","sourceRoot":"","sources":["../../src/graph/workflow-graph-queries.ts"],"names":[],"mappings":";;;;;AAGA,yBAAgC,KAAoB;IACnD,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;AAC5D,CAAC;AAOD,6BAAoC,KAAoB,EAAE,MAAc;IACvE,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAChC,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;YAC3D,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1B,CAAC;IACF,CAAC;IACD,OAAO,UAAU,CAAC;AACnB,CAAC;AAOD,+BAAsC,KAAoB,EAAE,MAAc;IACzE,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAChC,IAAI,IAAI,CAAC,EAAE,KAAK,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7D,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC;IACD,OAAO,YAAY,CAAC;AACrB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type { ExternalDependencies, IStepExecutor, StepExecutionContext, StepExe
|
|
|
6
6
|
export { AllowAllAdmittance, AdmittanceRejectedError } from './admittance';
|
|
7
7
|
export type { AdmittanceDecision, AdmittanceRequest, AdmittanceService, } from './admittance';
|
|
8
8
|
export { InMemoryWorkQueue } from './queue';
|
|
9
|
-
export type { ExecutionEnqueuedEvent, OrchestrationMessage, StepMessage, StepReadyEvent, WorkQueue, } from './queue';
|
|
10
|
-
export { ExecutionNotFoundError, ExecutionStartHandler, OrchestrationWorker, StepNotFoundError, } from './execution';
|
|
11
|
-
export type { ExecutionMode, ExecutionRecord, ExecutionStatus, ExecutionStore, NewExecutionRecord, NewStepRecord, StepError, StepRecord, StepStatus, StepStore, } from './execution';
|
|
9
|
+
export type { ExecutionEnqueuedEvent, OrchestrationMessage, StepCompletedEvent, StepMessage, StepReadyEvent, WorkQueue, } from './queue';
|
|
10
|
+
export { ExecutionNotFoundError, ExecutionStartHandler, OrchestrationWorker, StepCompletedHandler, StepNotFoundError, StepReadyHandler, StepWorker, } from './execution';
|
|
11
|
+
export type { ExecutionMode, ExecutionRecord, ExecutionStatus, ExecutionStore, NewExecutionRecord, NewStepRecord, StepError, StepRecord, StepSlots, StepStatus, StepStore, } from './execution';
|
|
12
12
|
export { createDataSource, TypeOrmExecutionStore, TypeOrmStepStore } from './database';
|
package/dist/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.createDataSource = exports.StepNotFoundError = exports.OrchestrationWorker = exports.ExecutionStartHandler = exports.ExecutionNotFoundError = exports.InMemoryWorkQueue = exports.AdmittanceRejectedError = exports.AllowAllAdmittance = exports.createEngineServer = void 0;
|
|
3
|
+
exports.TypeOrmStepStore = exports.TypeOrmExecutionStore = exports.createDataSource = exports.StepWorker = exports.StepReadyHandler = exports.StepNotFoundError = exports.StepCompletedHandler = exports.OrchestrationWorker = exports.ExecutionStartHandler = exports.ExecutionNotFoundError = exports.InMemoryWorkQueue = exports.AdmittanceRejectedError = exports.AllowAllAdmittance = exports.createEngineServer = void 0;
|
|
4
4
|
var server_1 = require("./server");
|
|
5
5
|
Object.defineProperty(exports, "createEngineServer", { enumerable: true, get: function () { return server_1.createEngineServer; } });
|
|
6
6
|
var admittance_1 = require("./admittance");
|
|
@@ -12,7 +12,10 @@ var execution_1 = require("./execution");
|
|
|
12
12
|
Object.defineProperty(exports, "ExecutionNotFoundError", { enumerable: true, get: function () { return execution_1.ExecutionNotFoundError; } });
|
|
13
13
|
Object.defineProperty(exports, "ExecutionStartHandler", { enumerable: true, get: function () { return execution_1.ExecutionStartHandler; } });
|
|
14
14
|
Object.defineProperty(exports, "OrchestrationWorker", { enumerable: true, get: function () { return execution_1.OrchestrationWorker; } });
|
|
15
|
+
Object.defineProperty(exports, "StepCompletedHandler", { enumerable: true, get: function () { return execution_1.StepCompletedHandler; } });
|
|
15
16
|
Object.defineProperty(exports, "StepNotFoundError", { enumerable: true, get: function () { return execution_1.StepNotFoundError; } });
|
|
17
|
+
Object.defineProperty(exports, "StepReadyHandler", { enumerable: true, get: function () { return execution_1.StepReadyHandler; } });
|
|
18
|
+
Object.defineProperty(exports, "StepWorker", { enumerable: true, get: function () { return execution_1.StepWorker; } });
|
|
16
19
|
var database_1 = require("./database");
|
|
17
20
|
Object.defineProperty(exports, "createDataSource", { enumerable: true, get: function () { return database_1.createDataSource; } });
|
|
18
21
|
Object.defineProperty(exports, "TypeOrmExecutionStore", { enumerable: true, get: function () { return database_1.TypeOrmExecutionStore; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAA8C;AAArC,4GAAA,kBAAkB,OAAA;AAqB3B,2CAA2E;AAAlE,gHAAA,kBAAkB,OAAA;AAAE,qHAAA,uBAAuB,OAAA;AAOpD,iCAA4C;AAAnC,0GAAA,iBAAiB,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAA8C;AAArC,4GAAA,kBAAkB,OAAA;AAqB3B,2CAA2E;AAAlE,gHAAA,kBAAkB,OAAA;AAAE,qHAAA,uBAAuB,OAAA;AAOpD,iCAA4C;AAAnC,0GAAA,iBAAiB,OAAA;AAU1B,yCAQqB;AAPpB,mHAAA,sBAAsB,OAAA;AACtB,kHAAA,qBAAqB,OAAA;AACrB,gHAAA,mBAAmB,OAAA;AACnB,iHAAA,oBAAoB,OAAA;AACpB,8GAAA,iBAAiB,OAAA;AACjB,6GAAA,gBAAgB,OAAA;AAChB,uGAAA,UAAU,OAAA;AAgBX,uCAAuF;AAA9E,4GAAA,gBAAgB,OAAA;AAAE,iHAAA,qBAAqB,OAAA;AAAE,4GAAA,gBAAgB,OAAA"}
|
package/dist/queue/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { ExecutionEnqueuedEvent, OrchestrationMessage, StepMessage, StepReadyEvent, WorkQueue, } from './work-queue.types';
|
|
1
|
+
export type { ExecutionEnqueuedEvent, OrchestrationMessage, StepCompletedEvent, StepMessage, StepReadyEvent, WorkQueue, } from './work-queue.types';
|
|
2
2
|
export { InMemoryWorkQueue } from './in-memory-work-queue';
|
package/dist/queue/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/queue/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/queue/index.ts"],"names":[],"mappings":";;;AAQA,+DAA2D;AAAlD,yHAAA,iBAAiB,OAAA"}
|
|
@@ -2,7 +2,12 @@ export interface ExecutionEnqueuedEvent {
|
|
|
2
2
|
type: 'execution:enqueued';
|
|
3
3
|
executionId: string;
|
|
4
4
|
}
|
|
5
|
-
export
|
|
5
|
+
export interface StepCompletedEvent {
|
|
6
|
+
type: 'step:completed';
|
|
7
|
+
executionId: string;
|
|
8
|
+
stepId: string;
|
|
9
|
+
}
|
|
10
|
+
export type OrchestrationMessage = ExecutionEnqueuedEvent | StepCompletedEvent;
|
|
6
11
|
export interface StepReadyEvent {
|
|
7
12
|
type: 'step:ready';
|
|
8
13
|
executionId: string;
|
package/dist/serve.js
CHANGED
|
@@ -20,12 +20,15 @@ async function main() {
|
|
|
20
20
|
}
|
|
21
21
|
const orchestrationQueue = new queue_1.InMemoryWorkQueue();
|
|
22
22
|
const stepQueue = new queue_1.InMemoryWorkQueue();
|
|
23
|
-
let
|
|
23
|
+
let orchestrationWorker;
|
|
24
|
+
let stepWorker;
|
|
24
25
|
if (dataSource) {
|
|
25
26
|
const executionStore = new database_1.TypeOrmExecutionStore(dataSource.getRepository(database_1.WorkflowExecution));
|
|
26
27
|
const stepStore = new database_1.TypeOrmStepStore(dataSource.getRepository(database_1.WorkflowStepExecution));
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
orchestrationWorker = new execution_1.OrchestrationWorker(orchestrationQueue, new execution_1.ExecutionStartHandler(executionStore, stepStore, orchestrationQueue), new execution_1.StepCompletedHandler(executionStore, stepStore, stepQueue));
|
|
29
|
+
stepWorker = new execution_1.StepWorker(stepQueue, new execution_1.StepReadyHandler(executionStore, stepStore, orchestrationQueue, {}));
|
|
30
|
+
orchestrationWorker.start();
|
|
31
|
+
stepWorker.start();
|
|
29
32
|
}
|
|
30
33
|
const { app } = (0, server_1.createEngineServer)(dataSource
|
|
31
34
|
? { dataSource, admittance: new admittance_1.AllowAllAdmittance(), workQueue: orchestrationQueue }
|
|
@@ -42,8 +45,10 @@ async function main() {
|
|
|
42
45
|
await new Promise((resolve, reject) => {
|
|
43
46
|
server.close((error) => (error ? reject(error) : resolve()));
|
|
44
47
|
});
|
|
45
|
-
if (
|
|
46
|
-
await
|
|
48
|
+
if (orchestrationWorker)
|
|
49
|
+
await orchestrationWorker.stop();
|
|
50
|
+
if (stepWorker)
|
|
51
|
+
await stepWorker.stop();
|
|
47
52
|
if (dataSource?.isInitialized)
|
|
48
53
|
await dataSource.destroy();
|
|
49
54
|
process.exit(0);
|
package/dist/serve.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":";;AAAA,wCAA2C;AAC3C,gCAAoC;AAGpC,6CAAkD;AAClD,yCAMoB;AACpB,
|
|
1
|
+
{"version":3,"file":"serve.js","s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CAAC,CAAC,CAAC;IACjB,CAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAQ,EAAE;QACzC,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;YACzC,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;YACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IACjD,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AAChD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC/B,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
|
@@ -4,6 +4,8 @@ exports.createWorkflowExecutionsRouter = createWorkflowExecutionsRouter;
|
|
|
4
4
|
const express_1 = require("express");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const admittance_1 = require("../../admittance");
|
|
7
|
+
const common_1 = require("../../common");
|
|
8
|
+
const graph_1 = require("../../graph");
|
|
7
9
|
const jsonValueSchema = zod_1.z.lazy(() => zod_1.z.union([
|
|
8
10
|
zod_1.z.string(),
|
|
9
11
|
zod_1.z.number(),
|
|
@@ -57,6 +59,14 @@ function createWorkflowExecutionsRouter(startExecution) {
|
|
|
57
59
|
res.status(429).json({ error: 'admittance_rejected', reason: error.reason });
|
|
58
60
|
return;
|
|
59
61
|
}
|
|
62
|
+
if (error instanceof graph_1.GraphValidationError) {
|
|
63
|
+
res.status(400).json({ error: 'invalid_graph', reason: error.message });
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (error instanceof common_1.UnimplementedError) {
|
|
67
|
+
res.status(501).json({ error: 'unimplemented', reason: error.message });
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
60
70
|
throw error;
|
|
61
71
|
}
|
|
62
72
|
});
|
|
@@ -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;
|
|
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,uCAAmD;AAEnD,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,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;AAEnD,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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