- Thread the node execution mode into `lintPythonCode` and flag reading the
accessor the runner only defines in the other mode, mirroring the JS rule's
`CODE_MODE_API_MISUSE`.
- Detect relative imports; the runner rejects them with "Relative imports are
disallowed" and the previous root extraction produced no module for them.
- Make the import message module-neutral. It now names both allowlists rather
than reporting the standard-library error for an external package.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The native Python runner allows no imports unless the deployment sets
N8N_RUNNERS_STDLIB_ALLOW, which is empty by default and forced empty in the
official runners image. It also defines only `_items`, `_item` and `print`.
The builder had no way to know either constraint: the `pythonCode` builderHint
covered only network access, and the property description still advertised
`_today` and `_jmespath`, which went away with Pyodide.
- Correct the `pythonCode` description and builderHint, and add a `language`
builderHint that steers to JavaScript unless Python was asked for.
- Add `CODE_NODE_PYTHON_IMPORT` and `CODE_NODE_PYTHON_UNSUPPORTED_GLOBAL` to
the Code node Python linter, so `workflow-sdk validate` reports both defects.
- Note the constraints in the workflow-builder skill.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Github issue / Community forum post (link here to close automatically):
https://github.com/n8n-io/n8n/pull/6348
---------
Co-authored-by: Giulio Andreini <g.andreini@gmail.com>
Co-authored-by: Marcus <marcus@n8n.io>