Workflow Management Tools

Create, update, and manage n8n workflows directly from your AI assistant. These tools connect to your n8n instance and require API credentials.

Setup Required

To use these tools, you need to connect your n8n instance:

  1. 1.Go to your n8n-mcp dashboard
  2. 2.Navigate to Instances, then add your instance URL and API key

You can generate an API key in your n8n instance under Settings → API.

Available Tools

n8n_create_workflow

Create a new workflow in your n8n instance. Workflows are always created in an inactive state, allowing you to configure credentials before activation.

n8n API Key Required
ParameterTypeDescription
name*stringWorkflow name
nodes*arrayArray of node objects with id, name, type, typeVersion, position, and parameters
connections*objectNode connections object
settingsobjectWorkflow settings (timezone, error handling, etc.)

Basic webhook to Slack workflow

javascript
n8n_create_workflow({
  name: "Webhook to Slack",
  nodes: [
    {
      id: "webhook_1",
      name: "Webhook",
      type: "n8n-nodes-base.webhook",
      typeVersion: 1,
      position: [250, 300],
      parameters: {
        httpMethod: "POST",
        path: "slack-notify"
      }
    },
    {
      id: "slack_1",
      name: "Slack",
      type: "n8n-nodes-base.slack",
      typeVersion: 1,
      position: [450, 300],
      parameters: {
        resource: "message",
        operation: "post",
        channel: "#general",
        text: "={{$json.message}}"
      }
    }
  ],
  connections: {
    "webhook_1": {
      "main": [[{node: "slack_1", type: "main", index: 0}]]
    }
  }
})
Use Cases
  • Creating new automation workflows
  • Deploying workflows programmatically
  • Setting up integrations via API
Best Practices
  • Validate with validate_workflow first
  • Use unique node IDs
  • Position nodes for readability (typically 200px apart)
  • Test with n8n_test_workflow after creation
  • Use n8n_get_workflow if you need to verify the created workflow structure
Common Pitfalls
  • Workflows are created INACTIVE - must activate separately
  • Node IDs must be unique within workflow
  • Credentials must be configured separately in n8n UI
  • Node type names must include package prefix

n8n_get_workflow

Retrieve a workflow from your n8n instance. Get workflow by ID with different detail levels to control response size.

n8n API Key Required
ParameterTypeDescription
id*stringWorkflow ID
modestringDetail level
fulldetailsstructureminimal

Get complete workflow

javascript
n8n_get_workflow({id: "abc123"})

Get workflow with execution stats

javascript
n8n_get_workflow({id: "abc123", mode: "details"})

Quick metadata check

javascript
n8n_get_workflow({id: "abc123", mode: "minimal"})
Use Cases
  • View and edit workflow (mode=full)
  • Analyze workflow performance (mode=details)
  • Clone or compare workflow structure (mode=structure)
  • List workflows with status (mode=minimal)
Best Practices
  • Use mode="minimal" when you only need metadata
  • Use mode="structure" for topology analysis
  • Use mode="details" for debugging execution issues

n8n_update_full_workflow

Complete workflow replacement. Any nodes or connections not included will be removed.

n8n API Key Required
ParameterTypeDescription
id*stringWorkflow ID to update
namestringNew workflow name
nodesarrayComplete array of nodes
connectionsobjectComplete connections object
settingsobjectWorkflow settings
intentstringDescription of the change

Rename only

javascript
n8n_update_full_workflow({
  id: "abc",
  name: "New Name"
})

Full structure update

javascript
n8n_update_full_workflow({
  id: "xyz",
  intent: "Add error handling nodes",
  nodes: [...],
  connections: {...}
})
Use Cases
  • Major workflow restructuring
  • Complete workflow replacement
  • Renaming workflows
Best Practices
  • Always include intent parameter for better responses
  • Get workflow first, modify, then update
  • Validate with validate_workflow before updating
  • Use n8n_update_partial_workflow for small changes
  • Use n8n_get_workflow with mode='structure' if you need to verify the update

n8n_update_partial_workflow

Update workflow incrementally with diff operations. Supports 17 operation types for precise modifications. Operations are validated and applied atomically by default.

n8n API Key Required
ParameterTypeDescription
id*stringWorkflow ID
operations*arrayArray of diff operations (addNode, removeNode, updateNode, moveNode, enableNode, disableNode, addConnection, removeConnection, rewireConnection, cleanStaleConnections, replaceConnections, updateSettings, updateName, addTag, removeTag, activateWorkflow, deactivateWorkflow)
validateOnlybooleanOnly validate without applying
continueOnErrorbooleanBest-effort mode
intentstringDescription of the change

Add a node and connect it

javascript
n8n_update_partial_workflow({
  id: "wf_123",
  intent: "Add HTTP request for API call",
  operations: [
    {type: "addNode", node: {
      name: "HTTP Request",
      type: "n8n-nodes-base.httpRequest",
      position: [400, 300],
      parameters: {url: "https://api.example.com"}
    }},
    {type: "addConnection", source: "Webhook", target: "HTTP Request"}
  ]
})

Update node parameter

javascript
n8n_update_partial_workflow({
  id: "abc",
  intent: "Fix API URL",
  operations: [{
    type: "updateNode",
    nodeName: "HTTP Request",
    updates: {"parameters.url": "https://new-api.example.com"}
  }]
})

AI Agent connections

javascript
n8n_update_partial_workflow({
  id: "ai_wf",
  intent: "Set up AI Agent with tools",
  operations: [
    {type: "addConnection", source: "OpenAI", target: "AI Agent", sourceOutput: "ai_languageModel"},
    {type: "addConnection", source: "HTTP Tool", target: "AI Agent", sourceOutput: "ai_tool"},
    {type: "addConnection", source: "Memory", target: "AI Agent", sourceOutput: "ai_memory"}
  ]
})
Use Cases
  • Incremental workflow updates
  • Adding/removing individual nodes
  • Rewiring connections
  • Setting up AI Agent workflows
Best Practices
  • Always include intent parameter with specific description
  • Use rewireConnection instead of remove+add for changing targets
  • Use branch="true"/"false" for IF nodes instead of sourceIndex
  • Use cleanStaleConnections after renaming/removing nodes
  • Validate with validateOnly first for complex changes
  • Use n8n_get_workflow with mode='structure' if you need to verify applied operations

n8n_delete_workflow

Permanently delete a workflow including all associated data and execution history. This action cannot be undone.

n8n API Key Required
ParameterTypeDescription
id*stringWorkflow ID to delete

Delete a workflow

javascript
n8n_delete_workflow({id: "abc123"})
Use Cases
  • Removing obsolete workflows
  • Cleanup after testing
  • Managing workflow lifecycle
Best Practices
  • Always confirm before deleting
  • Consider exporting workflow first for backup
  • Deactivate workflow before deletion
Common Pitfalls
  • Cannot be undone - permanent deletion
  • Deletes all execution history
  • Active workflows can be deleted
  • No built-in confirmation

n8n_list_workflows

List workflows from n8n with filtering options. Returns only minimal metadata (id, name, active, dates, tags).

n8n API Key Required
ParameterTypeDescription
limitnumberResults per page (max: 100)
cursorstringPagination cursor
activebooleanFilter by active/inactive
tagsarrayFilter by exact tag matches
projectIdstringFilter by project (enterprise)

First 20 workflows

javascript
n8n_list_workflows({limit: 20})

Active production workflows

javascript
n8n_list_workflows({active: true, tags: ["production"]})
Use Cases
  • Listing all workflows in an instance
  • Finding active workflows
  • Filtering by tags for organization
  • Pagination through large workflow sets
Best Practices
  • Use tags to organize workflows
  • Use cursor for pagination through large sets
  • Filter by active=true to find running workflows

n8n_validate_workflow

Validate a workflow from your n8n instance by ID. Fetches a workflow from n8n and runs comprehensive validation.

n8n API Key Required
ParameterTypeDescription
id*stringWorkflow ID to validate
optionsobjectValidation options (same as validate_workflow)

Default validation

javascript
n8n_validate_workflow({id: "wf_abc123"})

Strict validation

javascript
n8n_validate_workflow({
  id: "wf_abc123",
  options: {profile: "strict"}
})
Use Cases
  • Validating workflows before running them in production
  • Checking imported workflows for compatibility
  • Debugging workflow execution failures
  • Pre-deployment validation in CI/CD pipelines
Best Practices
  • Validate before activating workflows
  • Use strict profile for production workflows
  • Check warnings even if validation passes

n8n_autofix_workflow

Automatically fix common workflow validation errors including expression formats, typeVersions, error outputs, webhook paths, and node type corrections.

n8n API Key Required
ParameterTypeDescription
id*stringWorkflow ID to fix
applyFixesbooleanApply fixes (false = preview)
fixTypesarrayTypes of fixes to apply
expression-formattypeversion-correctionerror-output-confignode-type-correctionwebhook-missing-pathtypeversion-upgradeversion-migration
confidenceThresholdstringMinimum confidence
highmediumlow
maxFixesnumberMaximum fixes to apply

Preview all fixes

javascript
n8n_autofix_workflow({id: "wf_abc123"})

Apply all medium+ confidence fixes

javascript
n8n_autofix_workflow({id: "wf_abc123", applyFixes: true})

Only high-confidence fixes

javascript
n8n_autofix_workflow({
  id: "wf_abc123",
  applyFixes: true,
  confidenceThreshold: "high"
})
Use Cases
  • Fixing expression format issues
  • Upgrading node versions
  • Fixing configuration errors
  • Migrating workflows to newer n8n versions
Best Practices
  • Always preview fixes first (applyFixes: false)
  • Start with high confidence threshold for production
  • Review the fix summary to understand what changed
  • Test workflows after auto-fixing

n8n_test_workflow

Test and trigger workflow execution through HTTP-based methods. Supports webhook, form, and chat triggers. Auto-detects trigger type from workflow.

n8n API Key Required
ParameterTypeDescription
workflowId*stringWorkflow ID to execute
triggerTypestringTrigger type
webhookformchatauto
httpMethodstringFor webhook: HTTP method
webhookPathstringOverride webhook path
messagestringFor chat: message to send
sessionIdstringFor chat: session ID
dataobjectInput data/payload
headersobjectCustom HTTP headers
timeoutnumberTimeout in ms
waitForResponsebooleanWait for completion

Auto-detect and trigger

javascript
n8n_test_workflow({workflowId: "123"})

Webhook with data

javascript
n8n_test_workflow({
  workflowId: "123",
  triggerType: "webhook",
  data: {name: "John", email: "john@example.com"}
})

Chat trigger

javascript
n8n_test_workflow({
  workflowId: "123",
  triggerType: "chat",
  message: "Hello AI assistant"
})
Use Cases
  • Testing workflows during development
  • Triggering workflows programmatically
  • Testing chat/AI workflows
  • Validating webhook integrations
Best Practices
  • Use auto-detect for most cases
  • Include test data matching expected input format
  • Test with different input scenarios
Common Pitfalls
  • Workflow must be ACTIVE to be triggered
  • Only works with webhook/form/chat triggers
  • Schedule/manual triggers cannot be triggered via API

n8n_executions

Unified tool for execution management: get details, list executions, or delete records.

n8n API Key Required
ParameterTypeDescription
action*stringAction to perform
getlistdelete
idstringExecution ID (for get/delete)
modestringFor get: response detail
previewsummaryfilteredfull
nodeNamesarrayFor get+filtered: filter by nodes
itemsLimitnumberFor get+filtered: items per node
workflowIdstringFor list: filter by workflow
statusstringFor list: filter by status
successerrorwaiting
limitnumberFor list: results per page
cursorstringFor list: pagination cursor

List recent executions

javascript
n8n_executions({
  action: "list",
  workflowId: "abc123",
  limit: 10
})

Get execution summary

javascript
n8n_executions({action: "get", id: "exec_456"})

Get specific nodes from execution

javascript
n8n_executions({
  action: "get",
  id: "exec_456",
  mode: "filtered",
  nodeNames: ["HTTP Request", "Slack"]
})
Use Cases
  • Debugging workflow failures
  • Analyzing execution performance
  • Cleaning up execution history
  • Monitoring workflow runs
Best Practices
  • Use status="error" to find failed executions
  • Use mode="filtered" to focus on specific nodes
  • Delete old executions to save storage

n8n_workflow_versions

Comprehensive workflow version management: list versions, rollback, cleanup.

n8n API Key Required
ParameterTypeDescription
mode*stringOperation mode
listgetrollbackdeleteprunetruncate
workflowIdstringWorkflow ID
versionIdnumberSpecific version ID
limitnumberMax versions to return
validateBeforebooleanValidate before rollback
deleteAllbooleanDelete all versions
maxVersionsnumberVersions to keep (prune)
confirmTruncatebooleanRequired for truncate

List version history

javascript
n8n_workflow_versions({mode: "list", workflowId: "abc123", limit: 5})

Rollback to latest saved version

javascript
n8n_workflow_versions({mode: "rollback", workflowId: "abc123"})

Prune to keep only 5 most recent

javascript
n8n_workflow_versions({mode: "prune", workflowId: "abc123", maxVersions: 5})
Use Cases
  • Rolling back broken changes
  • Viewing workflow history
  • Managing version storage
  • Comparing workflow versions
Best Practices
  • Always list versions before rollback
  • Enable validateBefore for rollback
  • Use prune regularly to manage storage
  • Never use truncate in production without explicit need

n8n_deploy_template

Deploy a workflow template from n8n.io directly to your n8n instance with auto-fixing of common issues.

n8n API Key Required
ParameterTypeDescription
templateId*numberTemplate ID from n8n.io
namestringCustom workflow name
autoUpgradeVersionsbooleanUpgrade node typeVersions
autoFixbooleanAuto-fix expression issues
stripCredentialsbooleanRemove credential references

Deploy with default settings

javascript
n8n_deploy_template({templateId: 2776})

Deploy with custom name

javascript
n8n_deploy_template({
  templateId: 2776,
  name: "My Google Drive to Airtable Sync"
})
Use Cases
  • Quickly deploying popular templates
  • Setting up common integrations
  • Using templates as starting points
Best Practices
  • Use search_templates to find template IDs
  • Review required credentials in the response
  • Configure credentials in n8n UI before activating
  • Test workflow before connecting to production