n8n · Code node

Code doesn't return an object

Short answer

This n8n Code node error may occur when the node does not return anything or returns an unexpected result. Make sure that the Code node returns the expected data structure. n8n expects an array of objects, each wrapping another object under the json key.

VerifiedLast verified

01Error text

n8n error
Code doesn't return an object

02Likely causes

  • The Code node doesn't return anything, or returns an unexpected result.
  • The code returns undefined instead of the expected result.

03How to fix it

  1. Make sure that the Code node returns the expected data structure. n8n expects an array of objects, each wrapping another object under the json key.
  2. If the code returns undefined, make sure that the data you reference exists in each execution and has the structure your code expects.

04Official documentation

Test every fix in a non-production environment before you apply it to production. See how entries are verified.

More for n8n work:Open n8n jobsn8n rates and salaries

The iPaaS Brief

Subscribe to The iPaaS Brief.

The iPaaS newsletter for the people who run integrations. From iPaaS Group.

Free. You finish on theipaasbrief.com and confirm by email.