How to debug Javascript in code node

Describe the issue/error/question

How can I debug the Javascript code in code node? Up to now I am using console.log but it would be much easier to be able to debug the code and check the variables. Is this possible? I am using the Windows app.

What is the error message (if any)?

Please share the workflow


Share the output returned by the last node

Information on your n8n setup

  • **n8n version:**Desktop app for Windows 1.7.0
  • Database you’re using (default: SQLite):
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]:

No sorry, console.log is currently sadly the only way.

Hi Jan, thanks for your reply. Is this an option for the future or technically not possible?

Another question related to this. If I am in the code node in an endless loop, is there a way to interrupt it? Currently I am always closing n8n and reopening it again.

Theoretically more or less everything is possible. So for sure also that. Is really just about how much resources we allocate on things and how we prioritize things.

If you run n8n in main mode stopping and restarting n8n is sadly the only thing that can be done (as then the endless loop blocks the event loop and we can not do anything).
If you run n8n in own mode pressing the stop button should work totally fine (there workflows run in a separate process that n8n can then simply kill).

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.