Debug an n8n Custom Node in VS Code with Breakpoints

Debug an n8n custom node in VS Code with real breakpoints. The n8n node starter already ships a launch.json, “Attach to running n8n”, and source maps, so you can stop inside execute() while npm run dev is running.

Launch your n8n integration - NativeShip.io

In this video:

  • What npm run dev runs: tsc --watch and a separate local n8n
  • .vscode/launch.json: “Attach to running n8n”
  • sourceMap: true, and why it matters
  • Attaching, setting a breakpoint, and pressing Execute step
  • Reading items, getNodeParameter and the API response while paused
  • Where breakpoints won’t help: declarative routing and description changes
  • Three things that look like bugs: node name search, unknown credentials, a blank icon

Chapters
0:00 console.log, again
0:41 What npm run dev runs
1:25 The launch.json you never opened
1:57 Attach and stop on a line
2:29 What you can see while paused
2:58 Where it won’t stop
3:35 Three things that look like bugs
4:03 Recap

New to building nodes? The full series, from an empty folder to a verified n8n community node: https://www.youtube.com/playlist?list=PLYkThRYZ5f5g
Part 2, npm create @n8n/node: https://youtu.be/DhvsnBVhrMA
Part 5, execute(): https://youtu.be/bly8ZShWMh0