mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-01-29 22:12:05 +00:00
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>
This commit is contained in:
committed by
GitHub
parent
130dd44ea5
commit
b92e511463
25
CHANGELOG.md
25
CHANGELOG.md
@@ -7,6 +7,31 @@ 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
|
||||
|
||||
2
dist/mcp/handlers-n8n-manager.d.ts.map
vendored
2
dist/mcp/handlers-n8n-manager.d.ts.map
vendored
@@ -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,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sB,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"}
|
||||
28
dist/mcp/handlers-n8n-manager.js
vendored
28
dist/mcp/handlers-n8n-manager.js
vendored
@@ -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;
|
||||
}
|
||||
|
||||
2
dist/mcp/handlers-n8n-manager.js.map
vendored
2
dist/mcp/handlers-n8n-manager.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/mcp/handlers-workflow-diff.d.ts.map
vendored
2
dist/mcp/handlers-workflow-diff.d.ts.map
vendored
@@ -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"}
|
||||
13
dist/mcp/handlers-workflow-diff.js
vendored
13
dist/mcp/handlers-workflow-diff.js
vendored
@@ -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,
|
||||
|
||||
2
dist/mcp/handlers-workflow-diff.js.map
vendored
2
dist/mcp/handlers-workflow-diff.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -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({
|
||||
|
||||
@@ -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"}
|
||||
@@ -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'
|
||||
|
||||
@@ -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"}
|
||||
@@ -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',
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"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,0B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4B;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"}
|
||||
@@ -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: {}}}]})',
|
||||
|
||||
@@ -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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BAA2B;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"}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "n8n-mcp",
|
||||
"version": "2.28.9",
|
||||
"version": "2.29.0",
|
||||
"description": "Integration between n8n workflow automation and Model Context Protocol (MCP)",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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: {}}}]})',
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user