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 19+ operation types for precise modifications, including patchNodeField for surgical string edits inside Code nodes. Operations are validated and applied atomically by default.

n8n API Key Required
ParameterTypeDescription
id*stringWorkflow ID
operations*arrayArray of diff operations (addNode, removeNode, updateNode, patchNodeField, 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"}
  ]
})

Surgical Code node edit (patchNodeField)

javascript
n8n_update_partial_workflow({
  id: "wf_123",
  intent: "Bump retry limit in Code node from 3 to 5",
  operations: [{
    type: "patchNodeField",
    nodeName: "Process Items",
    field: "jsCode",
    search: "const MAX_RETRIES = 3;",
    replace: "const MAX_RETRIES = 5;"
  }]
})

Edits a specific string inside a long Code node body without re-sending the whole script

IF node with semantic branch

javascript
n8n_update_partial_workflow({
  id: "wf_123",
  intent: "Wire IF node outputs",
  operations: [
    {type: "addConnection", source: "If Premium User", target: "Send VIP Email", branch: "true"},
    {type: "addConnection", source: "If Premium User", target: "Send Standard Email", branch: "false"}
  ]
})
Use Cases
  • Incremental workflow updates
  • Adding/removing individual nodes
  • Rewiring connections
  • Setting up AI Agent workflows
  • Surgical edits to Code node bodies (patchNodeField)
Best Practices
  • Always include intent parameter with specific description
  • Use patchNodeField (not full updateNode) for small string edits inside Code nodes
  • Use rewireConnection instead of remove+add for changing targets
  • Use branch="true"/"false" for IF nodes and case=N for Switch nodes (avoids manual sourceIndex math)
  • 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

n8n_generate_workflow

Generate a workflow from a natural-language description via a multi-step flow with a review checkpoint. Hosted-only — self-hosted instances receive a redirect message rather than a workflow.

n8n API Key Required
ParameterTypeDescription
description*stringPlain-English description of what the workflow should do. More specific = better results: name the trigger, the services, and the logic.
deploy_idstringUUID of a proposal returned by a previous call. Provide this to deploy that specific proposal.
skip_cachebooleanSkip the proposal cache and generate a fresh preview instead.
confirm_deploybooleanDeploy the previously generated preview (used after skip_cache).

Get proposals from a description

javascript
n8n_generate_workflow({
  description: "Send a Slack message every morning at 9am with a daily standup reminder"
})

Returns up to 5 proposals — none deployed yet

Deploy a chosen proposal

javascript
n8n_generate_workflow({
  description: "Send a Slack message every morning at 9am with a daily standup reminder",
  deploy_id: "uuid-from-proposals"
})

Fresh preview when no proposal fits

javascript
n8n_generate_workflow({
  description: "Webhook → transform JSON → POST to REST API",
  skip_cache: true
})

Deploy the fresh preview

javascript
n8n_generate_workflow({
  description: "Webhook → transform JSON → POST to REST API",
  confirm_deploy: true
})
Use Cases
  • Spinning up a starter workflow from a plain-English brief
  • Comparing multiple AI-generated approaches before committing
  • Skipping node-by-node assembly when the requirements are clear
Best Practices
  • Be specific in description: name the trigger (webhook/schedule/manual), the services, and the branching logic
  • Always run n8n_validate_workflow({id}) on the deployed workflow before activation
  • Configure credentials in the n8n UI — generated workflows deploy in inactive state
Common Pitfalls
  • Hosted-only — self-hosted instances get a redirect message instead of a workflow
  • Proposals/preview live in MCP-session state; switching sessions loses pending state
  • For self-hosted, fall back to n8n_deploy_template (curated) or n8n_create_workflow (full control)

n8n_manage_datatable

Unified tool for managing n8n data tables and their rows. Supports table CRUD, row CRUD with filtering and pagination, upsert, and dry-run previews.

n8n API Key Required
ParameterTypeDescription
action*stringOperation to perform
createTablelistTablesgetTableupdateTabledeleteTablegetRowsinsertRowsupdateRowsupsertRowsdeleteRows
tableIdstringRequired for all row actions and table get/update/delete
namestringTable name (createTable / updateTable)
columnsarrayColumn definitions — each {name, type} where type is one of string|number|boolean|date
dataobjectRow payload (insertRows: array of rows; updateRows/upsertRows: object of column→value)
filterobject{filters: [{columnName, condition, value}]} — conditions: eq, neq, like, ilike, gt, gte, lt, lte
limitnumberRow pagination limit (getRows)
returnTypestringFor insertRows: 'count' (default) or 'all' to get inserted rows back
dryRunbooleanPreview changes without writing (recommended before bulk update/delete)

Create a table

javascript
n8n_manage_datatable({
  action: "createTable",
  name: "Contacts",
  columns: [
    {name: "email", type: "string"},
    {name: "score", type: "number"}
  ]
})

Get rows with filter

javascript
n8n_manage_datatable({
  action: "getRows",
  tableId: "dt-123",
  filter: {filters: [{columnName: "status", condition: "eq", value: "active"}]},
  limit: 50
})

Bulk update with dry-run preview

javascript
n8n_manage_datatable({
  action: "updateRows",
  tableId: "dt-123",
  filter: {filters: [{columnName: "score", condition: "lt", value: 5}]},
  data: {status: "inactive"},
  dryRun: true
})

Upsert by email

javascript
n8n_manage_datatable({
  action: "upsertRows",
  tableId: "dt-123",
  filter: {filters: [{columnName: "email", condition: "eq", value: "a@b.com"}]},
  data: {score: 15}
})
Use Cases
  • Storing workflow state across executions
  • Building lookup tables for routing/enrichment
  • Managing user/contact records used by multiple workflows
  • Bulk-updating records based on filter criteria
Best Practices
  • Always run dryRun: true before bulk updateRows/deleteRows to verify the filter
  • Define column types upfront — schema changes are harder than fresh creation
  • Use returnType: 'count' (default) for insertRows to keep responses small
Common Pitfalls
  • deleteRows requires a filter — there is no 'delete all' shortcut
  • Filter conditions are case-sensitive for eq/neq; use ilike for case-insensitive matching
  • Date values should be ISO 8601 strings

n8n_manage_credentials

Unified tool for managing n8n credentials. Full CRUD, schema discovery for any credential type, and reverse-lookup of which workflows reference each credential. Secrets are never returned in responses.

n8n API Key Required
ParameterTypeDescription
action*stringOperation to perform
listgetcreateupdatedeletegetSchema
idstringCredential ID (required for get/update/delete)
namestringCredential display name (create/update)
typestringCredential type slug (e.g., 'slackApi', 'httpHeaderAuth') — required for create and getSchema
dataobjectSecret values for create/update. Stripped from responses.
includeUsagebooleanOn list/get: reverse-scan workflows and attach usedIn[{id, name, active}] and usageCount to each credential

Discover required fields for a type

javascript
n8n_manage_credentials({action: "getSchema", type: "httpHeaderAuth"})

Create a credential

javascript
n8n_manage_credentials({
  action: "create",
  name: "My Slack Token",
  type: "slackApi",
  data: {accessToken: "xoxb-..."}
})

Pre-deletion safety check

javascript
n8n_manage_credentials({action: "get", id: "cred-123", includeUsage: true})

Returns usedIn[] so you can see which workflows break if you delete the credential

Audit credential usage across the instance

javascript
n8n_manage_credentials({action: "list", includeUsage: true})
Use Cases
  • Provisioning credentials for new integrations
  • Rotating secrets and seeing which workflows are affected
  • Auditing shared/over-privileged credentials
  • Cleaning up unused credentials safely
Best Practices
  • Call getSchema first when creating a credential of an unfamiliar type
  • Use includeUsage: true before delete or rotation to see impact
  • Verify creation with a follow-up list — n8n strips data on response by design
Common Pitfalls
  • data field is stripped from get/create/update responses (defense-in-depth) — record the secret yourself before calling
  • includeUsage triggers a full workflow scan client-side — slower on large instances (capped at 5,000 workflows)
  • A 'no usages' result does not guarantee unused — verify before destructive actions