I’m attempting to use console.log() within a Code node in n8n to debug my workflow. While I can see n8n system logs in my browser console (like “pushing in replay queue” and “page is called”), any console.log() statements I add in Code nodes are not appearing.
What I’ve already tried
I’ve configured the following environment variables:
CODE_ENABLE_STDOUT=true
N8N_LOG_LEVEL=debug
N8N_LOG_OUTPUT=console
Example of logs I can see
pushing in replay queue
logUtil.js:29 page is called
logUtil.js:29 ====== request processed successfully: 200
Example of my Code node
// Access the input JSON data
let inputData = $input.all();
console.log("DATA",inputData)
return inputData;
Questions
Are Code node logs supposed to appear in the browser console, or should I be looking elsewhere?
Are there additional configuration steps needed to enable Code node logging?
Is this behavior different when self-hosting on render.com compared to other deployment methods?
CODE_ENABLE_STDOUT is only needed for non-manual executions.
Since you are debugging this in the browser, your executions are manual, in which case the backend sends a websocket message to the browser to log to the browser console.
There are only reasons that I can think of that could prevent you from seeing these logs:
Either your browser log-level is set exclude the log level, or
Your hosting setup is messing with Websocket connections.
I don’t have any experience with Render, but I’ve seen some other posts here that look like people having issues with Websockets on Render.
Is the rest of the UI upgrading correctly for you on manual executions?
If you open the the “Network” tab in your browser devtools, and look for /rest/push, you can see the websocket messages.
Can you please check if you are receiving a sendConsoleMessage message for every console.log in a code node?