{"record":{"id":"11cb3cd864a60ab9","repo":"n8n-io/n8n","slug":"too-many-redirects-max-maxredirects","errorCode":null,"errorMessage":"Too many redirects (max ${maxRedirects})","messagePattern":"Too many redirects \\(max (.+?)\\)","errorType":"exception","errorClass":"OperationalError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/ai-utilities/src/utils/follow-redirects.ts","lineNumber":48,"sourceCode":"\t\t}\n\n\t\tconst response = await fetcher(currentInput, {\n\t\t\t...currentInit,\n\t\t\tredirect: 'manual',\n\t\t});\n\n\t\tif (response.status < 300 || response.status >= 400) {\n\t\t\treturn response;\n\t\t}\n\n\t\tconst location = response.headers.get('location');\n\t\tif (!location) {\n\t\t\treturn response;\n\t\t}\n\n\t\thops += 1;\n\t\tif (hops > maxRedirects) {\n\t\t\tthrow new OperationalError(`Too many redirects (max ${maxRedirects})`);\n\t\t}\n\n\t\tawait response.body?.cancel().catch(() => {});\n\n\t\tcurrentInput = new URL(location, currentUrlString);\n\n\t\tconst method = (currentInit.method ?? 'GET').toUpperCase();\n\t\tconst isUnsafe = method !== 'GET' && method !== 'HEAD';\n\t\tif (\n\t\t\tresponse.status === 303 ||\n\t\t\t((response.status === 301 || response.status === 302) && isUnsafe)\n\t\t) {\n\t\t\tcurrentInit = { ...currentInit, method: 'GET', body: undefined };\n\t\t}\n\t}\n}\n","sourceCodeStart":30,"sourceCodeEnd":65,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/ai-utilities/src/utils/follow-redirects.ts#L30-L65","documentation":"Error \"Too many redirects (max ${maxRedirects})\" thrown in n8n-io/n8n.","triggerScenarios":"Thrown at packages/@n8n/ai-utilities/src/utils/follow-redirects.ts:48 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}