@n8n/engine 0.17.0 → 0.18.1
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 +7 -6
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ExecutionMode, ExecutionStatus, StepError, StepSlots, StepStatus } from '../execution';
|
|
2
|
+
import type { WorkflowGraph } from '../graph';
|
|
3
|
+
export interface ExecutionSnapshot {
|
|
4
|
+
id: string;
|
|
5
|
+
workflowId: string;
|
|
6
|
+
status: ExecutionStatus;
|
|
7
|
+
mode: ExecutionMode;
|
|
8
|
+
graph: WorkflowGraph;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
updatedAt: string;
|
|
11
|
+
finishedAt: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface StepDetail {
|
|
14
|
+
id: string;
|
|
15
|
+
nodeId: string;
|
|
16
|
+
iteration: number;
|
|
17
|
+
status: StepStatus;
|
|
18
|
+
outputs: StepSlots | null;
|
|
19
|
+
error: StepError | null;
|
|
20
|
+
createdAt: string;
|
|
21
|
+
updatedAt: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ExecutionStepsResponse {
|
|
24
|
+
steps: StepDetail[];
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.types.js","sourceRoot":"","sources":["../../src/server/api.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { type Application } from 'express';
|
|
2
2
|
import type { IdentityVerifier } from '../auth/identity.types';
|
|
3
|
+
import type { ExecutionQueryService } from '../execution';
|
|
3
4
|
import type { StartExecutionService } from '../execution/start-execution.service';
|
|
4
|
-
|
|
5
|
+
import type { EngineLogger } from '../logging';
|
|
6
|
+
export interface EngineServerDeps {
|
|
7
|
+
startExecution: StartExecutionService;
|
|
8
|
+
executionQuery: ExecutionQueryService;
|
|
9
|
+
identityVerifier: IdentityVerifier;
|
|
10
|
+
logger?: EngineLogger;
|
|
11
|
+
}
|
|
12
|
+
export declare function createEngineServer(deps: EngineServerDeps): {
|
|
5
13
|
app: Application;
|
|
6
14
|
};
|
|
@@ -7,14 +7,14 @@ exports.createEngineServer = createEngineServer;
|
|
|
7
7
|
const express_1 = __importDefault(require("express"));
|
|
8
8
|
const authenticate_1 = require("../auth/authenticate");
|
|
9
9
|
const workflow_executions_1 = require("./routes/workflow-executions");
|
|
10
|
-
function createEngineServer(
|
|
10
|
+
function createEngineServer(deps) {
|
|
11
11
|
const app = (0, express_1.default)();
|
|
12
12
|
app.get('/healthz', (_req, res) => {
|
|
13
13
|
res.status(200).json({ status: 'ok' });
|
|
14
14
|
});
|
|
15
|
-
app.use('/api', (0, authenticate_1.createAuthenticationMiddleware)(identityVerifier));
|
|
15
|
+
app.use('/api', (0, authenticate_1.createAuthenticationMiddleware)(deps.identityVerifier, deps.logger));
|
|
16
16
|
app.use('/api', express_1.default.json());
|
|
17
|
-
app.use('/api/workflow-executions', (0, workflow_executions_1.createWorkflowExecutionsRouter)(
|
|
17
|
+
app.use('/api/workflow-executions', (0, workflow_executions_1.createWorkflowExecutionsRouter)(deps));
|
|
18
18
|
return { app };
|
|
19
19
|
}
|
|
20
20
|
//# sourceMappingURL=create-engine-server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-engine-server.js","sourceRoot":"","sources":["../../src/server/create-engine-server.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAoD;AAEpD,uDAAsE;
|
|
1
|
+
{"version":3,"file":"create-engine-server.js","sourceRoot":"","sources":["../../src/server/create-engine-server.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAoD;AAEpD,uDAAsE;AAKtE,sEAA8E;AAY9E,4BAAmC,IAAsB;IACxD,MAAM,GAAG,GAAG,IAAA,iBAAO,GAAE,CAAC;IAGtB,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QACjC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAGH,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,IAAA,6CAA8B,EAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACpF,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAChC,GAAG,CAAC,GAAG,CAAC,0BAA0B,EAAE,IAAA,oDAA8B,EAAC,IAAI,CAAC,CAAC,CAAC;IAE1E,OAAO,EAAE,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { createEngineServer } from './create-engine-server';
|
|
2
|
+
export type { EngineServerDeps } from './create-engine-server';
|
|
3
|
+
export type { ExecutionSnapshot, ExecutionStepsResponse, StepDetail } from './api.types';
|
|
2
4
|
export { fail } from './error-response';
|
|
3
5
|
export type { EngineErrorResponse } from './error-response';
|
package/dist/server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";;;AAAA,+DAA4D;AAAnD,0HAAA,kBAAkB,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";;;AAAA,+DAA4D;AAAnD,0HAAA,kBAAkB,OAAA;AAG3B,mDAAwC;AAA/B,sGAAA,IAAI,OAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type Router as RouterType } from 'express';
|
|
2
|
-
import type {
|
|
3
|
-
export declare function createWorkflowExecutionsRouter(
|
|
2
|
+
import type { EngineServerDeps } from '../create-engine-server';
|
|
3
|
+
export declare function createWorkflowExecutionsRouter(deps: EngineServerDeps): RouterType;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RequestHandler } from 'express';
|
|
2
|
+
import { type ExecutionQueryService } from '../../execution';
|
|
3
|
+
export declare function createGetExecutionHandler(executionQuery: ExecutionQueryService): RequestHandler;
|
|
4
|
+
export declare function createGetExecutionStepsHandler(executionQuery: ExecutionQueryService): RequestHandler;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createGetExecutionHandler = createGetExecutionHandler;
|
|
4
|
+
exports.createGetExecutionStepsHandler = createGetExecutionStepsHandler;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const execution_1 = require("../../execution");
|
|
7
|
+
const error_response_1 = require("../error-response");
|
|
8
|
+
const ExecutionIdParams = zod_1.z.object({ id: zod_1.z.string().uuid() });
|
|
9
|
+
function parseExecutionId(req, res) {
|
|
10
|
+
const parsed = ExecutionIdParams.safeParse(req.params);
|
|
11
|
+
if (parsed.success)
|
|
12
|
+
return parsed.data.id;
|
|
13
|
+
(0, error_response_1.fail)(res, 400, { error: 'invalid_request', details: parsed.error.flatten() });
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
function toExecutionSnapshot(record) {
|
|
17
|
+
return {
|
|
18
|
+
id: record.id,
|
|
19
|
+
workflowId: record.workflowId,
|
|
20
|
+
status: record.status,
|
|
21
|
+
mode: record.mode,
|
|
22
|
+
graph: record.graph,
|
|
23
|
+
createdAt: record.createdAt.toISOString(),
|
|
24
|
+
updatedAt: record.updatedAt.toISOString(),
|
|
25
|
+
finishedAt: record.finishedAt?.toISOString() ?? null,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function toStepDetail(record) {
|
|
29
|
+
return {
|
|
30
|
+
id: record.id,
|
|
31
|
+
nodeId: record.nodeId,
|
|
32
|
+
iteration: record.iteration,
|
|
33
|
+
status: record.status,
|
|
34
|
+
outputs: record.outputs,
|
|
35
|
+
error: record.error,
|
|
36
|
+
createdAt: record.createdAt.toISOString(),
|
|
37
|
+
updatedAt: record.updatedAt.toISOString(),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function createGetExecutionHandler(executionQuery) {
|
|
41
|
+
return async (req, res) => {
|
|
42
|
+
const id = parseExecutionId(req, res);
|
|
43
|
+
if (id === null)
|
|
44
|
+
return;
|
|
45
|
+
try {
|
|
46
|
+
const execution = await executionQuery.getExecution(id);
|
|
47
|
+
res.status(200).json(toExecutionSnapshot(execution));
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
if (error instanceof execution_1.ExecutionNotFoundError) {
|
|
51
|
+
(0, error_response_1.fail)(res, 404, { error: 'not_found' });
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function createGetExecutionStepsHandler(executionQuery) {
|
|
59
|
+
return async (req, res) => {
|
|
60
|
+
const id = parseExecutionId(req, res);
|
|
61
|
+
if (id === null)
|
|
62
|
+
return;
|
|
63
|
+
const steps = await executionQuery.getSteps(id);
|
|
64
|
+
const body = { steps: steps.map(toStepDetail) };
|
|
65
|
+
res.status(200).json(body);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=workflow-executions.handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-executions.handlers.js","sourceRoot":"","sources":["../../../src/server/routes/workflow-executions.handlers.ts"],"names":[],"mappings":";;;;AACA,6BAAwB;AAExB,+CAKyB;AAEzB,sDAAyC;AAEzC,MAAM,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAG9D,SAAS,gBAAgB,CAAC,GAAY,EAAE,GAAa;IACpD,MAAM,MAAM,GAAG,iBAAiB,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACvD,IAAI,MAAM,CAAC,OAAO;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1C,IAAA,qBAAI,EAAC,GAAG,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC9E,OAAO,IAAI,CAAC;AACb,CAAC;AAED,SAAS,mBAAmB,CAAC,MAAqB;IACjD,OAAO;QACN,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,WAAW,EAAE;QACzC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,WAAW,EAAE;QACzC,UAAU,EAAE,MAAM,CAAC,UAA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IAAI,EAAE,KAAK,IAAI;YAAE,OAAO;QAExB,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAChD,MAAM,IAAI,GAA2B,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;QACxE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createWorkflowExecutionsRouter = createWorkflowExecutionsRouter;
|
|
4
|
+
const constants_1 = require("@n8n/constants");
|
|
4
5
|
const express_1 = require("express");
|
|
5
6
|
const zod_1 = require("zod");
|
|
7
|
+
const workflow_executions_handlers_1 = require("./workflow-executions.handlers");
|
|
6
8
|
const admittance_1 = require("../../admittance");
|
|
7
9
|
const common_1 = require("../../common");
|
|
8
10
|
const graph_1 = require("../../graph");
|
|
9
11
|
const error_response_1 = require("../error-response");
|
|
10
12
|
const MAX_TRIGGER_SLOTS = graph_1.MAX_SLOT_INDEX + 1;
|
|
11
|
-
const jsonValueSchema = zod_1.z.lazy(() => zod_1.z.union([
|
|
12
|
-
zod_1.z.string(),
|
|
13
|
-
zod_1.z.number(),
|
|
14
|
-
zod_1.z.boolean(),
|
|
15
|
-
zod_1.z.null(),
|
|
16
|
-
zod_1.z.array(jsonValueSchema),
|
|
17
|
-
zod_1.z.record(jsonValueSchema),
|
|
18
|
-
]));
|
|
19
13
|
const StepTypeSchema = zod_1.z.enum(['trigger', 'v1-node', 'wait', 'subworkflow', 'batch']);
|
|
20
14
|
const GraphNodeSchema = zod_1.z.object({
|
|
21
|
-
id: zod_1.z.string(),
|
|
22
|
-
name: zod_1.z.string(),
|
|
15
|
+
id: zod_1.z.string().min(1),
|
|
16
|
+
name: zod_1.z.string().min(1),
|
|
23
17
|
type: StepTypeSchema,
|
|
24
18
|
config: zod_1.z.unknown().optional(),
|
|
25
19
|
});
|
|
@@ -37,10 +31,11 @@ const WorkflowGraphSchema = zod_1.z.object({
|
|
|
37
31
|
const StartExecutionBody = zod_1.z.object({
|
|
38
32
|
workflowId: zod_1.z.string().min(1),
|
|
39
33
|
graph: WorkflowGraphSchema,
|
|
40
|
-
triggerOutputs: zod_1.z.array(jsonValueSchema).min(1).max(MAX_TRIGGER_SLOTS).nullable().optional(),
|
|
34
|
+
triggerOutputs: zod_1.z.array(common_1.jsonValueSchema).min(1).max(MAX_TRIGGER_SLOTS).nullable().optional(),
|
|
41
35
|
mode: zod_1.z.enum(['production', 'manual']).optional(),
|
|
36
|
+
executionId: zod_1.z.string().regex(constants_1.UUID_V7_PATTERN),
|
|
42
37
|
});
|
|
43
|
-
function createWorkflowExecutionsRouter(
|
|
38
|
+
function createWorkflowExecutionsRouter(deps) {
|
|
44
39
|
const router = (0, express_1.Router)();
|
|
45
40
|
router.post('/', async (req, res) => {
|
|
46
41
|
const parsed = StartExecutionBody.safeParse(req.body);
|
|
@@ -49,7 +44,7 @@ function createWorkflowExecutionsRouter(startExecution) {
|
|
|
49
44
|
return;
|
|
50
45
|
}
|
|
51
46
|
try {
|
|
52
|
-
const result = await startExecution.start(parsed.data);
|
|
47
|
+
const result = await deps.startExecution.start(parsed.data);
|
|
53
48
|
res.status(201).json(result);
|
|
54
49
|
}
|
|
55
50
|
catch (error) {
|
|
@@ -68,6 +63,8 @@ function createWorkflowExecutionsRouter(startExecution) {
|
|
|
68
63
|
throw error;
|
|
69
64
|
}
|
|
70
65
|
});
|
|
66
|
+
router.get('/:id', (0, workflow_executions_handlers_1.createGetExecutionHandler)(deps.executionQuery));
|
|
67
|
+
router.get('/:id/steps', (0, workflow_executions_handlers_1.createGetExecutionStepsHandler)(deps.executionQuery));
|
|
71
68
|
return router;
|
|
72
69
|
}
|
|
73
70
|
//# sourceMappingURL=workflow-executions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-executions.js","sourceRoot":"","sources":["../../../src/server/routes/workflow-executions.ts"],"names":[],"mappings":";;;AAAA,qCAA4D;AAC5D,6BAAwB;AAExB,iDAA2D;AAC3D,
|
|
1
|
+
{"version":3,"file":"workflow-executions.js","sourceRoot":"","sources":["../../../src/server/routes/workflow-executions.ts"],"names":[],"mappings":";;;AAAA,8CAAiD;AACjD,qCAA4D;AAC5D,6BAAwB;AAExB,iFAGwC;AACxC,iDAA2D;AAC3D,yCAAmE;AACnE,uCAAmE;AAEnE,sDAAyC;AAEzC,MAAM,iBAAiB,GAAG,sBAAc,GAAG,CAAC,CAAC;AAE7C,MAAM,cAAc,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;AAGtF,MAAM,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IAChC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IAChC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IAGd,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACtD,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACrD,UAAU,EAAE,OAAC,C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MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC5D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,KAAK,YAAY,oCAAuB,EAAE,CAAC;gBAC9C,IAAA,qBAAI,EAAC,GAAG,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;gBACvE,OAAO;YACR,CAAC;YACD,IAAI,KAAK,YAAY,4BAAoB,EAAE,CAAC;gBAC3C,IAAA,qBAAI,EAAC,GAAG,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;gBAClE,OAAO;YACR,CAAC;YACD,IAAI,KAAK,YAAY,2BAAkB,EAAE,CAAC;gBACzC,IAAA,qBAAI,EAAC,GAAG,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;gBAClE,OAAO;YACR,CAAC;YACD,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,IAAA,wDAAyB,EAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;IAEnE,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,IAAA,6DAA8B,EAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;IAE9E,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
export declare function startEngineServer(startExecution: StartExecutionService, identityVerifier: IdentityVerifier): Promise<{
|
|
1
|
+
import { type EngineServerDeps } from '../server';
|
|
2
|
+
export declare function startEngineServer(deps: EngineServerDeps): Promise<{
|
|
4
3
|
url: string;
|
|
5
4
|
stop: () => Promise<void>;
|
|
6
5
|
}>;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.startEngineServer = startEngineServer;
|
|
4
4
|
const server_1 = require("../server");
|
|
5
|
-
async function startEngineServer(
|
|
6
|
-
const { app } = (0, server_1.createEngineServer)(
|
|
5
|
+
async function startEngineServer(deps) {
|
|
6
|
+
const { app } = (0, server_1.createEngineServer)(deps);
|
|
7
7
|
const server = await new Promise((resolve, reject) => {
|
|
8
8
|
const s = app.listen(0, '127.0.0.1', () => resolve(s));
|
|
9
9
|
s.on('error', reject);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-engine-server.js","sourceRoot":"","sources":["../../src/testing/start-engine-server.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"start-engine-server.js","sourceRoot":"","sources":["../../src/testing/start-engine-server.ts"],"names":[],"mappings":";;;AAEA,sCAAsE;AAE/D,KAAK,4BAA4B,IAAsB;IAI7D,MAAM,EAAE,GAAG,EAAE,GAAG,IAAA,2BAAkB,EAAC,IAAI,CAAC,CAAC;IAEzC,MAAM,MAAM,GAAG,MAAM,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC5D,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACvD,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;IACjC,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,GAAG,GAAG,oBAAoB,OAAO,CAAC,IAAI,EAAE,CAAC;IAE/C,MAAM,IAAI,GAAG,KAAK,IAAmB,EAAE;QACtC,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC3C,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;gBACtB,IAAI,KAAK;oBAAE,MAAM,CAAC,KAAK,CAAC,CAAC;;oBACpB,OAAO,EAAE,CAAC;YAChB,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n/engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"description": "n8n workflow execution engine (v2)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist/**/*",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
9
|
+
"LICENSE_EE.md",
|
|
10
|
+
"LICENSE.md"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"express": "5.1.0",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"reflect-metadata": "0.2.2",
|
|
17
17
|
"uuid": "11.1.1",
|
|
18
18
|
"zod": "3.25.76",
|
|
19
|
-
"@n8n/config": "2.
|
|
19
|
+
"@n8n/config": "2.36.1",
|
|
20
|
+
"@n8n/constants": "0.37.1",
|
|
20
21
|
"@n8n/di": "0.16.0",
|
|
21
22
|
"@n8n/typeorm": "0.9.0"
|
|
22
23
|
},
|
|
@@ -30,9 +31,9 @@
|
|
|
30
31
|
"testcontainers": "^11.13.0",
|
|
31
32
|
"typescript": "7.0.2",
|
|
32
33
|
"vitest": "^4.1.9",
|
|
33
|
-
"
|
|
34
|
+
"n8n-containers": "1.0.0",
|
|
34
35
|
"@n8n/vitest-config": "1.21.0",
|
|
35
|
-
"n8n-
|
|
36
|
+
"@n8n/typescript-config": "1.11.0"
|
|
36
37
|
},
|
|
37
38
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
38
39
|
"homepage": "https://n8n.io",
|