n8n errors / Other

this.getWorkflowStaticData is not a function

platform: n8n / category: Other / versions: 1.86.0

Cause

The Code node does not expose getWorkflowStaticData on 'this'; it is only available as the global helper $getWorkflowStaticData.

Fix

Replace this.getWorkflowStaticData('global') with const staticData = $getWorkflowStaticData('global'); in your Code node. See the n8n Code node reference under 'Built-in methods and variables'.

Source thread →

Part of the Automation Error Index — n8n errors: browse all.

Hitting an automation error we have not covered?

AutomateLab builds and debugs n8n, Make, and agent workflows as fixed-scope projects. If something is broken in production, tell us what you are seeing.

Describe the problem