n8n-io/n8n · warning
CODE_NODE_NETWORK_CALL
CODE_NODE_NETWORK_CALL
Error message
${namePrefix}Code node uses requests/urllib/httpx or another HTTP library. Code nodes have no network access at runtime — make the HTTP/API call with an HTTP Request node and process its output in this node instead. What it means
CODE_NODE_NETWORK_CALL (python) is a lint issue. lintPythonCode() uses two regexes to match real import/from lines for requests, urllib (and submodules), httpx, aiohttp, http.client, or 'from http import client'. Code nodes have no network access, so the fix is an HTTP Request node.
Source
Thrown at packages/@n8n/workflow-sdk/src/lint/code-node/python.ts:29
nodeName?: string;
}
/**
* Lint Python written for a Code node (`pythonCode` parameter).
*/
export function lintPythonCode(
pythonCode: string,
options: LintPythonCodeOptions = {},
): SourceLintIssue[] {
if (pythonCode.length === 0) return [];
const issues: SourceLintIssue[] = [];
const namePrefix = options.nodeName ? `'${options.nodeName}' ` : '';
if (PYTHON_NETWORK_IMPORT.test(pythonCode) || PYTHON_NETWORK_FROM_IMPORT.test(pythonCode)) {
issues.push(
lintIssue({
code: 'CODE_NODE_NETWORK_CALL',
message:
`${namePrefix}Code node uses requests/urllib/httpx or another HTTP library. ` +
'Code nodes have no network access at runtime — make the HTTP/API call with an HTTP Request node ' +
'and process its output in this node instead.',
lintTarget: 'pythonCode',
nodeName: options.nodeName,
parameterPath: 'pythonCode',
}),
);
}
return issues;
}
View on GitHub (pinned to 5ac6606e81)
Solutions
- Replace the HTTP call with an HTTP Request node, then process that node's output in the Python Code node.
- Remove the requests/urllib/httpx/aiohttp import entirely.
- Use $input in the Python Code node to consume upstream HTTP Request node output.
Example fix
# before (Code node pythonCode)
import requests
r = requests.get('https://api.example.com/users')
return [{'json': u} for u in r.json()]
# after — HTTP Request node upstream, then in Python Code node:
return [_['json'] for _ in $input.all()] Defensive patterns
Strategy: validation
Validate before calling
import { lintPythonCode } from '@n8n/workflow-sdk/lint/code-node/python';
const issues = lintPythonCode(pythonCode);
if (issues.some((i) => i.code === 'CODE_NODE_NETWORK_CALL')) {
throw new Error('pythonCode imports a network library; move it to an HTTP Request node.');
} Prevention
- Never import requests/urllib/httpx/aiohttp/http.client in a Code node.
- Use an HTTP Request node upstream and process its output in the Python Code node.
- Lint Python Code node bodies in CI.
When it happens
Trigger: import requests, from urllib.request import urlopen, import httpx, import aiohttp, import http.client, or from http import client — anywhere in pythonCode.
Common situations: LLM emits a Python HTTP snippet in a Code node; developer ports a requests-based script; agent confuses Code node Python with a full CPython environment.
Related errors
- CODE_NODE_NETWORK_CALL
- CODE_NODE_FORBIDDEN_IMPORT
- CODE_MODE_API_MISUSE
- CODE_NESTED_TEMPLATE_LITERAL
- Port {config.port} is already in use
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/6ce5e2c415d43210.
Report an issue: GitHub.