Compare commits

...

3 Commits

Author SHA1 Message Date
Romuald Członkowski
b92e511463 perf: optimize workflow tool responses for token efficiency (v2.29.0) (#479)
* perf: optimize workflow tool responses for token efficiency (v2.29.0)

Reduce response sizes by 75-90% for 4 workflow management tools:

- n8n_update_partial_workflow: Returns {id, name, active, operationsApplied}
- n8n_create_workflow: Returns {id, name, active, nodeCount}
- n8n_update_full_workflow: Returns {id, name, active, nodeCount}
- n8n_delete_workflow: Returns {id, name, deleted: true}

AI agents can use n8n_get_workflow with mode 'structure' if they need
to verify the current workflow state after operations.

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: update tests and add nodeCount to partial update response

- Fix handleCreateWorkflow test to expect minimal response
- Fix handleDeleteWorkflow test to expect minimal response
- Add nodeCount to n8n_update_partial_workflow response for consistency
- Update documentation and CHANGELOG

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: update handlers-workflow-diff tests for minimal response

Update 3 more tests that expected full workflow in response:
- should apply diff operations successfully
- should activate workflow after successful update
- should deactivate workflow after successful update

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: update integration tests to use minimal response format

Integration tests now verify minimal response format and use
client.getWorkflow() to fetch actual workflow state for verification.

Conceived by Romuald Czlonkowski - www.aiadvisors.pl/en

* fix: update create/update workflow integration tests for minimal response

Integration tests now verify minimal response and use client.getWorkflow()
to fetch actual workflow state for detailed verification.

Conceived by Romuald Czlonkowski - www.aiadvisors.pl/en

* fix: add type assertions to fix TypeScript errors in tests

Conceived by Romuald Czlonkowski - www.aiadvisors.pl/en

---------

Co-authored-by: Romuald Członkowski <romualdczlonkowski@MacBook-Pro-Romuald.local>
Co-authored-by: Claude <noreply@anthropic.com>
2025-12-09 16:36:17 +01:00
Romuald Członkowski
130dd44ea5 chore: update n8n to 1.123.4 and bump version to 2.28.9 (#478)
- Updated n8n from 1.122.4 to 1.123.4
- Updated n8n-core from 1.121.1 to 1.122.1
- Updated n8n-workflow from 1.119.1 to 1.120.0
- Updated @n8n/n8n-nodes-langchain from 1.121.1 to 1.122.1
- Rebuilt node database with 545 nodes (439 from n8n-nodes-base, 106 from @n8n/n8n-nodes-langchain)
- Updated README badge with new n8n version
- Updated CHANGELOG with dependency changes

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Romuald Członkowski <romualdczlonkowski@MacBook-Pro-Romuald.local>
Co-authored-by: Claude <noreply@anthropic.com>
2025-12-08 22:54:50 +01:00
Romuald Członkowski
560e0c5b86 fix: pass context parameter to handleGetWorkflow in handleValidateWorkflow (#474) (#475)
Fixed n8n_validate_workflow tool failing in multi-tenant mode with error:
"n8n API not configured. Please set N8N_API_URL and N8N_API_KEY environment variables."

Root cause: handleValidateWorkflow called handleGetWorkflow without the context parameter.

Closes #474

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Romuald Członkowski <romualdczlonkowski@MacBook-Pro-Romuald.local>
Co-authored-by: Claude <noreply@anthropic.com>
2025-12-07 23:49:21 +01:00
36 changed files with 493 additions and 5986 deletions

View File

@@ -7,6 +7,61 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [2.29.0] - 2025-12-09
### Performance
**Token-Efficient Workflow Tool Responses (#479)**
Optimized 4 workflow management tools to return minimal responses instead of full workflow objects, reducing token usage by 75-90%:
- **n8n_update_partial_workflow**: Returns `{id, name, active, nodeCount, operationsApplied}` instead of full workflow
- **n8n_create_workflow**: Returns `{id, name, active, nodeCount}` instead of full workflow
- **n8n_update_full_workflow**: Returns `{id, name, active, nodeCount}` instead of full workflow
- **n8n_delete_workflow**: Returns `{id, name, deleted: true}` instead of full deleted workflow
**Impact**:
- ~75-90% reduction in response token usage per operation
- Messages now guide AI agents to use `n8n_get_workflow` with mode 'structure' if verification needed
- No functional changes - full workflow data still available via `n8n_get_workflow`
**Files Modified**:
- `src/mcp/handlers-workflow-diff.ts` - Optimized partial update response
- `src/mcp/handlers-n8n-manager.ts` - Optimized create, full update, and delete responses
- `src/mcp/tool-docs/workflow_management/*.ts` - Updated documentation
**Conceived by Romuald Członkowski - [AiAdvisors](https://www.aiadvisors.pl/en)**
## [2.28.9] - 2025-12-08
### Dependencies
**Updated n8n to 1.123.4**
- Updated n8n from 1.122.4 to 1.123.4
- Updated n8n-core from 1.121.1 to 1.122.1
- Updated n8n-workflow from 1.119.1 to 1.120.0
- Updated @n8n/n8n-nodes-langchain from 1.121.1 to 1.122.1
- Rebuilt node database with 545 nodes (439 from n8n-nodes-base, 106 from @n8n/n8n-nodes-langchain)
- Updated README badge with new n8n version
**Conceived by Romuald Członkowski - [AiAdvisors](https://www.aiadvisors.pl/en)**
## [2.28.8] - 2025-12-07
### Bug Fixes
**Multi-tenant: handleValidateWorkflow missing context parameter (#474)**
Fixed `n8n_validate_workflow` tool failing in multi-tenant mode with error:
`"n8n API not configured. Please set N8N_API_URL and N8N_API_KEY environment variables."`
- **Root Cause**: `handleValidateWorkflow` called `handleGetWorkflow` without passing the `context` parameter
- **Impact**: Multi-tenant deployments could not use the `n8n_validate_workflow` tool
- **Solution**: Pass `context` parameter to `handleGetWorkflow` call (line 987)
**Conceived by Romuald Członkowski - [AiAdvisors](https://www.aiadvisors.pl/en)**
## [2.28.7] - 2025-12-05
### Bug Fixes

View File

@@ -5,7 +5,7 @@
[![npm version](https://img.shields.io/npm/v/n8n-mcp.svg)](https://www.npmjs.com/package/n8n-mcp)
[![codecov](https://codecov.io/gh/czlonkowski/n8n-mcp/graph/badge.svg?token=YOUR_TOKEN)](https://codecov.io/gh/czlonkowski/n8n-mcp)
[![Tests](https://img.shields.io/badge/tests-3336%20passing-brightgreen.svg)](https://github.com/czlonkowski/n8n-mcp/actions)
[![n8n version](https://img.shields.io/badge/n8n-1.122.4-orange.svg)](https://github.com/n8n-io/n8n)
[![n8n version](https://img.shields.io/badge/n8n-1.123.4-orange.svg)](https://github.com/n8n-io/n8n)
[![Docker](https://img.shields.io/badge/docker-ghcr.io%2Fczlonkowski%2Fn8n--mcp-green.svg)](https://github.com/czlonkowski/n8n-mcp/pkgs/container/n8n-mcp)
[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/n8n-mcp?referralCode=n8n-mcp)

Binary file not shown.

View File

@@ -1 +1 @@
{"version":3,"file":"http-server-single-session.d.ts","sourceRoot":"","sources":["../src/http-server-single-session.ts"],"names":[],"mappings":";AAMA,OAAO,OAAO,MAAM,SAAS,CAAC;AAoB9B,OAAO,EAAE,eAAe,EAA2B,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAuErD,qBAAa,uBAAuB;IAElC,OAAO,CAAC,UAAU,CAA8D;IAChF,OAAO,CAAC,OAAO,CAA0D;IACzE,OAAO,CAAC,eAAe,CAAsE;IAC7F,OAAO,CAAC,eAAe,CAA4D;IACnF,OAAO,CAAC,kBAAkB,CAAyC;IACnE,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,cAAc,CAAwB;IAC9C,OAAO,CAAC,aAAa,CAAM;IAC3B,OAAO,CAAC,cAAc,CAAkB;IACxC,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,YAAY,CAA+B;;IAcnD,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,sBAAsB;YAqChB,aAAa;IAkC3B,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,gBAAgB;IAkBxB,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,sBAAsB;IAkC9B,OAAO,CAAC,mBAAmB;YASb,oBAAoB;YAwBpB,oBAAoB;IAwBlC,OAAO,CAAC,iBAAiB;IAs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[sessionId];
delete this.sessionMetadata[sessionId];
delete this.sessionContexts[sessionId];
if (server) {
await server.close();
if (server && typeof server.close === 'function') {
try {
await server.close();
}
catch (serverError) {
logger_1.logger.warn('Error closing server', { sessionId, error: serverError });
}
}
if (transport) {
await transport.close();

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"file":"handlers-n8n-manager.d.ts","sourceRoot":"","sources":["../../src/mcp/handlers-n8n-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAML,eAAe,EAGhB,MAAM,kBAAkB,CAAC;AAkB1B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAA2B,MAAM,2BAA2B,CAAC;AAOrF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAqNhE,wBAAgB,0BAA0B,IAAI,MAAM,CAEnD;AAMD,wBAAgB,uBAAuB,gDAEtC;AAKD,wBAAgB,kBAAkB,IAAI,IAAI,CAIzC;AAED,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,YAAY,GAAG,IAAI,CAgF9E;AAqHD,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CA8E7G;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAiC1G;AAED,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAoDjH;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAmDnH;AAED,wBAAsB,wBAAw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,CAAC,CAwJ3G;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CA4F3G;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAgD7G;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAiC9G;AAID,wBAAsB,iBAAiB,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAwG3F;AAkLD,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAkQxG;AAED,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,OAAO,EACb,UAAU,EAAE,cAAc,EAC1B,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,eAAe,CAAC,CAsL1B;AA+BD,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,OAAO,EACb,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,cAAc,EAC1B,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,eAAe,CAAC,CAoM1B;AAQD,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAyErH"}

View File

@@ -285,8 +285,13 @@ async function handleCreateWorkflow(args, context) {
telemetry_1.telemetry.trackWorkflowCreation(workflow, true);
return {
success: true,
data: workflow,
message: `Workflow "${workflow.name}" created successfully with ID: ${workflow.id}`
data: {
id: workflow.id,
name: workflow.name,
active: workflow.active,
nodeCount: workflow.nodes?.length || 0
},
message: `Workflow "${workflow.name}" created successfully with ID: ${workflow.id}. Use n8n_get_workflow with mode 'structure' to verify current state.`
};
}
catch (error) {
@@ -537,8 +542,13 @@ async function handleUpdateWorkflow(args, repository, context) {
}
return {
success: true,
data: workflow,
message: `Workflow "${workflow.name}" updated successfully`
data: {
id: workflow.id,
name: workflow.name,
active: workflow.active,
nodeCount: workflow.nodes?.length || 0
},
message: `Workflow "${workflow.name}" updated successfully. Use n8n_get_workflow with mode 'structure' to verify current state.`
};
}
catch (error) {
@@ -594,8 +604,12 @@ async function handleDeleteWorkflow(args, context) {
const deleted = await client.deleteWorkflow(id);
return {
success: true,
data: deleted,
message: `Workflow ${id} deleted successfully`
data: {
id: deleted?.id || id,
name: deleted?.name,
deleted: true
},
message: `Workflow "${deleted?.name || id}" deleted successfully.`
};
}
catch (error) {
@@ -682,7 +696,7 @@ async function handleValidateWorkflow(args, repository, context) {
try {
const client = ensureApiConfigured(context);
const input = validateWorkflowSchema.parse(args);
const workflowResponse = await handleGetWorkflow({ id: input.id });
const workflowResponse = await handleGetWorkflow({ id: input.id }, context);
if (!workflowResponse.success) {
return workflowResponse;
}

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"file":"handlers-workflow-diff.d.ts","sourceRoot":"","sources":["../../src/mcp/handlers-workflow-diff.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AA0D7D,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,OAAO,EACb,UAAU,EAAE,cAAc,EAC1B,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,eAAe,CAAC,CA2V1B"}
{"version":3,"file":"handlers-workflow-diff.d.ts","sourceRoot":"","sources":["../../src/mcp/handlers-workflow-diff.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AA0D7D,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,OAAO,EACb,UAAU,EAAE,cAAc,EAC1B,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,eAAe,CAAC,CA4V1B"}

View File

@@ -329,13 +329,14 @@ async function handleUpdatePartialWorkflow(args, repository, context) {
}
return {
success: true,
data: finalWorkflow,
message: `Workflow "${finalWorkflow.name}" updated successfully. Applied ${diffResult.operationsApplied} operations.${activationMessage}`,
details: {
operationsApplied: diffResult.operationsApplied,
workflowId: finalWorkflow.id,
workflowName: finalWorkflow.name,
data: {
id: finalWorkflow.id,
name: finalWorkflow.name,
active: finalWorkflow.active,
operationsApplied: diffResult.operationsApplied
},
message: `Workflow "${finalWorkflow.name}" updated successfully. Applied ${diffResult.operationsApplied} operations.${activationMessage} Use n8n_get_workflow with mode 'structure' to verify current state.`,
details: {
applied: diffResult.applied,
failed: diffResult.failed,
errors: diffResult.errors,

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAsCA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAkFnE,qBAAa,yBAAyB;IACpC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,EAAE,CAAgC;IAC1C,OAAO,CAAC,UAAU,CAA+B;IACjD,OAAO,CAAC,eAAe,CAAgC;IACvD,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,eAAe,CAAC,CAAkB;IAC1C,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,qBAAqB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MCPServer {
async close() {
try {
await this.server.close();
this.cache.clear();
this.cache.destroy();
if (this.db) {
try {
this.db.close();
}
catch (dbError) {
logger_1.logger.warn('Error closing database', {
error: dbError instanceof Error ? dbError.message : String(dbError)
});
}
}
this.db = null;
this.repository = null;
this.templateService = null;

File diff suppressed because one or more lines are too long

View File

@@ -24,7 +24,7 @@ exports.n8nCreateWorkflowDoc = {
connections: { type: 'object', required: true, description: 'Node connections. Keys are source node IDs' },
settings: { type: 'object', description: 'Optional workflow settings (timezone, error handling, etc.)' }
},
returns: 'Created workflow object with id, name, nodes, connections, active status',
returns: 'Minimal summary (id, name, active, nodeCount) for token efficiency. Use n8n_get_workflow with mode "structure" to verify current state if needed.',
examples: [
`// Basic webhook to Slack workflow
n8n_create_workflow({

View File

@@ -1 +1 @@
{"version":3,"file":"n8n-create-workflow.js","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/workflow_management/n8n-create-workflow.ts"],"names":[],"mappings":";;;AAEa,QAAA,oBAAoB,GAAsB;IACrD,IAAI,EAAE,qBAAqB;IAC3B,QAAQ,EAAE,qBAAqB;IAC/B,UAAU,EAAE;QACV,WAAW,EAAE,sGAAsG;QACnH,aAAa,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC;QAC/C,OAAO,EAAE,0EAA0E;QACnF,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE;YACJ,2BAA2B;YAC3B,+BAA+B;YAC/B,uCAAuC;YACvC,kFAAkF;SACnF;KACF;IACD,IAAI,EAAE;QACJ,WAAW,EAAE,uLAAuL;QACpM,UAAU,EAAE;YACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE;YACtE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uEAAuE,EAAE;YAC9H,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,4CAA4C,EAAE;YAC1G,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6DAA6D,EAAE;SACzG;QACD,OAAO,EAAE,0EAA0E;QACnF,QAAQ,EAAE;YACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCH;YACG;;;;;;;;;;;GAWH;SACE;QACD,QAAQ,EAAE;YACR,4BAA4B;YAC5B,4BAA4B;YAC5B,2BAA2B;YAC3B,qBAAqB;SACtB;QACD,WAAW,EAAE,oEAAoE;QACjF,aAAa,EAAE;YACb,uCAAuC;YACvC,qBAAqB;YACrB,gCAAgC;YAChC,6BAA6B;SAC9B;QACD,QAAQ,EAAE;YACR,0GAA0G;YAC1G,gEAAgE;YAChE,yCAAyC;YACzC,kDAAkD;YAClD,4EAA4E;YAC5E,yIAAyI;YACzI,uIAAuI;SACxI;QACD,YAAY,EAAE,CAAC,mBAAmB,EAAE,6BAA6B,EAAE,mBAAmB,CAAC;KACxF;CACF,CAAC"}
{"version":3,"file":"n8n-create-workflow.js","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/workflow_management/n8n-create-workflow.ts"],"names":[],"mappings":";;;AAEa,QAAA,oBAAoB,GAAsB;IACrD,IAAI,EAAE,qBAAqB;IAC3B,QAAQ,EAAE,qBAAqB;IAC/B,UAAU,EAAE;QACV,WAAW,EAAE,sGAAsG;QACnH,aAAa,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC;QAC/C,OAAO,EAAE,0EAA0E;QACnF,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE;YACJ,2BAA2B;YAC3B,+BAA+B;YAC/B,uCAAuC;YACvC,kFAAkF;SACnF;KACF;IACD,IAAI,EAAE;QACJ,WAAW,EAAE,uLAAuL;QACpM,UAAU,EAAE;YACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE;YACtE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uEAAuE,EAAE;YAC9H,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,4CAA4C,EAAE;YAC1G,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6DAA6D,EAAE;SACzG;QACD,OAAO,EAAE,mJAAmJ;QAC5J,QAAQ,EAAE;YACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCH;YACG;;;;;;;;;;;GAWH;SACE;QACD,QAAQ,EAAE;YACR,4BAA4B;YAC5B,4BAA4B;YAC5B,2BAA2B;YAC3B,qBAAqB;SACtB;QACD,WAAW,EAAE,oEAAoE;QACjF,aAAa,EAAE;YACb,uCAAuC;YACvC,qBAAqB;YACrB,gCAAgC;YAChC,6BAA6B;SAC9B;QACD,QAAQ,EAAE;YACR,0GAA0G;YAC1G,gEAAgE;YAChE,yCAAyC;YACzC,kDAAkD;YAClD,4EAA4E;YAC5E,yIAAyI;YACzI,uIAAuI;SACxI;QACD,YAAY,EAAE,CAAC,mBAAmB,EAAE,6BAA6B,EAAE,mBAAmB,CAAC;KACxF;CACF,CAAC"}

View File

@@ -20,7 +20,7 @@ exports.n8nDeleteWorkflowDoc = {
parameters: {
id: { type: 'string', required: true, description: 'Workflow ID to delete permanently' }
},
returns: 'Success confirmation or error if workflow not found/cannot be deleted',
returns: 'Minimal confirmation (id, name, deleted: true) for token efficiency.',
examples: [
'n8n_delete_workflow({id: "abc123"}) - Delete specific workflow',
'if (confirm) { n8n_delete_workflow({id: wf.id}); } // With confirmation'

View File

@@ -1 +1 @@
{"version":3,"file":"n8n-delete-workflow.js","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/workflow_management/n8n-delete-workflow.ts"],"names":[],"mappings":";;;AAEa,QAAA,oBAAoB,GAAsB;IACrD,IAAI,EAAE,qBAAqB;IAC3B,QAAQ,EAAE,qBAAqB;IAC/B,UAAU,EAAE;QACV,WAAW,EAAE,8DAA8D;QAC3E,aAAa,EAAE,CAAC,IAAI,CAAC;QACrB,OAAO,EAAE,2CAA2C;QACpD,WAAW,EAAE,iBAAiB;QAC9B,IAAI,EAAE;YACJ,wBAAwB;YACxB,+BAA+B;YAC/B,+DAA+D;SAChE;KACF;IACD,IAAI,EAAE;QACJ,WAAW,EAAE,qPAAqP;QAClQ,UAAU,EAAE;YACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mCAAmC,EAAE;SACzF;QACD,OAAO,EAAE,uEAAuE;QAChF,QAAQ,EAAE;YACR,gEAAgE;YAChE,yEAAyE;SAC1E;QACD,QAAQ,EAAE;YACR,2BAA2B;YAC3B,yBAAyB;YACzB,2BAA2B;YAC3B,wBAAwB;YACxB,mBAAmB;SACpB;QACD,WAAW,EAAE,mGAAmG;QAChH,aAAa,EAAE;YACb,gCAAgC;YAChC,+DAA+D;YAC/D,2CAA2C;YAC3C,4CAA4C;SAC7C;QACD,QAAQ,EAAE;YACR,iDAAiD;YACjD,uCAAuC;YACvC,+BAA+B;YAC/B,iCAAiC;YACjC,0BAA0B;SAC3B;QACD,YAAY,EAAE,CAAC,kBAAkB,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,gBAAgB,CAAC;KAC1G;CACF,CAAC"}
{"version":3,"file":"n8n-delete-workflow.js","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/workflow_management/n8n-delete-workflow.ts"],"names":[],"mappings":";;;AAEa,QAAA,oBAAoB,GAAsB;IACrD,IAAI,EAAE,qBAAqB;IAC3B,QAAQ,EAAE,qBAAqB;IAC/B,UAAU,EAAE;QACV,WAAW,EAAE,8DAA8D;QAC3E,aAAa,EAAE,CAAC,IAAI,CAAC;QACrB,OAAO,EAAE,2CAA2C;QACpD,WAAW,EAAE,iBAAiB;QAC9B,IAAI,EAAE;YACJ,wBAAwB;YACxB,+BAA+B;YAC/B,+DAA+D;SAChE;KACF;IACD,IAAI,EAAE;QACJ,WAAW,EAAE,qPAAqP;QAClQ,UAAU,EAAE;YACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mCAAmC,EAAE;SACzF;QACD,OAAO,EAAE,sEAAsE;QAC/E,QAAQ,EAAE;YACR,gEAAgE;YAChE,yEAAyE;SAC1E;QACD,QAAQ,EAAE;YACR,2BAA2B;YAC3B,yBAAyB;YACzB,2BAA2B;YAC3B,wBAAwB;YACxB,mBAAmB;SACpB;QACD,WAAW,EAAE,mGAAmG;QAChH,aAAa,EAAE;YACb,gCAAgC;YAChC,+DAA+D;YAC/D,2CAA2C;YAC3C,4CAA4C;SAC7C;QACD,QAAQ,EAAE;YACR,iDAAiD;YACjD,uCAAuC;YACvC,+BAA+B;YAC/B,iCAAiC;YACjC,0BAA0B;SAC3B;QACD,YAAY,EAAE,CAAC,kBAAkB,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,gBAAgB,CAAC;KAC1G;CACF,CAAC"}

View File

@@ -26,7 +26,7 @@ exports.n8nUpdateFullWorkflowDoc = {
settings: { type: 'object', description: 'Workflow settings to update (timezone, error handling, etc.)' },
intent: { type: 'string', description: 'Intent of the change - helps to return better response. Include in every tool call. Example: "Migrate workflow to new node versions".' }
},
returns: 'Updated workflow object with all fields including the changes applied',
returns: 'Minimal summary (id, name, active, nodeCount) for token efficiency. Use n8n_get_workflow with mode "structure" to verify current state if needed.',
examples: [
'n8n_update_full_workflow({id: "abc", intent: "Rename workflow for clarity", name: "New Name"}) - Rename with intent',
'n8n_update_full_workflow({id: "abc", name: "New Name"}) - Rename only',

View File

@@ -1 +1 @@
{"version":3,"file":"n8n-update-full-workflow.js","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/workflow_management/n8n-update-full-workfl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ACD,QAAQ,EAAE;YACR,iDAAiD;YACjD,oCAAoC;YACpC,+BAA+B;YAC/B,4BAA4B;YAC5B,iDAAiD;SAClD;QACD,YAAY,EAAE,CAAC,kBAAkB,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,qBAAqB,CAAC;KAC9G;CACF,CAAC"}
{"version":3,"file":"n8n-update-full-workflow.js","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/workflow_management/n8n-update-full-workflow.ts"],"names":[],"mappings":";;;AAEa,QAAA,wBAAwB,GAAsB;IACzD,IAAI,EAAE,0BAA0B;IAChC,QAAQ,EAAE,qBAAqB;IAC/B,UAAU,EAAE;QACV,WAAW,EAAE,qHAAqH;QAClI,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,aAAa,CAAC;QAC7C,OAAO,EAAE,4EAA4E;QACrF,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE;YACJ,2EAA2E;YAC3E,gCAAgC;YAChC,sCAAsC;YACtC,0BAA0B;SAC3B;KACF;IACD,IAAI,EAAE;QACJ,WAAW,EAAE,4QAA4Q;QACzR,UAAU,EAAE;YACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE;YAC5E,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8BAA8B,EAAE;YACrE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,oEAAoE,EAAE;YAC3G,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+DAA+D,EAAE;YAC7G,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8DAA8D,EAAE;YACzG,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uIAAuI,EAAE;SACjL;QACD,OAAO,EAAE,mJAAmJ;QAC5J,QAAQ,EAAE;YACR,qHAAqH;YACrH,uEAAuE;YACvE,qIAAqI;YACrI,+IAA+I;SAChJ;QACD,QAAQ,EAAE;YACR,8BAA8B;YAC9B,mBAAmB;YACnB,0BAA0B;YAC1B,+BAA+B;YAC/B,kBAAkB;SACnB;QACD,WAAW,EAAE,wHAAwH;QACrI,aAAa,EAAE;YACb,qEAAqE;YACrE,yCAAyC;YACzC,iDAAiD;YACjD,sCAAsC;YACtC,sCAAsC;SACvC;QACD,QAAQ,EAAE;YACR,iDAAiD;YACjD,oCAAoC;YACpC,+BAA+B;YAC/B,4BAA4B;YAC5B,iDAAiD;SAClD;QACD,YAAY,EAAE,CAAC,kBAAkB,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,qBAAqB,CAAC;KAC9G;CACF,CAAC"}

View File

@@ -313,7 +313,7 @@ n8n_update_partial_workflow({
continueOnError: { type: 'boolean', description: 'If true, apply valid operations even if some fail (best-effort mode). Returns applied and failed operation indices. Default: false (atomic)' },
intent: { type: 'string', description: 'Intent of the change - helps to return better response. Include in every tool call. Example: "Add error handling for API failures".' }
},
returns: 'Updated workflow object or validation results if validateOnly=true',
returns: 'Minimal summary (id, name, active, operationsApplied) for token efficiency. Use n8n_get_workflow with mode "structure" to verify current state if needed. Returns validation results if validateOnly=true.',
examples: [
'// Include intent parameter for better responses\nn8n_update_partial_workflow({id: "abc", intent: "Add error handling for API failures", operations: [{type: "addConnection", source: "HTTP Request", target: "Error Handler"}]})',
'// Add a basic node (minimal configuration)\nn8n_update_partial_workflow({id: "abc", operations: [{type: "addNode", node: {name: "Process Data", type: "n8n-nodes-base.set", position: [400, 300], parameters: {}}}]})',

View File

@@ -1 +1 @@
{"version":3,"file":"n8n-update-partial-workflow.js","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/workflow_management/n8n-update-partial-workflow.ts"],"names":[],"mappings":";;;AAEa,QAAA,2BAA2B,GAAsB;IAC5D,IAAI,EAAE,6BAA6B;IACnC,QAAQ,EAAE,qBAAqB;IAC/B,UAAU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E;YACzE,yFAAyF;YACzF,wFAAwF;YACxF,mGAAmG;YACnG,iFAAiF;YACjF,iNAAiN;YACjN,kKAAkK;YAClK,4EAA4E;YAC5E,yFAAyF;YACzF,4LAA4L;YAC5L,oIAAoI;YACpI,wJAAwJ;YACxJ,+JAA+J;YAC/J,uEAAuE;YACvE,iKAAiK;YACjK,2FAA2F;YAC3F,gHAAgH;YAChH,kHAAkH;SACnH;QACD,YAAY,EAAE,CAAC,0BAA0B,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,qBAAqB,CAAC;KAC3G;CACF,CAAC"}
{"version":3,"file":"n8n-update-partial-workflow.js","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/workflow_management/n8n-update-partial-workflow.ts"],"names":[],"mappings":";;;AAEa,QAAA,2BAA2B,GAAsB;IAC5D,IAAI,EAAE,6BAA6B;IACnC,QAAQ,EAAE,qBAAqB;IAC/B,UAAU,EAAE;QACV,WAAW,EAAE,ggBAAggB;QAC7gB,aAAa,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,iBAAiB,CAAC;QACtD,OAAO,EAAE,6IAA6I;QACtJ,WAAW,EAAE,iBAAiB;QAC9B,IAAI,EAAE;YACJ,gJAAgJ;YAChJ,oGAAoG;YACpG,mDAAmD;YACnD,wCAAwC;YACxC,6BAA6B;YAC7B,6DAA6D;YAC7D,uDAAuD;YACvD,0DAA0D;YAC1D,kCAAkC;YAClC,iFAAiF;YACjF,mDAAmD;YACnD,gGAAgG;YAChG,sGAAsG;YACtG,yIAAyI;SAC1I;KACF;IACD,IAAI,EAAE;QACJ,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;YAC3B,yBAAyB;YACzB,iEAAiE;YACjE,+CAA+C;YAC/C,2CAA2C;YAC3C,0CAA0C;YAC1C,+CAA+C;YAC/C,kCAAkC;SACnC;QACD,WAAW,EAAE,8FAA8F;QAC3G,aAAa,EAAE;YACb,kPAAkP;YAClP,iEAAiE;YACjE,+DAA+D;YAC/D,oDAAoD;YACpD,yDAAyD;YACzD,iDAAiD;YACjD,gEAAgE;YAChE,qDAAqD;YACrD,mCAAmC;YACnC,wCAAwC;YACxC,gDAAgD;YAChD,8FAA8F;YAC9F,2EAA2E;YAC3E,6DAA6D;YAC7D,oEAAoE;YACpE,8EAA8E;YAC9E,8EAA8E;YAC9E,8GAA8G;YAC9G,kFAAkF;YAClF,kFAAkF;SACnF;QACD,QAAQ,EAAE;YACR,uGAAuG;YACvG,wEAAwE;YACxE,6DAA6D;YAC7D,sFAAsF;YACtF,4DAA4D;YAC5D,yEAAyE;YACzE,yFAAyF;YACzF,wFAAwF;YACxF,mGAAmG;YACnG,iFAAiF;YACjF,iNAAiN;YACjN,kKAAkK;YAClK,4EAA4E;YAC5E,yFAAyF;YACzF,4LAA4L;YAC5L,oIAAoI;YACpI,wJAAwJ;YACxJ,+JAA+J;YAC/J,uEAAuE;YACvE,iKAAiK;YACjK,2FAA2F;YAC3F,gHAAgH;YAChH,kHAAkH;SACnH;QACD,YAAY,EAAE,CAAC,0BAA0B,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,qBAAqB,CAAC;KAC3G;CACF,CAAC"}

6000
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "n8n-mcp",
"version": "2.28.7",
"version": "2.29.0",
"description": "Integration between n8n workflow automation and Model Context Protocol (MCP)",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -141,16 +141,16 @@
},
"dependencies": {
"@modelcontextprotocol/sdk": "1.20.1",
"@n8n/n8n-nodes-langchain": "^1.121.1",
"@n8n/n8n-nodes-langchain": "^1.122.1",
"@supabase/supabase-js": "^2.57.4",
"dotenv": "^16.5.0",
"express": "^5.1.0",
"express-rate-limit": "^7.1.5",
"form-data": "^4.0.5",
"lru-cache": "^11.2.1",
"n8n": "^1.122.4",
"n8n-core": "^1.121.1",
"n8n-workflow": "^1.119.1",
"n8n": "^1.123.4",
"n8n-core": "^1.122.1",
"n8n-workflow": "^1.120.0",
"openai": "^4.77.0",
"sql.js": "^1.13.0",
"tslib": "^2.6.2",

View File

@@ -518,8 +518,13 @@ export async function handleCreateWorkflow(args: unknown, context?: InstanceCont
return {
success: true,
data: workflow,
message: `Workflow "${workflow.name}" created successfully with ID: ${workflow.id}`
data: {
id: workflow.id,
name: workflow.name,
active: workflow.active,
nodeCount: workflow.nodes?.length || 0
},
message: `Workflow "${workflow.name}" created successfully with ID: ${workflow.id}. Use n8n_get_workflow with mode 'structure' to verify current state.`
};
} catch (error) {
if (error instanceof z.ZodError) {
@@ -813,8 +818,13 @@ export async function handleUpdateWorkflow(
return {
success: true,
data: workflow,
message: `Workflow "${workflow.name}" updated successfully`
data: {
id: workflow.id,
name: workflow.name,
active: workflow.active,
nodeCount: workflow.nodes?.length || 0
},
message: `Workflow "${workflow.name}" updated successfully. Use n8n_get_workflow with mode 'structure' to verify current state.`
};
} catch (error) {
// Track failed mutation
@@ -880,8 +890,12 @@ export async function handleDeleteWorkflow(args: unknown, context?: InstanceCont
return {
success: true,
data: deleted,
message: `Workflow ${id} deleted successfully`
data: {
id: deleted?.id || id,
name: deleted?.name,
deleted: true
},
message: `Workflow "${deleted?.name || id}" deleted successfully.`
};
} catch (error) {
if (error instanceof z.ZodError) {
@@ -984,7 +998,7 @@ export async function handleValidateWorkflow(
const input = validateWorkflowSchema.parse(args);
// First, fetch the workflow from n8n
const workflowResponse = await handleGetWorkflow({ id: input.id });
const workflowResponse = await handleGetWorkflow({ id: input.id }, context);
if (!workflowResponse.success) {
return workflowResponse; // Return the error from fetching

View File

@@ -363,13 +363,15 @@ export async function handleUpdatePartialWorkflow(
return {
success: true,
data: finalWorkflow,
message: `Workflow "${finalWorkflow.name}" updated successfully. Applied ${diffResult.operationsApplied} operations.${activationMessage}`,
details: {
operationsApplied: diffResult.operationsApplied,
workflowId: finalWorkflow.id,
workflowName: finalWorkflow.name,
data: {
id: finalWorkflow.id,
name: finalWorkflow.name,
active: finalWorkflow.active,
nodeCount: finalWorkflow.nodes?.length || 0,
operationsApplied: diffResult.operationsApplied
},
message: `Workflow "${finalWorkflow.name}" updated successfully. Applied ${diffResult.operationsApplied} operations.${activationMessage} Use n8n_get_workflow with mode 'structure' to verify current state.`,
details: {
applied: diffResult.applied,
failed: diffResult.failed,
errors: diffResult.errors,

View File

@@ -23,7 +23,7 @@ export const n8nCreateWorkflowDoc: ToolDocumentation = {
connections: { type: 'object', required: true, description: 'Node connections. Keys are source node IDs' },
settings: { type: 'object', description: 'Optional workflow settings (timezone, error handling, etc.)' }
},
returns: 'Created workflow object with id, name, nodes, connections, active status',
returns: 'Minimal summary (id, name, active, nodeCount) for token efficiency. Use n8n_get_workflow with mode "structure" to verify current state if needed.',
examples: [
`// Basic webhook to Slack workflow
n8n_create_workflow({

View File

@@ -19,7 +19,7 @@ export const n8nDeleteWorkflowDoc: ToolDocumentation = {
parameters: {
id: { type: 'string', required: true, description: 'Workflow ID to delete permanently' }
},
returns: 'Success confirmation or error if workflow not found/cannot be deleted',
returns: 'Minimal confirmation (id, name, deleted: true) for token efficiency.',
examples: [
'n8n_delete_workflow({id: "abc123"}) - Delete specific workflow',
'if (confirm) { n8n_delete_workflow({id: wf.id}); } // With confirmation'

View File

@@ -25,7 +25,7 @@ export const n8nUpdateFullWorkflowDoc: ToolDocumentation = {
settings: { type: 'object', description: 'Workflow settings to update (timezone, error handling, etc.)' },
intent: { type: 'string', description: 'Intent of the change - helps to return better response. Include in every tool call. Example: "Migrate workflow to new node versions".' }
},
returns: 'Updated workflow object with all fields including the changes applied',
returns: 'Minimal summary (id, name, active, nodeCount) for token efficiency. Use n8n_get_workflow with mode "structure" to verify current state if needed.',
examples: [
'n8n_update_full_workflow({id: "abc", intent: "Rename workflow for clarity", name: "New Name"}) - Rename with intent',
'n8n_update_full_workflow({id: "abc", name: "New Name"}) - Rename only',

View File

@@ -312,7 +312,7 @@ n8n_update_partial_workflow({
continueOnError: { type: 'boolean', description: 'If true, apply valid operations even if some fail (best-effort mode). Returns applied and failed operation indices. Default: false (atomic)' },
intent: { type: 'string', description: 'Intent of the change - helps to return better response. Include in every tool call. Example: "Add error handling for API failures".' }
},
returns: 'Updated workflow object or validation results if validateOnly=true',
returns: 'Minimal summary (id, name, active, nodeCount, operationsApplied) for token efficiency. Use n8n_get_workflow with mode "structure" to verify current state if needed. Returns validation results if validateOnly=true.',
examples: [
'// Include intent parameter for better responses\nn8n_update_partial_workflow({id: "abc", intent: "Add error handling for API failures", operations: [{type: "addConnection", source: "HTTP Request", target: "Error Handler"}]})',
'// Add a basic node (minimal configuration)\nn8n_update_partial_workflow({id: "abc", operations: [{type: "addNode", node: {name: "Process Data", type: "n8n-nodes-base.set", position: [400, 300], parameters: {}}}]})',

View File

@@ -74,17 +74,21 @@ describe('Integration: handleCreateWorkflow', () => {
const result = response.data as Workflow;
// Verify workflow created successfully
// Response now returns minimal data
expect(result).toBeDefined();
expect(result.id).toBeTruthy();
if (!result.id) throw new Error('Workflow ID is missing');
context.trackWorkflow(result.id);
expect(result.name).toBe(workflowName);
expect(result.nodes).toHaveLength(1);
expect((result as any).nodeCount).toBe(1);
// Fetch actual workflow to verify details
const workflow2 = await client.getWorkflow(result.id);
expect(workflow2.nodes).toHaveLength(1);
// Critical: Verify FULL node type format is preserved
expect(result.nodes[0].type).toBe('n8n-nodes-base.webhook');
expect(result.nodes[0].name).toBe('Webhook');
expect(result.nodes[0].parameters).toBeDefined();
expect(workflow2.nodes[0].type).toBe('n8n-nodes-base.webhook');
expect(workflow2.nodes[0].name).toBe('Webhook');
expect(workflow2.nodes[0].parameters).toBeDefined();
});
});
@@ -104,16 +108,21 @@ describe('Integration: handleCreateWorkflow', () => {
expect(response.success).toBe(true);
const result = response.data as Workflow;
// Response now returns minimal data
expect(result).toBeDefined();
expect(result.id).toBeTruthy();
if (!result.id) throw new Error('Workflow ID is missing');
context.trackWorkflow(result.id);
expect(result.name).toBe(workflowName);
expect(result.nodes).toHaveLength(2);
expect((result as any).nodeCount).toBe(2);
// Fetch actual workflow to verify details
const actual = await client.getWorkflow(result.id);
expect(actual.nodes).toHaveLength(2);
// Verify both nodes created with FULL type format
const webhookNode = result.nodes.find((n: any) => n.name === 'Webhook');
const httpNode = result.nodes.find((n: any) => n.name === 'HTTP Request');
const webhookNode = actual.nodes.find((n: any) => n.name === 'Webhook');
const httpNode = actual.nodes.find((n: any) => n.name === 'HTTP Request');
expect(webhookNode).toBeDefined();
expect(webhookNode!.type).toBe('n8n-nodes-base.webhook');
@@ -122,8 +131,8 @@ describe('Integration: handleCreateWorkflow', () => {
expect(httpNode!.type).toBe('n8n-nodes-base.httpRequest');
// Verify connections
expect(result.connections).toBeDefined();
expect(result.connections.Webhook).toBeDefined();
expect(actual.connections).toBeDefined();
expect(actual.connections.Webhook).toBeDefined();
});
it('should create workflow with langchain agent node', async () => {
@@ -137,15 +146,20 @@ describe('Integration: handleCreateWorkflow', () => {
expect(response.success).toBe(true);
const result = response.data as Workflow;
// Response now returns minimal data
expect(result).toBeDefined();
expect(result.id).toBeTruthy();
if (!result.id) throw new Error('Workflow ID is missing');
context.trackWorkflow(result.id);
expect(result.name).toBe(workflowName);
expect(result.nodes).toHaveLength(2);
expect((result as any).nodeCount).toBe(2);
// Fetch actual workflow to verify details
const actual = await client.getWorkflow(result.id);
expect(actual.nodes).toHaveLength(2);
// Verify langchain node type format
const agentNode = result.nodes.find((n: any) => n.name === 'AI Agent');
const agentNode = actual.nodes.find((n: any) => n.name === 'AI Agent');
expect(agentNode).toBeDefined();
expect(agentNode!.type).toBe('@n8n/n8n-nodes-langchain.agent');
});
@@ -161,21 +175,26 @@ describe('Integration: handleCreateWorkflow', () => {
expect(response.success).toBe(true);
const result = response.data as Workflow;
// Response now returns minimal data
expect(result).toBeDefined();
expect(result.id).toBeTruthy();
if (!result.id) throw new Error('Workflow ID is missing');
context.trackWorkflow(result.id);
expect(result.name).toBe(workflowName);
expect(result.nodes).toHaveLength(4);
expect((result as any).nodeCount).toBe(4);
// Fetch actual workflow to verify details
const actual = await client.getWorkflow(result.id);
expect(actual.nodes).toHaveLength(4);
// Verify all node types preserved
const nodeTypes = result.nodes.map((n: any) => n.type);
const nodeTypes = actual.nodes.map((n: any) => n.type);
expect(nodeTypes).toContain('n8n-nodes-base.webhook');
expect(nodeTypes).toContain('n8n-nodes-base.set');
expect(nodeTypes).toContain('n8n-nodes-base.merge');
// Verify complex connections
expect(result.connections.Webhook.main[0]).toHaveLength(2); // Branches to 2 nodes
expect(actual.connections.Webhook.main[0]).toHaveLength(2); // Branches to 2 nodes
});
});
@@ -195,19 +214,23 @@ describe('Integration: handleCreateWorkflow', () => {
expect(response.success).toBe(true);
const result = response.data as Workflow;
// Response now returns minimal data
expect(result).toBeDefined();
expect(result.id).toBeTruthy();
if (!result.id) throw new Error('Workflow ID is missing');
context.trackWorkflow(result.id);
expect(result.connections).toBeDefined();
// Fetch actual workflow to verify connections
const actual = await client.getWorkflow(result.id);
expect(actual.connections).toBeDefined();
// Verify branching: Webhook -> Set 1 and Set 2
const webhookConnections = result.connections.Webhook.main[0];
const webhookConnections = actual.connections.Webhook.main[0];
expect(webhookConnections).toHaveLength(2);
// Verify merging: Set 1 -> Merge (port 0), Set 2 -> Merge (port 1)
const set1Connections = result.connections['Set 1'].main[0];
const set2Connections = result.connections['Set 2'].main[0];
const set1Connections = actual.connections['Set 1'].main[0];
const set2Connections = actual.connections['Set 2'].main[0];
expect(set1Connections[0].node).toBe('Merge');
expect(set1Connections[0].index).toBe(0);
@@ -234,12 +257,16 @@ describe('Integration: handleCreateWorkflow', () => {
expect(response.success).toBe(true);
const result = response.data as Workflow;
// Response now returns minimal data
expect(result).toBeDefined();
expect(result.id).toBeTruthy();
if (!result.id) throw new Error('Workflow ID is missing');
context.trackWorkflow(result.id);
expect(result.settings).toBeDefined();
expect(result.settings!.executionOrder).toBe('v1');
// Fetch actual workflow to verify settings
const actual = await client.getWorkflow(result.id);
expect(actual.settings).toBeDefined();
expect(actual.settings!.executionOrder).toBe('v1');
});
it('should create workflow with n8n expressions', async () => {
@@ -253,14 +280,19 @@ describe('Integration: handleCreateWorkflow', () => {
expect(response.success).toBe(true);
const result = response.data as Workflow;
// Response now returns minimal data
expect(result).toBeDefined();
expect(result.id).toBeTruthy();
if (!result.id) throw new Error('Workflow ID is missing');
context.trackWorkflow(result.id);
expect(result.nodes).toHaveLength(2);
expect((result as any).nodeCount).toBe(2);
// Fetch actual workflow to verify expressions
const actual = await client.getWorkflow(result.id);
expect(actual.nodes).toHaveLength(2);
// Verify Set node with expressions
const setNode = result.nodes.find((n: any) => n.name === 'Set Variables');
const setNode = actual.nodes.find((n: any) => n.name === 'Set Variables');
expect(setNode).toBeDefined();
expect(setNode!.parameters.assignments).toBeDefined();
@@ -283,21 +315,26 @@ describe('Integration: handleCreateWorkflow', () => {
expect(response.success).toBe(true);
const result = response.data as Workflow;
// Response now returns minimal data
expect(result).toBeDefined();
expect(result.id).toBeTruthy();
if (!result.id) throw new Error('Workflow ID is missing');
context.trackWorkflow(result.id);
expect(result.nodes).toHaveLength(3);
expect((result as any).nodeCount).toBe(3);
// Fetch actual workflow to verify error handling
const actual = await client.getWorkflow(result.id);
expect(actual.nodes).toHaveLength(3);
// Verify HTTP node with error handling
const httpNode = result.nodes.find((n: any) => n.name === 'HTTP Request');
const httpNode = actual.nodes.find((n: any) => n.name === 'HTTP Request');
expect(httpNode).toBeDefined();
expect(httpNode!.continueOnFail).toBe(true);
expect(httpNode!.onError).toBe('continueErrorOutput');
// Verify error connection
expect(result.connections['HTTP Request'].error).toBeDefined();
expect(result.connections['HTTP Request'].error[0][0].node).toBe('Handle Error');
expect(actual.connections['HTTP Request'].error).toBeDefined();
expect(actual.connections['HTTP Request'].error[0][0].node).toBe('Handle Error');
});
});

View File

@@ -99,7 +99,13 @@ describe('Integration: handleUpdatePartialWorkflow', () => {
);
expect(response.success).toBe(true);
const updated = response.data as any;
// Response now returns minimal data - verify with a follow-up get
const responseData = response.data as any;
expect(responseData.id).toBe(created.id);
expect(responseData.nodeCount).toBe(2);
// Fetch actual workflow to verify changes
const updated = await client.getWorkflow(created.id);
expect(updated.nodes).toHaveLength(2);
expect(updated.nodes.find((n: any) => n.name === 'Set')).toBeDefined();
});
@@ -171,7 +177,13 @@ describe('Integration: handleUpdatePartialWorkflow', () => {
);
expect(response.success).toBe(true);
const updated = response.data as any;
// Response now returns minimal data - verify with a follow-up get
const responseData = response.data as any;
expect(responseData.id).toBe(created.id);
expect(responseData.nodeCount).toBe(1);
// Fetch actual workflow to verify changes
const updated = await client.getWorkflow(created.id);
expect(updated.nodes).toHaveLength(1);
expect(updated.nodes.find((n: any) => n.name === 'HTTP Request')).toBeUndefined();
});
@@ -238,9 +250,14 @@ describe('Integration: handleUpdatePartialWorkflow', () => {
);
expect(response.success).toBe(true);
const updated = response.data as any;
// Response now returns minimal data - verify with a follow-up get
expect((response.data as any).id).toBe(created.id);
// Fetch actual workflow to verify changes
const updated = await client.getWorkflow(created.id);
const webhookNode = updated.nodes.find((n: any) => n.name === 'Webhook');
expect(webhookNode.parameters.path).toBe('updated-path');
expect(webhookNode).toBeDefined();
expect(webhookNode!.parameters.path).toBe('updated-path');
});
it('should update nested parameters', async () => {
@@ -274,10 +291,15 @@ describe('Integration: handleUpdatePartialWorkflow', () => {
);
expect(response.success).toBe(true);
const updated = response.data as any;
// Response now returns minimal data - verify with a follow-up get
expect((response.data as any).id).toBe(created.id);
// Fetch actual workflow to verify changes
const updated = await client.getWorkflow(created.id);
const webhookNode = updated.nodes.find((n: any) => n.name === 'Webhook');
expect(webhookNode.parameters.httpMethod).toBe('POST');
expect(webhookNode.parameters.path).toBe('new-path');
expect(webhookNode).toBeDefined();
expect(webhookNode!.parameters.httpMethod).toBe('POST');
expect(webhookNode!.parameters.path).toBe('new-path');
});
});
@@ -312,9 +334,14 @@ describe('Integration: handleUpdatePartialWorkflow', () => {
);
expect(response.success).toBe(true);
const updated = response.data as any;
// Response now returns minimal data - verify with a follow-up get
expect((response.data as any).id).toBe(created.id);
// Fetch actual workflow to verify changes
const updated = await client.getWorkflow(created.id);
const webhookNode = updated.nodes.find((n: any) => n.name === 'Webhook');
expect(webhookNode.position).toEqual(newPosition);
expect(webhookNode).toBeDefined();
expect(webhookNode!.position).toEqual(newPosition);
});
});
@@ -346,9 +373,14 @@ describe('Integration: handleUpdatePartialWorkflow', () => {
);
expect(response.success).toBe(true);
const updated = response.data as any;
// Response now returns minimal data - verify with a follow-up get
expect((response.data as any).id).toBe(created.id);
// Fetch actual workflow to verify changes
const updated = await client.getWorkflow(created.id);
const webhookNode = updated.nodes.find((n: any) => n.name === 'Webhook');
expect(webhookNode.disabled).toBe(true);
expect(webhookNode).toBeDefined();
expect(webhookNode!.disabled).toBe(true);
});
it('should enable a disabled node', async () => {
@@ -389,10 +421,15 @@ describe('Integration: handleUpdatePartialWorkflow', () => {
);
expect(response.success).toBe(true);
const updated = response.data as any;
// Response now returns minimal data - verify with a follow-up get
expect((response.data as any).id).toBe(created.id);
// Fetch actual workflow to verify changes
const updated = await client.getWorkflow(created.id);
const webhookNode = updated.nodes.find((n: any) => n.name === 'Webhook');
expect(webhookNode).toBeDefined();
// After enabling, disabled should be false or undefined (both mean enabled)
expect(webhookNode.disabled).toBeFalsy();
expect(webhookNode!.disabled).toBeFalsy();
});
});
});
@@ -434,7 +471,11 @@ describe('Integration: handleUpdatePartialWorkflow', () => {
);
expect(response.success).toBe(true);
const updated = response.data as any;
// Response now returns minimal data - verify with a follow-up get
expect((response.data as any).id).toBe(created.id);
// Fetch actual workflow to verify changes
const updated = await client.getWorkflow(created.id);
expect(updated.connections).toBeDefined();
expect(updated.connections.Webhook).toBeDefined();
});
@@ -658,8 +699,11 @@ describe('Integration: handleUpdatePartialWorkflow', () => {
);
expect(response.success).toBe(true);
const updated = response.data as any;
// Response now returns minimal data - verify with a follow-up get
expect((response.data as any).id).toBe(created.id);
// Fetch actual workflow to verify changes
const updated = await client.getWorkflow(created.id);
// Note: n8n API may not return all settings in response
// The operation should succeed even if settings aren't reflected in the response
expect(updated.settings).toBeDefined();
@@ -822,7 +866,13 @@ describe('Integration: handleUpdatePartialWorkflow', () => {
);
expect(response.success).toBe(true);
const updated = response.data as any;
// Response now returns minimal data - verify with a follow-up get
const responseData = response.data as any;
expect(responseData.id).toBe(created.id);
expect(responseData.nodeCount).toBe(2);
// Fetch actual workflow to verify changes
const updated = await client.getWorkflow(created.id);
expect(updated.nodes).toHaveLength(2);
expect(updated.connections.Webhook).toBeDefined();
});
@@ -1040,7 +1090,13 @@ describe('Integration: handleUpdatePartialWorkflow', () => {
// Should succeed
expect(response.success).toBe(true);
const updated = response.data as any;
// Response now returns minimal data - verify with a follow-up get
const responseData = response.data as any;
expect(responseData.id).toBe(created.id);
expect(responseData.nodeCount).toBe(5); // Original 4 + 1 new
// Fetch actual workflow to verify changes
const updated = await client.getWorkflow(created.id);
expect(updated.nodes).toHaveLength(5); // Original 4 + 1 new
expect(updated.nodes.find((n: any) => n.name === 'Process Data')).toBeDefined();
});

View File

@@ -75,14 +75,18 @@ describe('Integration: handleUpdateWorkflow', () => {
mcpContext
);
// Verify MCP response
// Verify MCP response - now returns minimal data
expect(response.success).toBe(true);
expect(response.data).toBeDefined();
const updated = response.data as any;
expect(updated.id).toBe(created.id);
expect(updated.name).toBe(replacement.name);
expect(updated.nodes).toHaveLength(2); // HTTP workflow has 2 nodes
expect(updated.nodeCount).toBe(2); // HTTP workflow has 2 nodes
// Fetch actual workflow to verify
const actual = await client.getWorkflow(created.id);
expect(actual.nodes).toHaveLength(2);
});
});
@@ -147,9 +151,14 @@ describe('Integration: handleUpdateWorkflow', () => {
);
expect(response.success).toBe(true);
// Response now returns minimal data
const updated = response.data as any;
expect(updated.nodes).toHaveLength(2);
expect(updated.nodes.find((n: any) => n.name === 'Set')).toBeDefined();
expect(updated.nodeCount).toBe(2);
// Fetch actual workflow to verify
const actual = await client.getWorkflow(created.id);
expect(actual.nodes).toHaveLength(2);
expect(actual.nodes.find((n: any) => n.name === 'Set')).toBeDefined();
});
});
@@ -193,9 +202,13 @@ describe('Integration: handleUpdateWorkflow', () => {
);
expect(response.success).toBe(true);
// Response now returns minimal data
const updated = response.data as any;
// Note: n8n API may not return settings in response
expect(updated.nodes).toHaveLength(1); // Nodes unchanged
expect(updated.nodeCount).toBe(1); // Nodes unchanged
// Fetch actual workflow to verify
const actual = await client.getWorkflow(created.id);
expect(actual.nodes).toHaveLength(1);
});
});
@@ -294,9 +307,14 @@ describe('Integration: handleUpdateWorkflow', () => {
);
expect(response.success).toBe(true);
// Response now returns minimal data
const updated = response.data as any;
expect(updated.name).toBe(newName);
expect(updated.nodes).toHaveLength(1); // Structure unchanged
expect(updated.nodeCount).toBe(1); // Structure unchanged
// Fetch actual workflow to verify
const actual = await client.getWorkflow(created.id);
expect(actual.nodes).toHaveLength(1);
});
});
@@ -340,9 +358,13 @@ describe('Integration: handleUpdateWorkflow', () => {
);
expect(response.success).toBe(true);
// Response now returns minimal data
const updated = response.data as any;
expect(updated.name).toBe(newName);
expect(updated.settings?.timezone).toBe('America/New_York');
// Fetch actual workflow to verify settings
const actual = await client.getWorkflow(created.id);
expect(actual.settings?.timezone).toBe('America/New_York');
});
});
});

View File

@@ -227,8 +227,13 @@ describe('handlers-n8n-manager', () => {
expect(result).toEqual({
success: true,
data: testWorkflow,
message: 'Workflow "Test Workflow" created successfully with ID: test-workflow-id',
data: {
id: 'test-workflow-id',
name: 'Test Workflow',
active: true,
nodeCount: 1,
},
message: 'Workflow "Test Workflow" created successfully with ID: test-workflow-id. Use n8n_get_workflow with mode \'structure\' to verify current state.',
});
// Should send input as-is to API (n8n expects FULL form: n8n-nodes-base.*)
@@ -732,8 +737,12 @@ describe('handlers-n8n-manager', () => {
expect(result).toEqual({
success: true,
data: testWorkflow,
message: 'Workflow test-workflow-id deleted successfully',
data: {
id: 'test-workflow-id',
name: 'Test Workflow',
deleted: true,
},
message: 'Workflow "Test Workflow" deleted successfully.',
});
expect(mockApiClient.deleteWorkflow).toHaveBeenCalledWith('test-workflow-id');
});

View File

@@ -150,13 +150,15 @@ describe('handlers-workflow-diff', () => {
expect(result).toEqual({
success: true,
data: updatedWorkflow,
message: 'Workflow "Test Workflow" updated successfully. Applied 1 operations.',
details: {
operationsApplied: 1,
workflowId: 'test-workflow-id',
workflowName: 'Test Workflow',
data: {
id: 'test-workflow-id',
name: 'Test Workflow',
active: true,
nodeCount: 3,
operationsApplied: 1,
},
message: 'Workflow "Test Workflow" updated successfully. Applied 1 operations. Use n8n_get_workflow with mode \'structure\' to verify current state.',
details: {
applied: [0],
failed: [],
errors: [],
@@ -660,9 +662,15 @@ describe('handlers-workflow-diff', () => {
}, mockRepository);
expect(result.success).toBe(true);
expect(result.data).toEqual(activatedWorkflow);
expect(result.data).toEqual({
id: 'test-workflow-id',
name: 'Test Workflow',
active: true,
nodeCount: 2,
operationsApplied: 1,
});
expect(result.message).toContain('Workflow activated');
expect(result.details?.active).toBe(true);
expect((result.data as any).active).toBe(true);
expect(mockApiClient.activateWorkflow).toHaveBeenCalledWith('test-workflow-id');
});
@@ -689,9 +697,15 @@ describe('handlers-workflow-diff', () => {
}, mockRepository);
expect(result.success).toBe(true);
expect(result.data).toEqual(deactivatedWorkflow);
expect(result.data).toEqual({
id: 'test-workflow-id',
name: 'Test Workflow',
active: false,
nodeCount: 2,
operationsApplied: 1,
});
expect(result.message).toContain('Workflow deactivated');
expect(result.details?.active).toBe(false);
expect((result.data as any).active).toBe(false);
expect(mockApiClient.deactivateWorkflow).toHaveBeenCalledWith('test-workflow-id');
});