Merged
Size
S
Change Breakdown
Bug Fix100%
#27914fix(editor): Remove default for api params

Workflow API fixes silent settings resets

PUT requests to the n8n workflows API no longer silently reset caller and MCP settings when those fields are omitted from the request body.

The n8n REST API had a silent bug that could wipe workflow settings. When developers called PUT on a workflow and omitted the or fields, the API validator was injecting default values and overwriting the stored settings — all without returning an error.

The root cause was AJV's useDefaults option, which injects schema defaults into missing request body fields. When the workflow service merged incoming data, these injected defaults overwrote existing values.

The fix removes the declarations from the API schema. Settings are now only updated when explicitly provided, preserving whatever values were already stored.

This matters for any developer using the n8n REST API to update workflows — their settings will no longer be silently reset when omitted from requests. The default values are documented in the field descriptions for reference.

View Original GitHub Description

Summary

PUT /api/v1/workflows/:id was silently resetting settings.availableInMCP to false and settings.callerPolicy to workflowsFromSameOwner whenever those fields were omitted from the request body.

Root cause: express-openapi-validator runs AJV with useDefaults: true, which injects schema default values into the request body for any missing fields. The settings merge in WorkflowService.update() then spread-overwrote the stored values with these injected defaults.

Fix: remove the default: declarations from availableInMCP and callerPolicy in workflowSettings.yml. The defaults are now documented in the field descriptions only.

<!-- Describe what the PR does and how to test. Photos and videos are recommended. -->

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/ADO-5033/community-issue-rest-api-put-apiv1workflowsid-silently-drops

<!-- Include links to **Linear ticket** or Github issue or Community forum post. Important in order to close *automatically* and provide context to reviewers. https://linear.app/n8n/issue/ --> <!-- Use "closes #<issue-number>", "fixes #<issue-number>", or "resolves #<issue-number>" to automatically close issues when the PR is merged. -->

Review / Merge checklist

  • PR title and summary are descriptive. (conventions) <!-- **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** -->
  • Docs updated or follow-up ticket created.
  • Tests included. <!-- A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests. -->
  • PR Labeled with Backport to Beta, Backport to Stable, or Backport to v1 (if the PR is an urgent fix that needs to be backported)
© 2026 · via Gitpulse