@atom8n/n8n 2.5.0 → 2.5.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.
Files changed (35) hide show
  1. package/dist/build.tsbuildinfo +1 -1
  2. package/dist/chat/chat-service.types.d.ts +6 -6
  3. package/dist/commands/execute.js +0 -0
  4. package/dist/commands/import/credentials.js +0 -0
  5. package/dist/commands/mcp.d.ts +23 -0
  6. package/dist/commands/mcp.js +315 -0
  7. package/dist/commands/run.d.ts +23 -0
  8. package/dist/commands/run.js +162 -0
  9. package/dist/controllers/annotation-tags.controller.ee.d.ts +1 -1
  10. package/dist/controllers/cli.controller.d.ts +26 -0
  11. package/dist/controllers/cli.controller.js +334 -0
  12. package/dist/controllers/orchestration.controller.js +0 -0
  13. package/dist/controllers/users.controller.d.ts +1 -1
  14. package/dist/environments.ee/source-control/source-control-status.service.ee.d.ts +2 -2
  15. package/dist/environments.ee/source-control/source-control.controller.ee.d.ts +4 -4
  16. package/dist/environments.ee/source-control/source-control.service.ee.d.ts +2 -2
  17. package/dist/environments.ee/source-control/types/source-control-set-branch.js +0 -0
  18. package/dist/eventbus/event-message-classes/index.js +0 -0
  19. package/dist/index.d.ts +2 -1
  20. package/dist/index.js +8 -0
  21. package/dist/modules/mcp/mcp-oauth.helpers.js +0 -0
  22. package/dist/modules/mcp/mcp.oauth-clients.controller.js +0 -0
  23. package/dist/modules/mcp/tools/execute-workflow.tool.d.ts +10 -10
  24. package/dist/modules/mcp/tools/schemas.d.ts +10 -10
  25. package/dist/modules/source-control.ee/source-control-preferences.service.ee.js +0 -0
  26. package/dist/node-lib.d.ts +10 -0
  27. package/dist/node-lib.js +137 -0
  28. package/dist/server.d.ts +1 -0
  29. package/dist/server.js +1 -0
  30. package/dist/sso.ee/saml/schema/metadata-exchange.xsd.js +0 -0
  31. package/dist/task-runners/task-broker/errors/task-runner-accept-timeout.error.js +0 -0
  32. package/dist/typecheck.tsbuildinfo +1 -0
  33. package/dist/workflows/workflow.service.d.ts +2 -2
  34. package/dist/workflows/workflows.controller.d.ts +4 -4
  35. package/package.json +22 -21
@@ -0,0 +1,334 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var CliController_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.CliController = void 0;
14
+ const backend_common_1 = require("@n8n/backend-common");
15
+ const db_1 = require("@n8n/db");
16
+ const decorators_1 = require("@n8n/decorators");
17
+ const uuid_1 = require("uuid");
18
+ const n8n_workflow_1 = require("n8n-workflow");
19
+ const active_executions_1 = require("../active-executions");
20
+ const ownership_service_1 = require("../services/ownership.service");
21
+ const utils_1 = require("../utils");
22
+ const workflow_runner_1 = require("../workflow-runner");
23
+ let CliController = CliController_1 = class CliController {
24
+ constructor(logger, workflowRepository, sharedWorkflowRepository, projectRepository, executionRepository, ownershipService, activeExecutions, workflowRunner) {
25
+ this.logger = logger;
26
+ this.workflowRepository = workflowRepository;
27
+ this.sharedWorkflowRepository = sharedWorkflowRepository;
28
+ this.projectRepository = projectRepository;
29
+ this.executionRepository = executionRepository;
30
+ this.ownershipService = ownershipService;
31
+ this.activeExecutions = activeExecutions;
32
+ this.workflowRunner = workflowRunner;
33
+ }
34
+ isWebhookBasedTrigger(nodeType) {
35
+ return (nodeType === n8n_workflow_1.CHAT_TRIGGER_NODE_TYPE ||
36
+ nodeType === 'n8n-nodes-base.webhook' ||
37
+ nodeType.toLowerCase().includes('webhook'));
38
+ }
39
+ isLocalRequest(req) {
40
+ const remoteAddress = req.ip || req.socket.remoteAddress || '';
41
+ return (remoteAddress === '127.0.0.1' ||
42
+ remoteAddress === '::1' ||
43
+ remoteAddress === '::ffff:127.0.0.1' ||
44
+ remoteAddress === 'localhost');
45
+ }
46
+ async run(req, res) {
47
+ const startTime = Date.now();
48
+ this.logger.info('[cli] ── RUN REQUEST ──');
49
+ if (!this.isLocalRequest(req)) {
50
+ res.status(403).json({ error: 'CLI endpoint is only accessible from localhost' });
51
+ return;
52
+ }
53
+ const body = req.body;
54
+ if (!body.workflowData) {
55
+ res.status(400).json({ error: 'Missing workflowData in request body' });
56
+ return;
57
+ }
58
+ const fileData = body.workflowData;
59
+ const chatInput = body.chatInput;
60
+ const inputData = body.inputData;
61
+ this.logger.info(`[cli] inputData: ${inputData ? JSON.stringify(inputData) : '(none)'}`);
62
+ if (!fileData.nodes || !Array.isArray(fileData.nodes)) {
63
+ res.status(400).json({ error: 'Workflow does not contain valid nodes' });
64
+ return;
65
+ }
66
+ if (!fileData.connections || typeof fileData.connections !== 'object') {
67
+ res.status(400).json({ error: 'Workflow does not contain valid connections' });
68
+ return;
69
+ }
70
+ this.logger.info(`[cli] Workflow: "${fileData.name}", Nodes: ${fileData.nodes.length}`);
71
+ try {
72
+ const user = await this.ownershipService.getInstanceOwner();
73
+ const workflowId = await this.syncWorkflow(fileData, user.id);
74
+ const workflow = await this.workflowRepository.findOneBy({ id: workflowId });
75
+ if (!workflow) {
76
+ res.status(500).json({ error: 'Failed to sync workflow to database' });
77
+ return;
78
+ }
79
+ this.logger.info(`[cli] Synced workflow: "${workflow.name}" (ID: ${workflowId})`);
80
+ const triggerNode = workflow.nodes.find((node) => node.type.toLowerCase().includes('trigger') ||
81
+ node.type.toLowerCase().includes('webhook') ||
82
+ node.type === 'n8n-nodes-base.start');
83
+ if (!triggerNode) {
84
+ res.status(400).json({ error: 'No trigger node found in workflow' });
85
+ return;
86
+ }
87
+ this.logger.info(`[cli] Trigger: "${triggerNode.name}" (${triggerNode.type})`);
88
+ let executionId;
89
+ if (this.isWebhookBasedTrigger(triggerNode.type)) {
90
+ this.logger.info('[cli] Using direct execution (webhook/chat trigger)');
91
+ const isChatTrigger = triggerNode.type === n8n_workflow_1.CHAT_TRIGGER_NODE_TYPE;
92
+ const mockData = isChatTrigger
93
+ ? {
94
+ sessionId: `cli-${Date.now()}`,
95
+ action: 'sendMessage',
96
+ chatInput: chatInput ?? 'CLI execution',
97
+ }
98
+ : {
99
+ headers: {},
100
+ params: {},
101
+ query: {},
102
+ body: { chatInput },
103
+ };
104
+ const executionData = (0, n8n_workflow_1.createRunExecutionData)({
105
+ startData: {},
106
+ resultData: {
107
+ pinData: { [triggerNode.name]: [{ json: mockData }] },
108
+ runData: {},
109
+ },
110
+ executionData: {
111
+ contextData: {},
112
+ metadata: {},
113
+ nodeExecutionStack: [
114
+ {
115
+ node: triggerNode,
116
+ data: {
117
+ main: [[{ json: mockData }]],
118
+ },
119
+ source: null,
120
+ },
121
+ ],
122
+ waitingExecution: {},
123
+ waitingExecutionSource: {},
124
+ },
125
+ });
126
+ const runData = {
127
+ executionMode: isChatTrigger ? 'chat' : 'webhook',
128
+ workflowData: workflow,
129
+ userId: user.id,
130
+ startNodes: [{ name: triggerNode.name, sourceData: null }],
131
+ pinData: { [triggerNode.name]: [{ json: mockData }] },
132
+ executionData,
133
+ };
134
+ executionId = await this.workflowRunner.run(runData);
135
+ }
136
+ else {
137
+ this.logger.info('[cli] Using trigger execution (regular trigger)');
138
+ const triggerData = (inputData ?? {});
139
+ if (chatInput !== undefined && !inputData) {
140
+ triggerData.chatInput = chatInput;
141
+ }
142
+ this.logger.info(`[cli] Trigger input data: ${JSON.stringify(triggerData)}`);
143
+ const executionData = (0, n8n_workflow_1.createRunExecutionData)({
144
+ startData: {},
145
+ resultData: {
146
+ pinData: { [triggerNode.name]: [{ json: triggerData }] },
147
+ runData: {},
148
+ },
149
+ executionData: {
150
+ contextData: {},
151
+ metadata: {},
152
+ nodeExecutionStack: [
153
+ {
154
+ node: triggerNode,
155
+ data: {
156
+ main: [[{ json: triggerData }]],
157
+ },
158
+ source: null,
159
+ },
160
+ ],
161
+ waitingExecution: {},
162
+ waitingExecutionSource: {},
163
+ },
164
+ });
165
+ const runData = {
166
+ executionMode: 'trigger',
167
+ workflowData: workflow,
168
+ userId: user.id,
169
+ startNodes: [{ name: triggerNode.name, sourceData: null }],
170
+ pinData: { [triggerNode.name]: [{ json: triggerData }] },
171
+ executionData,
172
+ };
173
+ executionId = await this.workflowRunner.run(runData);
174
+ }
175
+ this.logger.info(`[cli] Execution started: ${executionId}`);
176
+ let timeoutId;
177
+ const timeoutPromise = new Promise((_, reject) => {
178
+ timeoutId = setTimeout(() => {
179
+ reject(new Error(`Execution timed out after ${CliController_1.MAX_WAIT_MS / 1000}s`));
180
+ }, CliController_1.MAX_WAIT_MS);
181
+ });
182
+ try {
183
+ const runResult = await Promise.race([
184
+ this.activeExecutions.getPostExecutePromise(executionId),
185
+ timeoutPromise,
186
+ ]);
187
+ if (timeoutId)
188
+ clearTimeout(timeoutId);
189
+ const totalTime = ((Date.now() - startTime) / 1000).toFixed(1);
190
+ if (!runResult) {
191
+ this.logger.error('[cli] Execution returned no data');
192
+ res.json({
193
+ success: false,
194
+ executionId,
195
+ status: 'error',
196
+ executionTime: totalTime,
197
+ error: 'Execution returned no data',
198
+ });
199
+ return;
200
+ }
201
+ const isSuccess = runResult.status !== 'error' && !runResult.data.resultData?.error;
202
+ this.logger.info(`[cli] Execution completed in ${totalTime}s — status: ${runResult.status}, success: ${isSuccess}`);
203
+ const fullExecution = await this.executionRepository.findSingleExecution(executionId, {
204
+ includeData: true,
205
+ unflattenData: true,
206
+ });
207
+ res.json({
208
+ success: isSuccess,
209
+ executionId,
210
+ status: runResult.status,
211
+ executionTime: totalTime,
212
+ data: fullExecution?.data?.resultData ?? runResult.data.resultData,
213
+ });
214
+ }
215
+ catch (error) {
216
+ if (timeoutId)
217
+ clearTimeout(timeoutId);
218
+ throw error;
219
+ }
220
+ }
221
+ catch (error) {
222
+ const totalTime = ((Date.now() - startTime) / 1000).toFixed(1);
223
+ this.logger.error(`[cli] Error: ${error instanceof Error ? error.message : String(error)}`);
224
+ res.status(500).json({
225
+ success: false,
226
+ executionTime: totalTime,
227
+ error: error instanceof Error ? error.message : String(error),
228
+ });
229
+ }
230
+ }
231
+ async syncWorkflow(fileData, userId) {
232
+ if (fileData.id && (0, utils_1.isWorkflowIdValid)(fileData.id)) {
233
+ const existing = await this.workflowRepository.findOneBy({ id: fileData.id });
234
+ if (existing) {
235
+ const fileUpdatedAt = fileData.updatedAt
236
+ ? new Date(fileData.updatedAt)
237
+ : null;
238
+ const serverUpdatedAt = existing.updatedAt
239
+ ? new Date(existing.updatedAt)
240
+ : null;
241
+ if (fileUpdatedAt && serverUpdatedAt && fileUpdatedAt > serverUpdatedAt) {
242
+ this.logger.info(`[cli] Updating existing workflow (ID match): ${existing.id}`);
243
+ await this.workflowRepository.update(existing.id, {
244
+ nodes: fileData.nodes,
245
+ connections: fileData.connections,
246
+ settings: fileData.settings,
247
+ name: fileData.name,
248
+ updatedAt: new Date(),
249
+ });
250
+ }
251
+ else {
252
+ this.logger.info(`[cli] Using existing workflow (ID match): ${existing.id}`);
253
+ }
254
+ return existing.id;
255
+ }
256
+ }
257
+ if (fileData.name) {
258
+ const existing = await this.workflowRepository.findOneBy({ name: fileData.name });
259
+ if (existing) {
260
+ const fileUpdatedAt = fileData.updatedAt
261
+ ? new Date(fileData.updatedAt)
262
+ : null;
263
+ const serverUpdatedAt = existing.updatedAt
264
+ ? new Date(existing.updatedAt)
265
+ : null;
266
+ if (fileUpdatedAt && serverUpdatedAt && fileUpdatedAt > serverUpdatedAt) {
267
+ this.logger.info(`[cli] Updating existing workflow (name match): ${existing.id}`);
268
+ await this.workflowRepository.update(existing.id, {
269
+ nodes: fileData.nodes,
270
+ connections: fileData.connections,
271
+ settings: fileData.settings,
272
+ name: fileData.name,
273
+ updatedAt: new Date(),
274
+ });
275
+ }
276
+ else {
277
+ this.logger.info(`[cli] Using existing workflow (name match): ${existing.id}`);
278
+ }
279
+ return existing.id;
280
+ }
281
+ }
282
+ const workflowId = fileData.id && (0, utils_1.isWorkflowIdValid)(fileData.id) ? fileData.id : (0, db_1.generateNanoId)();
283
+ fileData.id = workflowId;
284
+ this.logger.info(`[cli] Creating new workflow: "${fileData.name}" (ID: ${workflowId})`);
285
+ const { manager: dbManager } = this.workflowRepository;
286
+ await dbManager.transaction(async (transactionManager) => {
287
+ const personalProject = await this.projectRepository.getPersonalProjectForUserOrFail(userId, transactionManager);
288
+ const workflowEntity = this.workflowRepository.create({
289
+ ...fileData,
290
+ active: false,
291
+ isArchived: false,
292
+ versionId: fileData.versionId || (0, uuid_1.v4)(),
293
+ createdAt: fileData.createdAt || new Date(),
294
+ updatedAt: fileData.updatedAt || new Date(),
295
+ });
296
+ const savedWorkflow = await transactionManager.save(workflowEntity);
297
+ const sharedWorkflow = this.sharedWorkflowRepository.create({
298
+ role: 'workflow:owner',
299
+ projectId: personalProject.id,
300
+ workflow: savedWorkflow,
301
+ });
302
+ await transactionManager.save(sharedWorkflow);
303
+ });
304
+ return workflowId;
305
+ }
306
+ async health() {
307
+ return { status: 'ok', timestamp: new Date().toISOString() };
308
+ }
309
+ };
310
+ exports.CliController = CliController;
311
+ CliController.MAX_WAIT_MS = 5 * 60 * 1000;
312
+ __decorate([
313
+ (0, decorators_1.Post)('/run', { skipAuth: true }),
314
+ __metadata("design:type", Function),
315
+ __metadata("design:paramtypes", [Object, Object]),
316
+ __metadata("design:returntype", Promise)
317
+ ], CliController.prototype, "run", null);
318
+ __decorate([
319
+ (0, decorators_1.Get)('/health', { skipAuth: true }),
320
+ __metadata("design:type", Function),
321
+ __metadata("design:paramtypes", []),
322
+ __metadata("design:returntype", Promise)
323
+ ], CliController.prototype, "health", null);
324
+ exports.CliController = CliController = CliController_1 = __decorate([
325
+ (0, decorators_1.RestController)('/cli'),
326
+ __metadata("design:paramtypes", [backend_common_1.Logger,
327
+ db_1.WorkflowRepository,
328
+ db_1.SharedWorkflowRepository,
329
+ db_1.ProjectRepository,
330
+ db_1.ExecutionRepository,
331
+ ownership_service_1.OwnershipService,
332
+ active_executions_1.ActiveExecutions,
333
+ workflow_runner_1.WorkflowRunner])
334
+ ], CliController);
File without changes
@@ -63,9 +63,9 @@ export declare class UsersController {
63
63
  mfaEnabled?: boolean | undefined;
64
64
  isOwner?: boolean | undefined;
65
65
  projectRelations?: {
66
+ role: string;
66
67
  id: string;
67
68
  name: string;
68
- role: string;
69
69
  }[] | null | undefined;
70
70
  isPending?: boolean | undefined;
71
71
  signInType?: string | undefined;
@@ -23,10 +23,10 @@ export declare class SourceControlStatusService {
23
23
  getStatus(user: User, options: SourceControlGetStatus): Promise<{
24
24
  type: "workflow" | "project" | "credential" | "file" | "tags" | "variables" | "folders";
25
25
  status: "unknown" | "new" | "modified" | "deleted" | "created" | "renamed" | "conflicted" | "ignored" | "staged";
26
+ file: string;
26
27
  id: string;
27
28
  name: string;
28
29
  updatedAt: string;
29
- file: string;
30
30
  location: "local" | "remote";
31
31
  conflict: boolean;
32
32
  pushed?: boolean | undefined;
@@ -63,10 +63,10 @@ export declare class SourceControlStatusService {
63
63
  sourceControlledFiles: {
64
64
  type: "workflow" | "project" | "credential" | "file" | "tags" | "variables" | "folders";
65
65
  status: "unknown" | "new" | "modified" | "deleted" | "created" | "renamed" | "conflicted" | "ignored" | "staged";
66
+ file: string;
66
67
  id: string;
67
68
  name: string;
68
69
  updatedAt: string;
69
- file: string;
70
70
  location: "local" | "remote";
71
71
  conflict: boolean;
72
72
  pushed?: boolean | undefined;
@@ -31,10 +31,10 @@ export declare class SourceControlController {
31
31
  getStatus(req: SourceControlRequest.GetStatus): Promise<{
32
32
  type: "workflow" | "project" | "credential" | "file" | "tags" | "variables" | "folders";
33
33
  status: "unknown" | "new" | "modified" | "deleted" | "created" | "renamed" | "conflicted" | "ignored" | "staged";
34
+ file: string;
34
35
  id: string;
35
36
  name: string;
36
37
  updatedAt: string;
37
- file: string;
38
38
  location: "local" | "remote";
39
39
  conflict: boolean;
40
40
  pushed?: boolean | undefined;
@@ -71,10 +71,10 @@ export declare class SourceControlController {
71
71
  sourceControlledFiles: {
72
72
  type: "workflow" | "project" | "credential" | "file" | "tags" | "variables" | "folders";
73
73
  status: "unknown" | "new" | "modified" | "deleted" | "created" | "renamed" | "conflicted" | "ignored" | "staged";
74
+ file: string;
74
75
  id: string;
75
76
  name: string;
76
77
  updatedAt: string;
77
- file: string;
78
78
  location: "local" | "remote";
79
79
  conflict: boolean;
80
80
  pushed?: boolean | undefined;
@@ -88,10 +88,10 @@ export declare class SourceControlController {
88
88
  status(req: SourceControlRequest.GetStatus): Promise<{
89
89
  type: "workflow" | "project" | "credential" | "file" | "tags" | "variables" | "folders";
90
90
  status: "unknown" | "new" | "modified" | "deleted" | "created" | "renamed" | "conflicted" | "ignored" | "staged";
91
+ file: string;
91
92
  id: string;
92
93
  name: string;
93
94
  updatedAt: string;
94
- file: string;
95
95
  location: "local" | "remote";
96
96
  conflict: boolean;
97
97
  pushed?: boolean | undefined;
@@ -128,10 +128,10 @@ export declare class SourceControlController {
128
128
  sourceControlledFiles: {
129
129
  type: "workflow" | "project" | "credential" | "file" | "tags" | "variables" | "folders";
130
130
  status: "unknown" | "new" | "modified" | "deleted" | "created" | "renamed" | "conflicted" | "ignored" | "staged";
131
+ file: string;
131
132
  id: string;
132
133
  name: string;
133
134
  updatedAt: string;
134
- file: string;
135
135
  location: "local" | "remote";
136
136
  conflict: boolean;
137
137
  pushed?: boolean | undefined;
@@ -57,10 +57,10 @@ export declare class SourceControlService {
57
57
  getStatus(user: User, options: SourceControlGetStatus): Promise<{
58
58
  type: "workflow" | "project" | "credential" | "file" | "tags" | "variables" | "folders";
59
59
  status: "unknown" | "new" | "modified" | "deleted" | "created" | "renamed" | "conflicted" | "ignored" | "staged";
60
+ file: string;
60
61
  id: string;
61
62
  name: string;
62
63
  updatedAt: string;
63
- file: string;
64
64
  location: "local" | "remote";
65
65
  conflict: boolean;
66
66
  pushed?: boolean | undefined;
@@ -97,10 +97,10 @@ export declare class SourceControlService {
97
97
  sourceControlledFiles: {
98
98
  type: "workflow" | "project" | "credential" | "file" | "tags" | "variables" | "folders";
99
99
  status: "unknown" | "new" | "modified" | "deleted" | "created" | "renamed" | "conflicted" | "ignored" | "staged";
100
+ file: string;
100
101
  id: string;
101
102
  name: string;
102
103
  updatedAt: string;
103
- file: string;
104
104
  location: "local" | "remote";
105
105
  conflict: boolean;
106
106
  pushed?: boolean | undefined;
File without changes
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export {};
1
+ export { default } from './node-lib';
2
+ export { run, type N8nRunOptions } from './node-lib';
package/dist/index.js CHANGED
@@ -1,2 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.run = exports.default = void 0;
7
+ var node_lib_1 = require("./node-lib");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(node_lib_1).default; } });
9
+ var node_lib_2 = require("./node-lib");
10
+ Object.defineProperty(exports, "run", { enumerable: true, get: function () { return node_lib_2.run; } });
File without changes
File without changes
@@ -12,11 +12,11 @@ declare const inputSchema: z.ZodObject<{
12
12
  type: z.ZodLiteral<"chat">;
13
13
  chatInput: z.ZodString;
14
14
  }, "strip", z.ZodTypeAny, {
15
- type: "chat";
16
15
  chatInput: string;
17
- }, {
18
16
  type: "chat";
17
+ }, {
19
18
  chatInput: string;
19
+ type: "chat";
20
20
  }>, z.ZodObject<{
21
21
  type: z.ZodLiteral<"form">;
22
22
  formData: z.ZodRecord<z.ZodString, z.ZodUnknown>;
@@ -34,20 +34,20 @@ declare const inputSchema: z.ZodObject<{
34
34
  body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
35
35
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
36
36
  }, "strip", z.ZodTypeAny, {
37
- method: "OPTIONS" | "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT";
37
+ method: "POST" | "OPTIONS" | "DELETE" | "GET" | "HEAD" | "PATCH" | "PUT";
38
38
  body?: Record<string, unknown> | undefined;
39
39
  query?: Record<string, string> | undefined;
40
40
  headers?: Record<string, string> | undefined;
41
41
  }, {
42
+ method?: "POST" | "OPTIONS" | "DELETE" | "GET" | "HEAD" | "PATCH" | "PUT" | undefined;
42
43
  body?: Record<string, unknown> | undefined;
43
- method?: "OPTIONS" | "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT" | undefined;
44
44
  query?: Record<string, string> | undefined;
45
45
  headers?: Record<string, string> | undefined;
46
46
  }>;
47
47
  }, "strip", z.ZodTypeAny, {
48
48
  type: "webhook";
49
49
  webhookData: {
50
- method: "OPTIONS" | "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT";
50
+ method: "POST" | "OPTIONS" | "DELETE" | "GET" | "HEAD" | "PATCH" | "PUT";
51
51
  body?: Record<string, unknown> | undefined;
52
52
  query?: Record<string, string> | undefined;
53
53
  headers?: Record<string, string> | undefined;
@@ -55,8 +55,8 @@ declare const inputSchema: z.ZodObject<{
55
55
  }, {
56
56
  type: "webhook";
57
57
  webhookData: {
58
+ method?: "POST" | "OPTIONS" | "DELETE" | "GET" | "HEAD" | "PATCH" | "PUT" | undefined;
58
59
  body?: Record<string, unknown> | undefined;
59
- method?: "OPTIONS" | "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT" | undefined;
60
60
  query?: Record<string, string> | undefined;
61
61
  headers?: Record<string, string> | undefined;
62
62
  };
@@ -64,15 +64,15 @@ declare const inputSchema: z.ZodObject<{
64
64
  }, "strip", z.ZodTypeAny, {
65
65
  workflowId: string;
66
66
  inputs?: {
67
- type: "chat";
68
67
  chatInput: string;
68
+ type: "chat";
69
69
  } | {
70
70
  type: "form";
71
71
  formData: Record<string, unknown>;
72
72
  } | {
73
73
  type: "webhook";
74
74
  webhookData: {
75
- method: "OPTIONS" | "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT";
75
+ method: "POST" | "OPTIONS" | "DELETE" | "GET" | "HEAD" | "PATCH" | "PUT";
76
76
  body?: Record<string, unknown> | undefined;
77
77
  query?: Record<string, string> | undefined;
78
78
  headers?: Record<string, string> | undefined;
@@ -81,16 +81,16 @@ declare const inputSchema: z.ZodObject<{
81
81
  }, {
82
82
  workflowId: string;
83
83
  inputs?: {
84
- type: "chat";
85
84
  chatInput: string;
85
+ type: "chat";
86
86
  } | {
87
87
  type: "form";
88
88
  formData: Record<string, unknown>;
89
89
  } | {
90
90
  type: "webhook";
91
91
  webhookData: {
92
+ method?: "POST" | "OPTIONS" | "DELETE" | "GET" | "HEAD" | "PATCH" | "PUT" | undefined;
92
93
  body?: Record<string, unknown> | undefined;
93
- method?: "OPTIONS" | "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT" | undefined;
94
94
  query?: Record<string, string> | undefined;
95
95
  headers?: Record<string, string> | undefined;
96
96
  };
@@ -129,20 +129,20 @@ export declare const workflowDetailsOutputSchema: z.ZodObject<{
129
129
  triggerInfo: z.ZodString;
130
130
  }, "strip", z.ZodTypeAny, {
131
131
  workflow: {
132
+ name: string | null;
133
+ nodes: z.objectOutputType<{
134
+ name: z.ZodString;
135
+ type: z.ZodString;
136
+ }, z.ZodTypeAny, "passthrough">[];
132
137
  tags: z.objectOutputType<{
133
138
  id: z.ZodString;
134
139
  name: z.ZodString;
135
140
  }, z.ZodTypeAny, "passthrough">[];
136
141
  id: string;
137
- name: string | null;
138
142
  active: boolean;
139
143
  versionId: string;
140
144
  createdAt: string | null;
141
145
  updatedAt: string | null;
142
- nodes: z.objectOutputType<{
143
- name: z.ZodString;
144
- type: z.ZodString;
145
- }, z.ZodTypeAny, "passthrough">[];
146
146
  connections: Record<string, unknown>;
147
147
  isArchived: boolean;
148
148
  parentFolderId: string | null;
@@ -156,20 +156,20 @@ export declare const workflowDetailsOutputSchema: z.ZodObject<{
156
156
  triggerInfo: string;
157
157
  }, {
158
158
  workflow: {
159
+ name: string | null;
160
+ nodes: z.objectInputType<{
161
+ name: z.ZodString;
162
+ type: z.ZodString;
163
+ }, z.ZodTypeAny, "passthrough">[];
159
164
  tags: z.objectInputType<{
160
165
  id: z.ZodString;
161
166
  name: z.ZodString;
162
167
  }, z.ZodTypeAny, "passthrough">[];
163
168
  id: string;
164
- name: string | null;
165
169
  active: boolean;
166
170
  versionId: string;
167
171
  createdAt: string | null;
168
172
  updatedAt: string | null;
169
- nodes: z.objectInputType<{
170
- name: z.ZodString;
171
- type: z.ZodString;
172
- }, z.ZodTypeAny, "passthrough">[];
173
173
  connections: Record<string, unknown>;
174
174
  isArchived: boolean;
175
175
  parentFolderId: string | null;
@@ -0,0 +1,10 @@
1
+ interface N8nRunOptions {
2
+ port?: number;
3
+ baseUrl?: string;
4
+ }
5
+ declare function run(filePath: string, input?: string | Record<string, unknown>, debug?: boolean, options?: N8nRunOptions): Promise<unknown[]>;
6
+ declare const n8n: {
7
+ run: typeof run;
8
+ };
9
+ export default n8n;
10
+ export { run, type N8nRunOptions };