{"record":{"id":"6ce5e2c415d43210","repo":"n8n-io/n8n","slug":"code-node-network-call-6ce5e2","errorCode":"CODE_NODE_NETWORK_CALL","errorMessage":"${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.","messagePattern":"(.+?)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\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/@n8n/workflow-sdk/src/lint/code-node/python.ts","lineNumber":29,"sourceCode":"\tnodeName?: string;\n}\n\n/**\n * Lint Python written for a Code node (`pythonCode` parameter).\n */\nexport function lintPythonCode(\n\tpythonCode: string,\n\toptions: LintPythonCodeOptions = {},\n): SourceLintIssue[] {\n\tif (pythonCode.length === 0) return [];\n\n\tconst issues: SourceLintIssue[] = [];\n\tconst namePrefix = options.nodeName ? `'${options.nodeName}' ` : '';\n\n\tif (PYTHON_NETWORK_IMPORT.test(pythonCode) || PYTHON_NETWORK_FROM_IMPORT.test(pythonCode)) {\n\t\tissues.push(\n\t\t\tlintIssue({\n\t\t\t\tcode: 'CODE_NODE_NETWORK_CALL',\n\t\t\t\tmessage:\n\t\t\t\t\t`${namePrefix}Code node uses requests/urllib/httpx or another HTTP library. ` +\n\t\t\t\t\t'Code nodes have no network access at runtime — make the HTTP/API call with an HTTP Request node ' +\n\t\t\t\t\t'and process its output in this node instead.',\n\t\t\t\tlintTarget: 'pythonCode',\n\t\t\t\tnodeName: options.nodeName,\n\t\t\t\tparameterPath: 'pythonCode',\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn issues;\n}\n","sourceCodeStart":11,"sourceCodeEnd":43,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/workflow-sdk/src/lint/code-node/python.ts#L11-L43","documentation":"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.","triggerScenarios":"import requests, from urllib.request import urlopen, import httpx, import aiohttp, import http.client, or from http import client — anywhere in pythonCode.","commonSituations":"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.","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."],"exampleFix":"# before (Code node pythonCode)\nimport requests\nr = requests.get('https://api.example.com/users')\nreturn [{'json': u} for u in r.json()]\n# after — HTTP Request node upstream, then in Python Code node:\nreturn [_['json'] for _ in $input.all()]","handlingStrategy":"validation","validationCode":"import { lintPythonCode } from '@n8n/workflow-sdk/lint/code-node/python';\nconst issues = lintPythonCode(pythonCode);\nif (issues.some((i) => i.code === 'CODE_NODE_NETWORK_CALL')) {\n  throw new Error('pythonCode imports a network library; move it to an HTTP Request node.');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["lint","code-node","network","python","sdk"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}