n8n Cloud: Troubleshooting Code Node v2 Return Validation Failures (2.25.7)
n8n Cloud users report that the Code node v2 on 2.25.7 rejects even simple return objects with the error "A 'json' property isn't an object." This appears tied to input/output validation changes in the node or platform runtime and affects automation reliability.
The community report highlights a validation failure in the n8n Cloud 2.25.7 environment where the Code node v2 returns are being rejected. Even a minimal return like return [{ json: { test: 'ok' } }]; triggers a runtime error indicating the node expects a different structure. The issue is especially visible in Run Once for Each Item mode with Execute Once enabled, and it breaks workflows that rely on lightweight custom code for data transformation.
Why it matters: automation platforms are commonly used to fork-and-join data flows across systems. A breaking validation change at the node level can halt business processes, customer-facing automations, and monitoring scripts. For teams using n8n in production, this creates operational downtime and forces either temporary rewrites or platform rollbacks - both costly.
Practical mitigation steps: 1) Inspect and normalize your return shape - ensure json is a plain object (no nested primitives, undefined, or unexpected types). Wrap returns explicitly, e.g., return [{ json: Object.assign({}, { test: 'ok' }) }]; 2) As a quick workaround, shift logic to a Set node or to external microservice until a patch lands. 3) Pin to a prior working node/runtime version if the cloud allows version control or request a rollback. 4) Open a detailed bug report including minimal reproducible example, environment, and execution mode.
Longer-term controls: add unit tests for critical workflows, enable staged deployments for automation changes, and subscribe to n8n release notes. For business leaders: mandate runbook and rollback procedures for automation dependencies, and allocate an on-call engineer for platform incidents to reduce business disruption when tooling regressions occur.
Original Source
n8n Community
