> For the complete documentation index, see [llms.txt](https://docs.n8n.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.n8n.io/connect/n8n-api/workflow.md).

# Workflow

Operations about workflows

## Retrieve all workflows

> Retrieve all workflows from your instance.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Workflow","description":"Operations about workflows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"limit":{"name":"limit","in":"query","description":"The maximum number of items to return.","required":false,"schema":{"type":"number","default":100,"maximum":250}},"cursor":{"name":"cursor","in":"query","description":"Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first \"page\" of the collection. See pagination for more detail.","required":false,"style":"form","schema":{"type":"string"}}},"schemas":{"workflowList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/workflow"}},"nextCursor":{"type":"string","description":"Paginate through workflows by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first \"page\" of the collection.","nullable":true}}},"workflow":{"type":"object","additionalProperties":false,"required":["name","nodes","connections","settings"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"description":{"type":"string","description":"Description of the workflow"},"active":{"type":"boolean","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"isArchived":{"type":"boolean","readOnly":true},"versionId":{"type":"string","readOnly":true,"description":"Current version identifier used for optimistic locking"},"triggerCount":{"type":"integer","readOnly":true,"description":"Number of active trigger nodes in the workflow"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object"},"nodeGroups":{"type":"array","description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"settings":{"$ref":"#/components/schemas/workflowSettings"},"staticData":{"anyOf":[{"type":"string","format":"jsonString","nullable":true},{"type":"object","nullable":true}]},"pinData":{"type":"object","nullable":true,"description":"Pinned sample data for nodes, keyed by node name"},"meta":{"type":"object","nullable":true,"readOnly":true,"description":"Workflow metadata such as template information","properties":{"onboardingId":{"type":"string"},"templateId":{"type":"string"},"instanceId":{"type":"string"},"templateCredsSetupCompleted":{"type":"boolean"}}},"tags":{"type":"array","items":{"$ref":"#/components/schemas/tag"},"readOnly":true},"shared":{"type":"array","items":{"$ref":"#/components/schemas/sharedWorkflow"}},"activeVersion":{"$ref":"#/components/schemas/activeVersion"}}},"node":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"name":{"type":"string"},"webhookId":{"type":"string"},"disabled":{"type":"boolean"},"notesInFlow":{"type":"boolean"},"notes":{"type":"string"},"type":{"type":"string"},"typeVersion":{"type":"number"},"executeOnce":{"type":"boolean"},"alwaysOutputData":{"type":"boolean"},"retryOnFail":{"type":"boolean"},"maxTries":{"type":"number"},"waitBetweenTries":{"type":"number"},"continueOnFail":{"type":"boolean","description":"use onError instead","deprecated":true},"onError":{"type":"string"},"position":{"type":"array","items":{"type":"number"}},"parameters":{"type":"object","additionalProperties":true},"credentials":{"type":"object"},"customTelemetryTags":{"type":"object","additionalProperties":false,"properties":{"tag":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"workflowNodeGroup":{"type":"object","additionalProperties":false,"required":["id","name","nodeIds"],"properties":{"id":{"type":"string","description":"Unique identifier for the node group"},"name":{"type":"string","description":"Display name of the node group"},"nodeIds":{"type":"array","description":"IDs of the nodes that belong to this group","items":{"type":"string"}}}},"workflowSettings":{"type":"object","additionalProperties":false,"properties":{"saveExecutionProgress":{"type":"boolean"},"saveManualExecutions":{"type":"boolean"},"saveDataErrorExecution":{"type":"string","enum":["all","none"]},"saveDataSuccessExecution":{"type":"string","enum":["all","none"]},"executionTimeout":{"type":"number","maxLength":3600},"errorWorkflow":{"type":"string","description":"The ID of the workflow that contains the error trigger node."},"timezone":{"type":"string"},"executionOrder":{"type":"string"},"callerPolicy":{"type":"string","enum":["any","none","workflowsFromAList","workflowsFromSameOwner"],"description":"Controls which workflows are allowed to call this workflow using the Execute Workflow node.\nDefaults to workflowsFromSameOwner.\n\nAvailable options:\n- `any`: Any workflow can call this workflow (no restrictions)\n- `none`: No other workflows can call this workflow (completely blocked)\n- `workflowsFromSameOwner` (default): Only workflows owned by the same project can call this workflow\n  * For personal projects: Only workflows created by the same user\n  * For team projects: Only workflows within the same team project\n- `workflowsFromAList`: Only specific workflows listed in the `callerIds` field can call this workflow\n  * Requires the `callerIds` field to specify which workflow IDs are allowed\n  * See `callerIds` field documentation for usage\n"},"callerIds":{"type":"string","description":"Comma-separated list of workflow IDs allowed to call this workflow (only used with workflowsFromAList policy)"},"timeSavedPerExecution":{"type":"number","description":"Estimated time saved per execution in minutes"},"redactionPolicy":{"type":"string","enum":["none","non-manual","manual-only","all"],"description":"Controls whether execution data is redacted for this workflow.\n\nAvailable options:\n- `none` (default): No redaction — all execution data is stored.\n- `non-manual`: Redact production (non-manually triggered) executions only.\n- `manual-only`: Redact manually triggered executions only.\n- `all`: Redact all executions (manual and production).\n\nWhen the instance has a redaction floor configured, the policy must be equal to\nor stricter than the floor. A policy weaker than the floor is rejected with 422\non create, and on update when it changes the stored policy; an unchanged\npre-existing below-floor policy is preserved (the floor is not applied\nretroactively). Omitting this field when creating a workflow seeds it to the\ninstance floor instead.\n"},"availableInMCP":{"type":"boolean","description":"Controls whether this workflow is accessible via the Model Context Protocol (MCP).\nDefaults to false.\n\nWhen enabled, this workflow can be called by MCP clients (AI assistants and other tools\nthat support MCP). This allows external AI tools to discover and execute this workflow\nas part of their capabilities.\n\nRequirements for enabling MCP access:\n- The workflow must be active (not deactivated)\n- The workflow must contain at least one active Webhook node\n- Only webhook-triggered workflows can be exposed via MCP\n\nSecurity note: When a workflow is available in MCP, it can be discovered and executed\nby any MCP client that has the appropriate API credentials for your n8n instance.\n"},"customTelemetryTags":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"sharedWorkflow":{"type":"object","additionalProperties":false,"properties":{"role":{"type":"string"},"workflowId":{"type":"string"},"projectId":{"type":"string"},"project":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"type":{"type":"string","readOnly":true}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"activeVersion":{"type":"object","readOnly":true,"nullable":true,"additionalProperties":false,"properties":{"versionId":{"type":"string","readOnly":true,"description":"Unique identifier for this workflow version"},"workflowId":{"type":"string","readOnly":true,"description":"The workflow this version belongs to"},"nodes":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object","readOnly":true},"nodeGroups":{"type":"array","readOnly":true,"description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"authors":{"type":"string","readOnly":true,"description":"Comma-separated list of author IDs who contributed to this version"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}}},"responses":{"unauthorized":{"description":"Unauthorized"}}},"paths":{"/workflows":{"get":{"tags":["Workflow"],"summary":"Retrieve all workflows","description":"Retrieve all workflows from your instance.","parameters":[{"name":"active","in":"query","schema":{"type":"boolean"}},{"name":"tags","in":"query","required":false,"explode":false,"allowReserved":true,"schema":{"type":"string"}},{"name":"name","in":"query","required":false,"explode":false,"allowReserved":true,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"explode":false,"allowReserved":true,"schema":{"type":"string"}},{"name":"excludePinnedData","in":"query","required":false,"description":"Set this to avoid retrieving pinned data","schema":{"type":"boolean"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"}],"responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/workflowList"}}}},"401":{"$ref":"#/components/responses/unauthorized"}}}}}}
```

## Create a workflow

> Create a workflow in your instance.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Workflow","description":"Operations about workflows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"workflowCreate":{"type":"object","additionalProperties":false,"required":["name","nodes","connections","settings"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"active":{"type":"boolean","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"isArchived":{"type":"boolean","readOnly":true},"versionId":{"type":"string","readOnly":true,"description":"Current version identifier used for optimistic locking"},"triggerCount":{"type":"integer","readOnly":true,"description":"Number of active trigger nodes in the workflow"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object"},"nodeGroups":{"type":"array","description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"settings":{"$ref":"#/components/schemas/workflowSettings"},"staticData":{"anyOf":[{"type":"string","format":"jsonString","nullable":true},{"type":"object","nullable":true}]},"pinData":{"type":"object","nullable":true,"description":"Pinned sample data for nodes, keyed by node name"},"projectId":{"type":"string","description":"Target project to create the workflow in. Defaults to the user's personal project."},"meta":{"type":"object","nullable":true,"readOnly":true,"description":"Workflow metadata such as template information","properties":{"onboardingId":{"type":"string"},"templateId":{"type":"string"},"instanceId":{"type":"string"},"templateCredsSetupCompleted":{"type":"boolean"}}},"tags":{"type":"array","items":{"$ref":"#/components/schemas/tag"},"readOnly":true},"shared":{"type":"array","items":{"$ref":"#/components/schemas/sharedWorkflow"}},"activeVersion":{"$ref":"#/components/schemas/activeVersion"}}},"node":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"name":{"type":"string"},"webhookId":{"type":"string"},"disabled":{"type":"boolean"},"notesInFlow":{"type":"boolean"},"notes":{"type":"string"},"type":{"type":"string"},"typeVersion":{"type":"number"},"executeOnce":{"type":"boolean"},"alwaysOutputData":{"type":"boolean"},"retryOnFail":{"type":"boolean"},"maxTries":{"type":"number"},"waitBetweenTries":{"type":"number"},"continueOnFail":{"type":"boolean","description":"use onError instead","deprecated":true},"onError":{"type":"string"},"position":{"type":"array","items":{"type":"number"}},"parameters":{"type":"object","additionalProperties":true},"credentials":{"type":"object"},"customTelemetryTags":{"type":"object","additionalProperties":false,"properties":{"tag":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"workflowNodeGroup":{"type":"object","additionalProperties":false,"required":["id","name","nodeIds"],"properties":{"id":{"type":"string","description":"Unique identifier for the node group"},"name":{"type":"string","description":"Display name of the node group"},"nodeIds":{"type":"array","description":"IDs of the nodes that belong to this group","items":{"type":"string"}}}},"workflowSettings":{"type":"object","additionalProperties":false,"properties":{"saveExecutionProgress":{"type":"boolean"},"saveManualExecutions":{"type":"boolean"},"saveDataErrorExecution":{"type":"string","enum":["all","none"]},"saveDataSuccessExecution":{"type":"string","enum":["all","none"]},"executionTimeout":{"type":"number","maxLength":3600},"errorWorkflow":{"type":"string","description":"The ID of the workflow that contains the error trigger node."},"timezone":{"type":"string"},"executionOrder":{"type":"string"},"callerPolicy":{"type":"string","enum":["any","none","workflowsFromAList","workflowsFromSameOwner"],"description":"Controls which workflows are allowed to call this workflow using the Execute Workflow node.\nDefaults to workflowsFromSameOwner.\n\nAvailable options:\n- `any`: Any workflow can call this workflow (no restrictions)\n- `none`: No other workflows can call this workflow (completely blocked)\n- `workflowsFromSameOwner` (default): Only workflows owned by the same project can call this workflow\n  * For personal projects: Only workflows created by the same user\n  * For team projects: Only workflows within the same team project\n- `workflowsFromAList`: Only specific workflows listed in the `callerIds` field can call this workflow\n  * Requires the `callerIds` field to specify which workflow IDs are allowed\n  * See `callerIds` field documentation for usage\n"},"callerIds":{"type":"string","description":"Comma-separated list of workflow IDs allowed to call this workflow (only used with workflowsFromAList policy)"},"timeSavedPerExecution":{"type":"number","description":"Estimated time saved per execution in minutes"},"redactionPolicy":{"type":"string","enum":["none","non-manual","manual-only","all"],"description":"Controls whether execution data is redacted for this workflow.\n\nAvailable options:\n- `none` (default): No redaction — all execution data is stored.\n- `non-manual`: Redact production (non-manually triggered) executions only.\n- `manual-only`: Redact manually triggered executions only.\n- `all`: Redact all executions (manual and production).\n\nWhen the instance has a redaction floor configured, the policy must be equal to\nor stricter than the floor. A policy weaker than the floor is rejected with 422\non create, and on update when it changes the stored policy; an unchanged\npre-existing below-floor policy is preserved (the floor is not applied\nretroactively). Omitting this field when creating a workflow seeds it to the\ninstance floor instead.\n"},"availableInMCP":{"type":"boolean","description":"Controls whether this workflow is accessible via the Model Context Protocol (MCP).\nDefaults to false.\n\nWhen enabled, this workflow can be called by MCP clients (AI assistants and other tools\nthat support MCP). This allows external AI tools to discover and execute this workflow\nas part of their capabilities.\n\nRequirements for enabling MCP access:\n- The workflow must be active (not deactivated)\n- The workflow must contain at least one active Webhook node\n- Only webhook-triggered workflows can be exposed via MCP\n\nSecurity note: When a workflow is available in MCP, it can be discovered and executed\nby any MCP client that has the appropriate API credentials for your n8n instance.\n"},"customTelemetryTags":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"sharedWorkflow":{"type":"object","additionalProperties":false,"properties":{"role":{"type":"string"},"workflowId":{"type":"string"},"projectId":{"type":"string"},"project":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"type":{"type":"string","readOnly":true}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"activeVersion":{"type":"object","readOnly":true,"nullable":true,"additionalProperties":false,"properties":{"versionId":{"type":"string","readOnly":true,"description":"Unique identifier for this workflow version"},"workflowId":{"type":"string","readOnly":true,"description":"The workflow this version belongs to"},"nodes":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object","readOnly":true},"nodeGroups":{"type":"array","readOnly":true,"description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"authors":{"type":"string","readOnly":true,"description":"Comma-separated list of author IDs who contributed to this version"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"workflow":{"type":"object","additionalProperties":false,"required":["name","nodes","connections","settings"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"description":{"type":"string","description":"Description of the workflow"},"active":{"type":"boolean","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"isArchived":{"type":"boolean","readOnly":true},"versionId":{"type":"string","readOnly":true,"description":"Current version identifier used for optimistic locking"},"triggerCount":{"type":"integer","readOnly":true,"description":"Number of active trigger nodes in the workflow"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object"},"nodeGroups":{"type":"array","description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"settings":{"$ref":"#/components/schemas/workflowSettings"},"staticData":{"anyOf":[{"type":"string","format":"jsonString","nullable":true},{"type":"object","nullable":true}]},"pinData":{"type":"object","nullable":true,"description":"Pinned sample data for nodes, keyed by node name"},"meta":{"type":"object","nullable":true,"readOnly":true,"description":"Workflow metadata such as template information","properties":{"onboardingId":{"type":"string"},"templateId":{"type":"string"},"instanceId":{"type":"string"},"templateCredsSetupCompleted":{"type":"boolean"}}},"tags":{"type":"array","items":{"$ref":"#/components/schemas/tag"},"readOnly":true},"shared":{"type":"array","items":{"$ref":"#/components/schemas/sharedWorkflow"}},"activeVersion":{"$ref":"#/components/schemas/activeVersion"}}}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"forbidden":{"description":"Forbidden"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/workflows":{"post":{"tags":["Workflow"],"summary":"Create a workflow","description":"Create a workflow in your instance.","requestBody":{"description":"Created workflow object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/workflowCreate"}}},"required":true},"responses":{"200":{"description":"A workflow object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/workflow"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"403":{"$ref":"#/components/responses/forbidden"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Retrieve a workflow

> Retrieve a workflow.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Workflow","description":"Operations about workflows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"workflowId":{"name":"id","in":"path","description":"The ID of the workflow.","required":true,"schema":{"type":"string"}}},"schemas":{"workflow":{"type":"object","additionalProperties":false,"required":["name","nodes","connections","settings"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"description":{"type":"string","description":"Description of the workflow"},"active":{"type":"boolean","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"isArchived":{"type":"boolean","readOnly":true},"versionId":{"type":"string","readOnly":true,"description":"Current version identifier used for optimistic locking"},"triggerCount":{"type":"integer","readOnly":true,"description":"Number of active trigger nodes in the workflow"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object"},"nodeGroups":{"type":"array","description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"settings":{"$ref":"#/components/schemas/workflowSettings"},"staticData":{"anyOf":[{"type":"string","format":"jsonString","nullable":true},{"type":"object","nullable":true}]},"pinData":{"type":"object","nullable":true,"description":"Pinned sample data for nodes, keyed by node name"},"meta":{"type":"object","nullable":true,"readOnly":true,"description":"Workflow metadata such as template information","properties":{"onboardingId":{"type":"string"},"templateId":{"type":"string"},"instanceId":{"type":"string"},"templateCredsSetupCompleted":{"type":"boolean"}}},"tags":{"type":"array","items":{"$ref":"#/components/schemas/tag"},"readOnly":true},"shared":{"type":"array","items":{"$ref":"#/components/schemas/sharedWorkflow"}},"activeVersion":{"$ref":"#/components/schemas/activeVersion"}}},"node":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"name":{"type":"string"},"webhookId":{"type":"string"},"disabled":{"type":"boolean"},"notesInFlow":{"type":"boolean"},"notes":{"type":"string"},"type":{"type":"string"},"typeVersion":{"type":"number"},"executeOnce":{"type":"boolean"},"alwaysOutputData":{"type":"boolean"},"retryOnFail":{"type":"boolean"},"maxTries":{"type":"number"},"waitBetweenTries":{"type":"number"},"continueOnFail":{"type":"boolean","description":"use onError instead","deprecated":true},"onError":{"type":"string"},"position":{"type":"array","items":{"type":"number"}},"parameters":{"type":"object","additionalProperties":true},"credentials":{"type":"object"},"customTelemetryTags":{"type":"object","additionalProperties":false,"properties":{"tag":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"workflowNodeGroup":{"type":"object","additionalProperties":false,"required":["id","name","nodeIds"],"properties":{"id":{"type":"string","description":"Unique identifier for the node group"},"name":{"type":"string","description":"Display name of the node group"},"nodeIds":{"type":"array","description":"IDs of the nodes that belong to this group","items":{"type":"string"}}}},"workflowSettings":{"type":"object","additionalProperties":false,"properties":{"saveExecutionProgress":{"type":"boolean"},"saveManualExecutions":{"type":"boolean"},"saveDataErrorExecution":{"type":"string","enum":["all","none"]},"saveDataSuccessExecution":{"type":"string","enum":["all","none"]},"executionTimeout":{"type":"number","maxLength":3600},"errorWorkflow":{"type":"string","description":"The ID of the workflow that contains the error trigger node."},"timezone":{"type":"string"},"executionOrder":{"type":"string"},"callerPolicy":{"type":"string","enum":["any","none","workflowsFromAList","workflowsFromSameOwner"],"description":"Controls which workflows are allowed to call this workflow using the Execute Workflow node.\nDefaults to workflowsFromSameOwner.\n\nAvailable options:\n- `any`: Any workflow can call this workflow (no restrictions)\n- `none`: No other workflows can call this workflow (completely blocked)\n- `workflowsFromSameOwner` (default): Only workflows owned by the same project can call this workflow\n  * For personal projects: Only workflows created by the same user\n  * For team projects: Only workflows within the same team project\n- `workflowsFromAList`: Only specific workflows listed in the `callerIds` field can call this workflow\n  * Requires the `callerIds` field to specify which workflow IDs are allowed\n  * See `callerIds` field documentation for usage\n"},"callerIds":{"type":"string","description":"Comma-separated list of workflow IDs allowed to call this workflow (only used with workflowsFromAList policy)"},"timeSavedPerExecution":{"type":"number","description":"Estimated time saved per execution in minutes"},"redactionPolicy":{"type":"string","enum":["none","non-manual","manual-only","all"],"description":"Controls whether execution data is redacted for this workflow.\n\nAvailable options:\n- `none` (default): No redaction — all execution data is stored.\n- `non-manual`: Redact production (non-manually triggered) executions only.\n- `manual-only`: Redact manually triggered executions only.\n- `all`: Redact all executions (manual and production).\n\nWhen the instance has a redaction floor configured, the policy must be equal to\nor stricter than the floor. A policy weaker than the floor is rejected with 422\non create, and on update when it changes the stored policy; an unchanged\npre-existing below-floor policy is preserved (the floor is not applied\nretroactively). Omitting this field when creating a workflow seeds it to the\ninstance floor instead.\n"},"availableInMCP":{"type":"boolean","description":"Controls whether this workflow is accessible via the Model Context Protocol (MCP).\nDefaults to false.\n\nWhen enabled, this workflow can be called by MCP clients (AI assistants and other tools\nthat support MCP). This allows external AI tools to discover and execute this workflow\nas part of their capabilities.\n\nRequirements for enabling MCP access:\n- The workflow must be active (not deactivated)\n- The workflow must contain at least one active Webhook node\n- Only webhook-triggered workflows can be exposed via MCP\n\nSecurity note: When a workflow is available in MCP, it can be discovered and executed\nby any MCP client that has the appropriate API credentials for your n8n instance.\n"},"customTelemetryTags":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"sharedWorkflow":{"type":"object","additionalProperties":false,"properties":{"role":{"type":"string"},"workflowId":{"type":"string"},"projectId":{"type":"string"},"project":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"type":{"type":"string","readOnly":true}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"activeVersion":{"type":"object","readOnly":true,"nullable":true,"additionalProperties":false,"properties":{"versionId":{"type":"string","readOnly":true,"description":"Unique identifier for this workflow version"},"workflowId":{"type":"string","readOnly":true,"description":"The workflow this version belongs to"},"nodes":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object","readOnly":true},"nodeGroups":{"type":"array","readOnly":true,"description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"authors":{"type":"string","readOnly":true,"description":"Comma-separated list of author IDs who contributed to this version"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}}},"responses":{"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/workflows/{id}":{"get":{"tags":["Workflow"],"summary":"Retrieve a workflow","description":"Retrieve a workflow.","parameters":[{"name":"excludePinnedData","in":"query","required":false,"description":"Set this to avoid retrieving pinned data","schema":{"type":"boolean"}},{"$ref":"#/components/parameters/workflowId"}],"responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/workflow"}}}},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Update a workflow

> Update a workflow. If the workflow is published, the updated version will be automatically re-published.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Workflow","description":"Operations about workflows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"workflowId":{"name":"id","in":"path","description":"The ID of the workflow.","required":true,"schema":{"type":"string"}}},"schemas":{"workflow":{"type":"object","additionalProperties":false,"required":["name","nodes","connections","settings"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"description":{"type":"string","description":"Description of the workflow"},"active":{"type":"boolean","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"isArchived":{"type":"boolean","readOnly":true},"versionId":{"type":"string","readOnly":true,"description":"Current version identifier used for optimistic locking"},"triggerCount":{"type":"integer","readOnly":true,"description":"Number of active trigger nodes in the workflow"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object"},"nodeGroups":{"type":"array","description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"settings":{"$ref":"#/components/schemas/workflowSettings"},"staticData":{"anyOf":[{"type":"string","format":"jsonString","nullable":true},{"type":"object","nullable":true}]},"pinData":{"type":"object","nullable":true,"description":"Pinned sample data for nodes, keyed by node name"},"meta":{"type":"object","nullable":true,"readOnly":true,"description":"Workflow metadata such as template information","properties":{"onboardingId":{"type":"string"},"templateId":{"type":"string"},"instanceId":{"type":"string"},"templateCredsSetupCompleted":{"type":"boolean"}}},"tags":{"type":"array","items":{"$ref":"#/components/schemas/tag"},"readOnly":true},"shared":{"type":"array","items":{"$ref":"#/components/schemas/sharedWorkflow"}},"activeVersion":{"$ref":"#/components/schemas/activeVersion"}}},"node":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"name":{"type":"string"},"webhookId":{"type":"string"},"disabled":{"type":"boolean"},"notesInFlow":{"type":"boolean"},"notes":{"type":"string"},"type":{"type":"string"},"typeVersion":{"type":"number"},"executeOnce":{"type":"boolean"},"alwaysOutputData":{"type":"boolean"},"retryOnFail":{"type":"boolean"},"maxTries":{"type":"number"},"waitBetweenTries":{"type":"number"},"continueOnFail":{"type":"boolean","description":"use onError instead","deprecated":true},"onError":{"type":"string"},"position":{"type":"array","items":{"type":"number"}},"parameters":{"type":"object","additionalProperties":true},"credentials":{"type":"object"},"customTelemetryTags":{"type":"object","additionalProperties":false,"properties":{"tag":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"workflowNodeGroup":{"type":"object","additionalProperties":false,"required":["id","name","nodeIds"],"properties":{"id":{"type":"string","description":"Unique identifier for the node group"},"name":{"type":"string","description":"Display name of the node group"},"nodeIds":{"type":"array","description":"IDs of the nodes that belong to this group","items":{"type":"string"}}}},"workflowSettings":{"type":"object","additionalProperties":false,"properties":{"saveExecutionProgress":{"type":"boolean"},"saveManualExecutions":{"type":"boolean"},"saveDataErrorExecution":{"type":"string","enum":["all","none"]},"saveDataSuccessExecution":{"type":"string","enum":["all","none"]},"executionTimeout":{"type":"number","maxLength":3600},"errorWorkflow":{"type":"string","description":"The ID of the workflow that contains the error trigger node."},"timezone":{"type":"string"},"executionOrder":{"type":"string"},"callerPolicy":{"type":"string","enum":["any","none","workflowsFromAList","workflowsFromSameOwner"],"description":"Controls which workflows are allowed to call this workflow using the Execute Workflow node.\nDefaults to workflowsFromSameOwner.\n\nAvailable options:\n- `any`: Any workflow can call this workflow (no restrictions)\n- `none`: No other workflows can call this workflow (completely blocked)\n- `workflowsFromSameOwner` (default): Only workflows owned by the same project can call this workflow\n  * For personal projects: Only workflows created by the same user\n  * For team projects: Only workflows within the same team project\n- `workflowsFromAList`: Only specific workflows listed in the `callerIds` field can call this workflow\n  * Requires the `callerIds` field to specify which workflow IDs are allowed\n  * See `callerIds` field documentation for usage\n"},"callerIds":{"type":"string","description":"Comma-separated list of workflow IDs allowed to call this workflow (only used with workflowsFromAList policy)"},"timeSavedPerExecution":{"type":"number","description":"Estimated time saved per execution in minutes"},"redactionPolicy":{"type":"string","enum":["none","non-manual","manual-only","all"],"description":"Controls whether execution data is redacted for this workflow.\n\nAvailable options:\n- `none` (default): No redaction — all execution data is stored.\n- `non-manual`: Redact production (non-manually triggered) executions only.\n- `manual-only`: Redact manually triggered executions only.\n- `all`: Redact all executions (manual and production).\n\nWhen the instance has a redaction floor configured, the policy must be equal to\nor stricter than the floor. A policy weaker than the floor is rejected with 422\non create, and on update when it changes the stored policy; an unchanged\npre-existing below-floor policy is preserved (the floor is not applied\nretroactively). Omitting this field when creating a workflow seeds it to the\ninstance floor instead.\n"},"availableInMCP":{"type":"boolean","description":"Controls whether this workflow is accessible via the Model Context Protocol (MCP).\nDefaults to false.\n\nWhen enabled, this workflow can be called by MCP clients (AI assistants and other tools\nthat support MCP). This allows external AI tools to discover and execute this workflow\nas part of their capabilities.\n\nRequirements for enabling MCP access:\n- The workflow must be active (not deactivated)\n- The workflow must contain at least one active Webhook node\n- Only webhook-triggered workflows can be exposed via MCP\n\nSecurity note: When a workflow is available in MCP, it can be discovered and executed\nby any MCP client that has the appropriate API credentials for your n8n instance.\n"},"customTelemetryTags":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"sharedWorkflow":{"type":"object","additionalProperties":false,"properties":{"role":{"type":"string"},"workflowId":{"type":"string"},"projectId":{"type":"string"},"project":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"type":{"type":"string","readOnly":true}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"activeVersion":{"type":"object","readOnly":true,"nullable":true,"additionalProperties":false,"properties":{"versionId":{"type":"string","readOnly":true,"description":"Unique identifier for this workflow version"},"workflowId":{"type":"string","readOnly":true,"description":"The workflow this version belongs to"},"nodes":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object","readOnly":true},"nodeGroups":{"type":"array","readOnly":true,"description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"authors":{"type":"string","readOnly":true,"description":"Comma-separated list of author IDs who contributed to this version"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/workflows/{id}":{"put":{"tags":["Workflow"],"summary":"Update a workflow","description":"Update a workflow. If the workflow is published, the updated version will be automatically re-published.","parameters":[{"$ref":"#/components/parameters/workflowId"}],"requestBody":{"description":"Updated workflow object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/workflow"}}},"required":true},"responses":{"200":{"description":"Workflow object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/workflow"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Delete a workflow

> Delete a workflow.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Workflow","description":"Operations about workflows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"workflowId":{"name":"id","in":"path","description":"The ID of the workflow.","required":true,"schema":{"type":"string"}}},"schemas":{"workflow":{"type":"object","additionalProperties":false,"required":["name","nodes","connections","settings"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"description":{"type":"string","description":"Description of the workflow"},"active":{"type":"boolean","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"isArchived":{"type":"boolean","readOnly":true},"versionId":{"type":"string","readOnly":true,"description":"Current version identifier used for optimistic locking"},"triggerCount":{"type":"integer","readOnly":true,"description":"Number of active trigger nodes in the workflow"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object"},"nodeGroups":{"type":"array","description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"settings":{"$ref":"#/components/schemas/workflowSettings"},"staticData":{"anyOf":[{"type":"string","format":"jsonString","nullable":true},{"type":"object","nullable":true}]},"pinData":{"type":"object","nullable":true,"description":"Pinned sample data for nodes, keyed by node name"},"meta":{"type":"object","nullable":true,"readOnly":true,"description":"Workflow metadata such as template information","properties":{"onboardingId":{"type":"string"},"templateId":{"type":"string"},"instanceId":{"type":"string"},"templateCredsSetupCompleted":{"type":"boolean"}}},"tags":{"type":"array","items":{"$ref":"#/components/schemas/tag"},"readOnly":true},"shared":{"type":"array","items":{"$ref":"#/components/schemas/sharedWorkflow"}},"activeVersion":{"$ref":"#/components/schemas/activeVersion"}}},"node":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"name":{"type":"string"},"webhookId":{"type":"string"},"disabled":{"type":"boolean"},"notesInFlow":{"type":"boolean"},"notes":{"type":"string"},"type":{"type":"string"},"typeVersion":{"type":"number"},"executeOnce":{"type":"boolean"},"alwaysOutputData":{"type":"boolean"},"retryOnFail":{"type":"boolean"},"maxTries":{"type":"number"},"waitBetweenTries":{"type":"number"},"continueOnFail":{"type":"boolean","description":"use onError instead","deprecated":true},"onError":{"type":"string"},"position":{"type":"array","items":{"type":"number"}},"parameters":{"type":"object","additionalProperties":true},"credentials":{"type":"object"},"customTelemetryTags":{"type":"object","additionalProperties":false,"properties":{"tag":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"workflowNodeGroup":{"type":"object","additionalProperties":false,"required":["id","name","nodeIds"],"properties":{"id":{"type":"string","description":"Unique identifier for the node group"},"name":{"type":"string","description":"Display name of the node group"},"nodeIds":{"type":"array","description":"IDs of the nodes that belong to this group","items":{"type":"string"}}}},"workflowSettings":{"type":"object","additionalProperties":false,"properties":{"saveExecutionProgress":{"type":"boolean"},"saveManualExecutions":{"type":"boolean"},"saveDataErrorExecution":{"type":"string","enum":["all","none"]},"saveDataSuccessExecution":{"type":"string","enum":["all","none"]},"executionTimeout":{"type":"number","maxLength":3600},"errorWorkflow":{"type":"string","description":"The ID of the workflow that contains the error trigger node."},"timezone":{"type":"string"},"executionOrder":{"type":"string"},"callerPolicy":{"type":"string","enum":["any","none","workflowsFromAList","workflowsFromSameOwner"],"description":"Controls which workflows are allowed to call this workflow using the Execute Workflow node.\nDefaults to workflowsFromSameOwner.\n\nAvailable options:\n- `any`: Any workflow can call this workflow (no restrictions)\n- `none`: No other workflows can call this workflow (completely blocked)\n- `workflowsFromSameOwner` (default): Only workflows owned by the same project can call this workflow\n  * For personal projects: Only workflows created by the same user\n  * For team projects: Only workflows within the same team project\n- `workflowsFromAList`: Only specific workflows listed in the `callerIds` field can call this workflow\n  * Requires the `callerIds` field to specify which workflow IDs are allowed\n  * See `callerIds` field documentation for usage\n"},"callerIds":{"type":"string","description":"Comma-separated list of workflow IDs allowed to call this workflow (only used with workflowsFromAList policy)"},"timeSavedPerExecution":{"type":"number","description":"Estimated time saved per execution in minutes"},"redactionPolicy":{"type":"string","enum":["none","non-manual","manual-only","all"],"description":"Controls whether execution data is redacted for this workflow.\n\nAvailable options:\n- `none` (default): No redaction — all execution data is stored.\n- `non-manual`: Redact production (non-manually triggered) executions only.\n- `manual-only`: Redact manually triggered executions only.\n- `all`: Redact all executions (manual and production).\n\nWhen the instance has a redaction floor configured, the policy must be equal to\nor stricter than the floor. A policy weaker than the floor is rejected with 422\non create, and on update when it changes the stored policy; an unchanged\npre-existing below-floor policy is preserved (the floor is not applied\nretroactively). Omitting this field when creating a workflow seeds it to the\ninstance floor instead.\n"},"availableInMCP":{"type":"boolean","description":"Controls whether this workflow is accessible via the Model Context Protocol (MCP).\nDefaults to false.\n\nWhen enabled, this workflow can be called by MCP clients (AI assistants and other tools\nthat support MCP). This allows external AI tools to discover and execute this workflow\nas part of their capabilities.\n\nRequirements for enabling MCP access:\n- The workflow must be active (not deactivated)\n- The workflow must contain at least one active Webhook node\n- Only webhook-triggered workflows can be exposed via MCP\n\nSecurity note: When a workflow is available in MCP, it can be discovered and executed\nby any MCP client that has the appropriate API credentials for your n8n instance.\n"},"customTelemetryTags":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"sharedWorkflow":{"type":"object","additionalProperties":false,"properties":{"role":{"type":"string"},"workflowId":{"type":"string"},"projectId":{"type":"string"},"project":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"type":{"type":"string","readOnly":true}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"activeVersion":{"type":"object","readOnly":true,"nullable":true,"additionalProperties":false,"properties":{"versionId":{"type":"string","readOnly":true,"description":"Unique identifier for this workflow version"},"workflowId":{"type":"string","readOnly":true,"description":"The workflow this version belongs to"},"nodes":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object","readOnly":true},"nodeGroups":{"type":"array","readOnly":true,"description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"authors":{"type":"string","readOnly":true,"description":"Comma-separated list of author IDs who contributed to this version"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}}},"responses":{"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/workflows/{id}":{"delete":{"tags":["Workflow"],"summary":"Delete a workflow","description":"Delete a workflow.","parameters":[{"$ref":"#/components/parameters/workflowId"}],"responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/workflow"}}}},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Retrieves a specific version of a workflow

> Retrieves a specific version of a workflow from workflow history.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Workflow","description":"Operations about workflows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"workflowId":{"name":"id","in":"path","description":"The ID of the workflow.","required":true,"schema":{"type":"string"}}},"schemas":{"workflowVersion":{"type":"object","additionalProperties":false,"required":["versionId","workflowId","nodes","connections","authors"],"properties":{"versionId":{"type":"string","readOnly":true,"description":"The version ID of this workflow snapshot"},"workflowId":{"type":"string","readOnly":true,"description":"The workflow ID this version belongs to"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/node"},"description":"Nodes as they were in this version","readOnly":true},"connections":{"type":"object","description":"Connections as they were in this version","readOnly":true},"nodeGroups":{"type":"array","readOnly":true,"description":"Node groups as they were in this version","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"authors":{"type":"string","readOnly":true,"description":"Authors who created this version"},"name":{"type":"string","nullable":true,"description":"Workflow name at this version"},"description":{"type":"string","nullable":true,"description":"Workflow description at this version"},"createdAt":{"type":"string","format":"date-time","readOnly":true,"description":"When this version was created"},"updatedAt":{"type":"string","format":"date-time","readOnly":true,"description":"When this version was last updated"}}},"node":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"name":{"type":"string"},"webhookId":{"type":"string"},"disabled":{"type":"boolean"},"notesInFlow":{"type":"boolean"},"notes":{"type":"string"},"type":{"type":"string"},"typeVersion":{"type":"number"},"executeOnce":{"type":"boolean"},"alwaysOutputData":{"type":"boolean"},"retryOnFail":{"type":"boolean"},"maxTries":{"type":"number"},"waitBetweenTries":{"type":"number"},"continueOnFail":{"type":"boolean","description":"use onError instead","deprecated":true},"onError":{"type":"string"},"position":{"type":"array","items":{"type":"number"}},"parameters":{"type":"object","additionalProperties":true},"credentials":{"type":"object"},"customTelemetryTags":{"type":"object","additionalProperties":false,"properties":{"tag":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"workflowNodeGroup":{"type":"object","additionalProperties":false,"required":["id","name","nodeIds"],"properties":{"id":{"type":"string","description":"Unique identifier for the node group"},"name":{"type":"string","description":"Display name of the node group"},"nodeIds":{"type":"array","description":"IDs of the nodes that belong to this group","items":{"type":"string"}}}}},"responses":{"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/workflows/{id}/{versionId}":{"get":{"tags":["Workflow"],"summary":"Retrieves a specific version of a workflow","description":"Retrieves a specific version of a workflow from workflow history.","parameters":[{"$ref":"#/components/parameters/workflowId"},{"name":"versionId","in":"path","required":true,"description":"The version ID to retrieve","schema":{"type":"string"}}],"responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/workflowVersion"}}}},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Publish a workflow

> Publish a workflow. In n8n v1, this action was termed activating a workflow.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Workflow","description":"Operations about workflows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"workflowId":{"name":"id","in":"path","description":"The ID of the workflow.","required":true,"schema":{"type":"string"}}},"schemas":{"workflow":{"type":"object","additionalProperties":false,"required":["name","nodes","connections","settings"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"description":{"type":"string","description":"Description of the workflow"},"active":{"type":"boolean","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"isArchived":{"type":"boolean","readOnly":true},"versionId":{"type":"string","readOnly":true,"description":"Current version identifier used for optimistic locking"},"triggerCount":{"type":"integer","readOnly":true,"description":"Number of active trigger nodes in the workflow"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object"},"nodeGroups":{"type":"array","description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"settings":{"$ref":"#/components/schemas/workflowSettings"},"staticData":{"anyOf":[{"type":"string","format":"jsonString","nullable":true},{"type":"object","nullable":true}]},"pinData":{"type":"object","nullable":true,"description":"Pinned sample data for nodes, keyed by node name"},"meta":{"type":"object","nullable":true,"readOnly":true,"description":"Workflow metadata such as template information","properties":{"onboardingId":{"type":"string"},"templateId":{"type":"string"},"instanceId":{"type":"string"},"templateCredsSetupCompleted":{"type":"boolean"}}},"tags":{"type":"array","items":{"$ref":"#/components/schemas/tag"},"readOnly":true},"shared":{"type":"array","items":{"$ref":"#/components/schemas/sharedWorkflow"}},"activeVersion":{"$ref":"#/components/schemas/activeVersion"}}},"node":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"name":{"type":"string"},"webhookId":{"type":"string"},"disabled":{"type":"boolean"},"notesInFlow":{"type":"boolean"},"notes":{"type":"string"},"type":{"type":"string"},"typeVersion":{"type":"number"},"executeOnce":{"type":"boolean"},"alwaysOutputData":{"type":"boolean"},"retryOnFail":{"type":"boolean"},"maxTries":{"type":"number"},"waitBetweenTries":{"type":"number"},"continueOnFail":{"type":"boolean","description":"use onError instead","deprecated":true},"onError":{"type":"string"},"position":{"type":"array","items":{"type":"number"}},"parameters":{"type":"object","additionalProperties":true},"credentials":{"type":"object"},"customTelemetryTags":{"type":"object","additionalProperties":false,"properties":{"tag":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"workflowNodeGroup":{"type":"object","additionalProperties":false,"required":["id","name","nodeIds"],"properties":{"id":{"type":"string","description":"Unique identifier for the node group"},"name":{"type":"string","description":"Display name of the node group"},"nodeIds":{"type":"array","description":"IDs of the nodes that belong to this group","items":{"type":"string"}}}},"workflowSettings":{"type":"object","additionalProperties":false,"properties":{"saveExecutionProgress":{"type":"boolean"},"saveManualExecutions":{"type":"boolean"},"saveDataErrorExecution":{"type":"string","enum":["all","none"]},"saveDataSuccessExecution":{"type":"string","enum":["all","none"]},"executionTimeout":{"type":"number","maxLength":3600},"errorWorkflow":{"type":"string","description":"The ID of the workflow that contains the error trigger node."},"timezone":{"type":"string"},"executionOrder":{"type":"string"},"callerPolicy":{"type":"string","enum":["any","none","workflowsFromAList","workflowsFromSameOwner"],"description":"Controls which workflows are allowed to call this workflow using the Execute Workflow node.\nDefaults to workflowsFromSameOwner.\n\nAvailable options:\n- `any`: Any workflow can call this workflow (no restrictions)\n- `none`: No other workflows can call this workflow (completely blocked)\n- `workflowsFromSameOwner` (default): Only workflows owned by the same project can call this workflow\n  * For personal projects: Only workflows created by the same user\n  * For team projects: Only workflows within the same team project\n- `workflowsFromAList`: Only specific workflows listed in the `callerIds` field can call this workflow\n  * Requires the `callerIds` field to specify which workflow IDs are allowed\n  * See `callerIds` field documentation for usage\n"},"callerIds":{"type":"string","description":"Comma-separated list of workflow IDs allowed to call this workflow (only used with workflowsFromAList policy)"},"timeSavedPerExecution":{"type":"number","description":"Estimated time saved per execution in minutes"},"redactionPolicy":{"type":"string","enum":["none","non-manual","manual-only","all"],"description":"Controls whether execution data is redacted for this workflow.\n\nAvailable options:\n- `none` (default): No redaction — all execution data is stored.\n- `non-manual`: Redact production (non-manually triggered) executions only.\n- `manual-only`: Redact manually triggered executions only.\n- `all`: Redact all executions (manual and production).\n\nWhen the instance has a redaction floor configured, the policy must be equal to\nor stricter than the floor. A policy weaker than the floor is rejected with 422\non create, and on update when it changes the stored policy; an unchanged\npre-existing below-floor policy is preserved (the floor is not applied\nretroactively). Omitting this field when creating a workflow seeds it to the\ninstance floor instead.\n"},"availableInMCP":{"type":"boolean","description":"Controls whether this workflow is accessible via the Model Context Protocol (MCP).\nDefaults to false.\n\nWhen enabled, this workflow can be called by MCP clients (AI assistants and other tools\nthat support MCP). This allows external AI tools to discover and execute this workflow\nas part of their capabilities.\n\nRequirements for enabling MCP access:\n- The workflow must be active (not deactivated)\n- The workflow must contain at least one active Webhook node\n- Only webhook-triggered workflows can be exposed via MCP\n\nSecurity note: When a workflow is available in MCP, it can be discovered and executed\nby any MCP client that has the appropriate API credentials for your n8n instance.\n"},"customTelemetryTags":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"sharedWorkflow":{"type":"object","additionalProperties":false,"properties":{"role":{"type":"string"},"workflowId":{"type":"string"},"projectId":{"type":"string"},"project":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"type":{"type":"string","readOnly":true}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"activeVersion":{"type":"object","readOnly":true,"nullable":true,"additionalProperties":false,"properties":{"versionId":{"type":"string","readOnly":true,"description":"Unique identifier for this workflow version"},"workflowId":{"type":"string","readOnly":true,"description":"The workflow this version belongs to"},"nodes":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object","readOnly":true},"nodeGroups":{"type":"array","readOnly":true,"description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"authors":{"type":"string","readOnly":true,"description":"Comma-separated list of author IDs who contributed to this version"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/workflows/{id}/activate":{"post":{"tags":["Workflow"],"summary":"Publish a workflow","description":"Publish a workflow. In n8n v1, this action was termed activating a workflow.","parameters":[{"$ref":"#/components/parameters/workflowId"}],"requestBody":{"description":"Optional parameters to publish the workflow.","content":{"application/json":{"schema":{"type":"object","properties":{"versionId":{"type":"string","description":"The specific version ID to activate or publish. If not provided, the latest version is used."},"name":{"type":"string","description":"Optional name for the workflow version during activation."},"description":{"type":"string","description":"Optional description for the workflow version during activation."}}}}},"required":false},"responses":{"200":{"description":"Workflow object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/workflow"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Deactivate a workflow

> Deactivate a workflow.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Workflow","description":"Operations about workflows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"workflowId":{"name":"id","in":"path","description":"The ID of the workflow.","required":true,"schema":{"type":"string"}}},"schemas":{"workflow":{"type":"object","additionalProperties":false,"required":["name","nodes","connections","settings"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"description":{"type":"string","description":"Description of the workflow"},"active":{"type":"boolean","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"isArchived":{"type":"boolean","readOnly":true},"versionId":{"type":"string","readOnly":true,"description":"Current version identifier used for optimistic locking"},"triggerCount":{"type":"integer","readOnly":true,"description":"Number of active trigger nodes in the workflow"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object"},"nodeGroups":{"type":"array","description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"settings":{"$ref":"#/components/schemas/workflowSettings"},"staticData":{"anyOf":[{"type":"string","format":"jsonString","nullable":true},{"type":"object","nullable":true}]},"pinData":{"type":"object","nullable":true,"description":"Pinned sample data for nodes, keyed by node name"},"meta":{"type":"object","nullable":true,"readOnly":true,"description":"Workflow metadata such as template information","properties":{"onboardingId":{"type":"string"},"templateId":{"type":"string"},"instanceId":{"type":"string"},"templateCredsSetupCompleted":{"type":"boolean"}}},"tags":{"type":"array","items":{"$ref":"#/components/schemas/tag"},"readOnly":true},"shared":{"type":"array","items":{"$ref":"#/components/schemas/sharedWorkflow"}},"activeVersion":{"$ref":"#/components/schemas/activeVersion"}}},"node":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"name":{"type":"string"},"webhookId":{"type":"string"},"disabled":{"type":"boolean"},"notesInFlow":{"type":"boolean"},"notes":{"type":"string"},"type":{"type":"string"},"typeVersion":{"type":"number"},"executeOnce":{"type":"boolean"},"alwaysOutputData":{"type":"boolean"},"retryOnFail":{"type":"boolean"},"maxTries":{"type":"number"},"waitBetweenTries":{"type":"number"},"continueOnFail":{"type":"boolean","description":"use onError instead","deprecated":true},"onError":{"type":"string"},"position":{"type":"array","items":{"type":"number"}},"parameters":{"type":"object","additionalProperties":true},"credentials":{"type":"object"},"customTelemetryTags":{"type":"object","additionalProperties":false,"properties":{"tag":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"workflowNodeGroup":{"type":"object","additionalProperties":false,"required":["id","name","nodeIds"],"properties":{"id":{"type":"string","description":"Unique identifier for the node group"},"name":{"type":"string","description":"Display name of the node group"},"nodeIds":{"type":"array","description":"IDs of the nodes that belong to this group","items":{"type":"string"}}}},"workflowSettings":{"type":"object","additionalProperties":false,"properties":{"saveExecutionProgress":{"type":"boolean"},"saveManualExecutions":{"type":"boolean"},"saveDataErrorExecution":{"type":"string","enum":["all","none"]},"saveDataSuccessExecution":{"type":"string","enum":["all","none"]},"executionTimeout":{"type":"number","maxLength":3600},"errorWorkflow":{"type":"string","description":"The ID of the workflow that contains the error trigger node."},"timezone":{"type":"string"},"executionOrder":{"type":"string"},"callerPolicy":{"type":"string","enum":["any","none","workflowsFromAList","workflowsFromSameOwner"],"description":"Controls which workflows are allowed to call this workflow using the Execute Workflow node.\nDefaults to workflowsFromSameOwner.\n\nAvailable options:\n- `any`: Any workflow can call this workflow (no restrictions)\n- `none`: No other workflows can call this workflow (completely blocked)\n- `workflowsFromSameOwner` (default): Only workflows owned by the same project can call this workflow\n  * For personal projects: Only workflows created by the same user\n  * For team projects: Only workflows within the same team project\n- `workflowsFromAList`: Only specific workflows listed in the `callerIds` field can call this workflow\n  * Requires the `callerIds` field to specify which workflow IDs are allowed\n  * See `callerIds` field documentation for usage\n"},"callerIds":{"type":"string","description":"Comma-separated list of workflow IDs allowed to call this workflow (only used with workflowsFromAList policy)"},"timeSavedPerExecution":{"type":"number","description":"Estimated time saved per execution in minutes"},"redactionPolicy":{"type":"string","enum":["none","non-manual","manual-only","all"],"description":"Controls whether execution data is redacted for this workflow.\n\nAvailable options:\n- `none` (default): No redaction — all execution data is stored.\n- `non-manual`: Redact production (non-manually triggered) executions only.\n- `manual-only`: Redact manually triggered executions only.\n- `all`: Redact all executions (manual and production).\n\nWhen the instance has a redaction floor configured, the policy must be equal to\nor stricter than the floor. A policy weaker than the floor is rejected with 422\non create, and on update when it changes the stored policy; an unchanged\npre-existing below-floor policy is preserved (the floor is not applied\nretroactively). Omitting this field when creating a workflow seeds it to the\ninstance floor instead.\n"},"availableInMCP":{"type":"boolean","description":"Controls whether this workflow is accessible via the Model Context Protocol (MCP).\nDefaults to false.\n\nWhen enabled, this workflow can be called by MCP clients (AI assistants and other tools\nthat support MCP). This allows external AI tools to discover and execute this workflow\nas part of their capabilities.\n\nRequirements for enabling MCP access:\n- The workflow must be active (not deactivated)\n- The workflow must contain at least one active Webhook node\n- Only webhook-triggered workflows can be exposed via MCP\n\nSecurity note: When a workflow is available in MCP, it can be discovered and executed\nby any MCP client that has the appropriate API credentials for your n8n instance.\n"},"customTelemetryTags":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"sharedWorkflow":{"type":"object","additionalProperties":false,"properties":{"role":{"type":"string"},"workflowId":{"type":"string"},"projectId":{"type":"string"},"project":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"type":{"type":"string","readOnly":true}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"activeVersion":{"type":"object","readOnly":true,"nullable":true,"additionalProperties":false,"properties":{"versionId":{"type":"string","readOnly":true,"description":"Unique identifier for this workflow version"},"workflowId":{"type":"string","readOnly":true,"description":"The workflow this version belongs to"},"nodes":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object","readOnly":true},"nodeGroups":{"type":"array","readOnly":true,"description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"authors":{"type":"string","readOnly":true,"description":"Comma-separated list of author IDs who contributed to this version"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}}},"responses":{"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/workflows/{id}/deactivate":{"post":{"tags":["Workflow"],"summary":"Deactivate a workflow","description":"Deactivate a workflow.","parameters":[{"$ref":"#/components/parameters/workflowId"}],"responses":{"200":{"description":"Workflow object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/workflow"}}}},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Archive a workflow

> Soft-deletes a workflow by archiving it. Idempotent: archiving an\
> already archived workflow returns 200 with the current workflow.\
> \
> Requires API key scope \`workflow:delete\`.<br>

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Workflow","description":"Operations about workflows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"workflowId":{"name":"id","in":"path","description":"The ID of the workflow.","required":true,"schema":{"type":"string"}}},"schemas":{"workflow":{"type":"object","additionalProperties":false,"required":["name","nodes","connections","settings"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"description":{"type":"string","description":"Description of the workflow"},"active":{"type":"boolean","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"isArchived":{"type":"boolean","readOnly":true},"versionId":{"type":"string","readOnly":true,"description":"Current version identifier used for optimistic locking"},"triggerCount":{"type":"integer","readOnly":true,"description":"Number of active trigger nodes in the workflow"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object"},"nodeGroups":{"type":"array","description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"settings":{"$ref":"#/components/schemas/workflowSettings"},"staticData":{"anyOf":[{"type":"string","format":"jsonString","nullable":true},{"type":"object","nullable":true}]},"pinData":{"type":"object","nullable":true,"description":"Pinned sample data for nodes, keyed by node name"},"meta":{"type":"object","nullable":true,"readOnly":true,"description":"Workflow metadata such as template information","properties":{"onboardingId":{"type":"string"},"templateId":{"type":"string"},"instanceId":{"type":"string"},"templateCredsSetupCompleted":{"type":"boolean"}}},"tags":{"type":"array","items":{"$ref":"#/components/schemas/tag"},"readOnly":true},"shared":{"type":"array","items":{"$ref":"#/components/schemas/sharedWorkflow"}},"activeVersion":{"$ref":"#/components/schemas/activeVersion"}}},"node":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"name":{"type":"string"},"webhookId":{"type":"string"},"disabled":{"type":"boolean"},"notesInFlow":{"type":"boolean"},"notes":{"type":"string"},"type":{"type":"string"},"typeVersion":{"type":"number"},"executeOnce":{"type":"boolean"},"alwaysOutputData":{"type":"boolean"},"retryOnFail":{"type":"boolean"},"maxTries":{"type":"number"},"waitBetweenTries":{"type":"number"},"continueOnFail":{"type":"boolean","description":"use onError instead","deprecated":true},"onError":{"type":"string"},"position":{"type":"array","items":{"type":"number"}},"parameters":{"type":"object","additionalProperties":true},"credentials":{"type":"object"},"customTelemetryTags":{"type":"object","additionalProperties":false,"properties":{"tag":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"workflowNodeGroup":{"type":"object","additionalProperties":false,"required":["id","name","nodeIds"],"properties":{"id":{"type":"string","description":"Unique identifier for the node group"},"name":{"type":"string","description":"Display name of the node group"},"nodeIds":{"type":"array","description":"IDs of the nodes that belong to this group","items":{"type":"string"}}}},"workflowSettings":{"type":"object","additionalProperties":false,"properties":{"saveExecutionProgress":{"type":"boolean"},"saveManualExecutions":{"type":"boolean"},"saveDataErrorExecution":{"type":"string","enum":["all","none"]},"saveDataSuccessExecution":{"type":"string","enum":["all","none"]},"executionTimeout":{"type":"number","maxLength":3600},"errorWorkflow":{"type":"string","description":"The ID of the workflow that contains the error trigger node."},"timezone":{"type":"string"},"executionOrder":{"type":"string"},"callerPolicy":{"type":"string","enum":["any","none","workflowsFromAList","workflowsFromSameOwner"],"description":"Controls which workflows are allowed to call this workflow using the Execute Workflow node.\nDefaults to workflowsFromSameOwner.\n\nAvailable options:\n- `any`: Any workflow can call this workflow (no restrictions)\n- `none`: No other workflows can call this workflow (completely blocked)\n- `workflowsFromSameOwner` (default): Only workflows owned by the same project can call this workflow\n  * For personal projects: Only workflows created by the same user\n  * For team projects: Only workflows within the same team project\n- `workflowsFromAList`: Only specific workflows listed in the `callerIds` field can call this workflow\n  * Requires the `callerIds` field to specify which workflow IDs are allowed\n  * See `callerIds` field documentation for usage\n"},"callerIds":{"type":"string","description":"Comma-separated list of workflow IDs allowed to call this workflow (only used with workflowsFromAList policy)"},"timeSavedPerExecution":{"type":"number","description":"Estimated time saved per execution in minutes"},"redactionPolicy":{"type":"string","enum":["none","non-manual","manual-only","all"],"description":"Controls whether execution data is redacted for this workflow.\n\nAvailable options:\n- `none` (default): No redaction — all execution data is stored.\n- `non-manual`: Redact production (non-manually triggered) executions only.\n- `manual-only`: Redact manually triggered executions only.\n- `all`: Redact all executions (manual and production).\n\nWhen the instance has a redaction floor configured, the policy must be equal to\nor stricter than the floor. A policy weaker than the floor is rejected with 422\non create, and on update when it changes the stored policy; an unchanged\npre-existing below-floor policy is preserved (the floor is not applied\nretroactively). Omitting this field when creating a workflow seeds it to the\ninstance floor instead.\n"},"availableInMCP":{"type":"boolean","description":"Controls whether this workflow is accessible via the Model Context Protocol (MCP).\nDefaults to false.\n\nWhen enabled, this workflow can be called by MCP clients (AI assistants and other tools\nthat support MCP). This allows external AI tools to discover and execute this workflow\nas part of their capabilities.\n\nRequirements for enabling MCP access:\n- The workflow must be active (not deactivated)\n- The workflow must contain at least one active Webhook node\n- Only webhook-triggered workflows can be exposed via MCP\n\nSecurity note: When a workflow is available in MCP, it can be discovered and executed\nby any MCP client that has the appropriate API credentials for your n8n instance.\n"},"customTelemetryTags":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"sharedWorkflow":{"type":"object","additionalProperties":false,"properties":{"role":{"type":"string"},"workflowId":{"type":"string"},"projectId":{"type":"string"},"project":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"type":{"type":"string","readOnly":true}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"activeVersion":{"type":"object","readOnly":true,"nullable":true,"additionalProperties":false,"properties":{"versionId":{"type":"string","readOnly":true,"description":"Unique identifier for this workflow version"},"workflowId":{"type":"string","readOnly":true,"description":"The workflow this version belongs to"},"nodes":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object","readOnly":true},"nodeGroups":{"type":"array","readOnly":true,"description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"authors":{"type":"string","readOnly":true,"description":"Comma-separated list of author IDs who contributed to this version"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/workflows/{id}/archive":{"post":{"tags":["Workflow"],"summary":"Archive a workflow","description":"Soft-deletes a workflow by archiving it. Idempotent: archiving an\nalready archived workflow returns 200 with the current workflow.\n\nRequires API key scope `workflow:delete`.\n","parameters":[{"$ref":"#/components/parameters/workflowId"}],"responses":{"200":{"description":"Archived workflow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/workflow"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Unarchive a workflow

> Restores an archived workflow.\
> \
> Requires API key scope \`workflow:delete\`.<br>

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Workflow","description":"Operations about workflows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"workflowId":{"name":"id","in":"path","description":"The ID of the workflow.","required":true,"schema":{"type":"string"}}},"schemas":{"workflow":{"type":"object","additionalProperties":false,"required":["name","nodes","connections","settings"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"description":{"type":"string","description":"Description of the workflow"},"active":{"type":"boolean","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"isArchived":{"type":"boolean","readOnly":true},"versionId":{"type":"string","readOnly":true,"description":"Current version identifier used for optimistic locking"},"triggerCount":{"type":"integer","readOnly":true,"description":"Number of active trigger nodes in the workflow"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object"},"nodeGroups":{"type":"array","description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"settings":{"$ref":"#/components/schemas/workflowSettings"},"staticData":{"anyOf":[{"type":"string","format":"jsonString","nullable":true},{"type":"object","nullable":true}]},"pinData":{"type":"object","nullable":true,"description":"Pinned sample data for nodes, keyed by node name"},"meta":{"type":"object","nullable":true,"readOnly":true,"description":"Workflow metadata such as template information","properties":{"onboardingId":{"type":"string"},"templateId":{"type":"string"},"instanceId":{"type":"string"},"templateCredsSetupCompleted":{"type":"boolean"}}},"tags":{"type":"array","items":{"$ref":"#/components/schemas/tag"},"readOnly":true},"shared":{"type":"array","items":{"$ref":"#/components/schemas/sharedWorkflow"}},"activeVersion":{"$ref":"#/components/schemas/activeVersion"}}},"node":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"name":{"type":"string"},"webhookId":{"type":"string"},"disabled":{"type":"boolean"},"notesInFlow":{"type":"boolean"},"notes":{"type":"string"},"type":{"type":"string"},"typeVersion":{"type":"number"},"executeOnce":{"type":"boolean"},"alwaysOutputData":{"type":"boolean"},"retryOnFail":{"type":"boolean"},"maxTries":{"type":"number"},"waitBetweenTries":{"type":"number"},"continueOnFail":{"type":"boolean","description":"use onError instead","deprecated":true},"onError":{"type":"string"},"position":{"type":"array","items":{"type":"number"}},"parameters":{"type":"object","additionalProperties":true},"credentials":{"type":"object"},"customTelemetryTags":{"type":"object","additionalProperties":false,"properties":{"tag":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"workflowNodeGroup":{"type":"object","additionalProperties":false,"required":["id","name","nodeIds"],"properties":{"id":{"type":"string","description":"Unique identifier for the node group"},"name":{"type":"string","description":"Display name of the node group"},"nodeIds":{"type":"array","description":"IDs of the nodes that belong to this group","items":{"type":"string"}}}},"workflowSettings":{"type":"object","additionalProperties":false,"properties":{"saveExecutionProgress":{"type":"boolean"},"saveManualExecutions":{"type":"boolean"},"saveDataErrorExecution":{"type":"string","enum":["all","none"]},"saveDataSuccessExecution":{"type":"string","enum":["all","none"]},"executionTimeout":{"type":"number","maxLength":3600},"errorWorkflow":{"type":"string","description":"The ID of the workflow that contains the error trigger node."},"timezone":{"type":"string"},"executionOrder":{"type":"string"},"callerPolicy":{"type":"string","enum":["any","none","workflowsFromAList","workflowsFromSameOwner"],"description":"Controls which workflows are allowed to call this workflow using the Execute Workflow node.\nDefaults to workflowsFromSameOwner.\n\nAvailable options:\n- `any`: Any workflow can call this workflow (no restrictions)\n- `none`: No other workflows can call this workflow (completely blocked)\n- `workflowsFromSameOwner` (default): Only workflows owned by the same project can call this workflow\n  * For personal projects: Only workflows created by the same user\n  * For team projects: Only workflows within the same team project\n- `workflowsFromAList`: Only specific workflows listed in the `callerIds` field can call this workflow\n  * Requires the `callerIds` field to specify which workflow IDs are allowed\n  * See `callerIds` field documentation for usage\n"},"callerIds":{"type":"string","description":"Comma-separated list of workflow IDs allowed to call this workflow (only used with workflowsFromAList policy)"},"timeSavedPerExecution":{"type":"number","description":"Estimated time saved per execution in minutes"},"redactionPolicy":{"type":"string","enum":["none","non-manual","manual-only","all"],"description":"Controls whether execution data is redacted for this workflow.\n\nAvailable options:\n- `none` (default): No redaction — all execution data is stored.\n- `non-manual`: Redact production (non-manually triggered) executions only.\n- `manual-only`: Redact manually triggered executions only.\n- `all`: Redact all executions (manual and production).\n\nWhen the instance has a redaction floor configured, the policy must be equal to\nor stricter than the floor. A policy weaker than the floor is rejected with 422\non create, and on update when it changes the stored policy; an unchanged\npre-existing below-floor policy is preserved (the floor is not applied\nretroactively). Omitting this field when creating a workflow seeds it to the\ninstance floor instead.\n"},"availableInMCP":{"type":"boolean","description":"Controls whether this workflow is accessible via the Model Context Protocol (MCP).\nDefaults to false.\n\nWhen enabled, this workflow can be called by MCP clients (AI assistants and other tools\nthat support MCP). This allows external AI tools to discover and execute this workflow\nas part of their capabilities.\n\nRequirements for enabling MCP access:\n- The workflow must be active (not deactivated)\n- The workflow must contain at least one active Webhook node\n- Only webhook-triggered workflows can be exposed via MCP\n\nSecurity note: When a workflow is available in MCP, it can be discovered and executed\nby any MCP client that has the appropriate API credentials for your n8n instance.\n"},"customTelemetryTags":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}}}},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"sharedWorkflow":{"type":"object","additionalProperties":false,"properties":{"role":{"type":"string"},"workflowId":{"type":"string"},"projectId":{"type":"string"},"project":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"type":{"type":"string","readOnly":true}}},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"activeVersion":{"type":"object","readOnly":true,"nullable":true,"additionalProperties":false,"properties":{"versionId":{"type":"string","readOnly":true,"description":"Unique identifier for this workflow version"},"workflowId":{"type":"string","readOnly":true,"description":"The workflow this version belongs to"},"nodes":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/node"}},"connections":{"type":"object","readOnly":true},"nodeGroups":{"type":"array","readOnly":true,"description":"Visual groupings of nodes shown as frames on the canvas","items":{"$ref":"#/components/schemas/workflowNodeGroup"}},"authors":{"type":"string","readOnly":true,"description":"Comma-separated list of author IDs who contributed to this version"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/workflows/{id}/unarchive":{"post":{"tags":["Workflow"],"summary":"Unarchive a workflow","description":"Restores an archived workflow.\n\nRequires API key scope `workflow:delete`.\n","parameters":[{"$ref":"#/components/parameters/workflowId"}],"responses":{"200":{"description":"Unarchived workflow","content":{"application/json":{"schema":{"$ref":"#/components/schemas/workflow"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Transfer a workflow to another project

> Transfer a workflow to another project

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Workflow","description":"Operations about workflows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"workflowId":{"name":"id","in":"path","description":"The ID of the workflow.","required":true,"schema":{"type":"string"}}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/workflows/{id}/transfer":{"put":{"tags":["Workflow"],"summary":"Transfer a workflow to another project","description":"Transfer a workflow to another project","parameters":[{"$ref":"#/components/parameters/workflowId"}],"requestBody":{"description":"Destination project information for the workflow transfer.","content":{"application/json":{"schema":{"type":"object","properties":{"destinationProjectId":{"type":"string","description":"The ID of the project to transfer the workflow to."}},"required":["destinationProjectId"]}}},"required":true},"responses":{"200":{"description":"Operation successful."},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Get workflow tags

> Get workflow tags.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Workflow","description":"Operations about workflows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"workflowId":{"name":"id","in":"path","description":"The ID of the workflow.","required":true,"schema":{"type":"string"}}},"schemas":{"workflowTags":{"type":"array","items":{"$ref":"#/components/schemas/tag"}},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/workflows/{id}/tags":{"get":{"tags":["Workflow"],"summary":"Get workflow tags","description":"Get workflow tags.","parameters":[{"$ref":"#/components/parameters/workflowId"}],"responses":{"200":{"description":"List of tags","content":{"application/json":{"schema":{"$ref":"#/components/schemas/workflowTags"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Update tags of a workflow

> Update tags of a workflow.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Workflow","description":"Operations about workflows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"parameters":{"workflowId":{"name":"id","in":"path","description":"The ID of the workflow.","required":true,"schema":{"type":"string"}}},"schemas":{"tagIds":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id"],"properties":{"id":{"type":"string"}}}},"workflowTags":{"type":"array","items":{"$ref":"#/components/schemas/tag"}},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/workflows/{id}/tags":{"put":{"tags":["Workflow"],"summary":"Update tags of a workflow","description":"Update tags of a workflow.","parameters":[{"$ref":"#/components/parameters/workflowId"}],"requestBody":{"description":"List of tags","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tagIds"}}},"required":true},"responses":{"200":{"description":"List of tags after add the tag","content":{"application/json":{"schema":{"$ref":"#/components/schemas/workflowTags"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.n8n.io/connect/n8n-api/workflow.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
