{"record":{"id":"2e59707e11ae448a","repo":"n8n-io/n8n","slug":"default-webhook-url-not-set","errorCode":null,"errorMessage":"Default webhook url not set","messagePattern":"Default webhook url not set","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/ChatTrigger.node.ts","lineNumber":888,"sourceCode":"\t\t} catch (error) {\n\t\t\tif (error) {\n\t\t\t\t// Realm is scoped per webhook so browsers don't reuse cached credentials across chats sharing an origin\n\t\t\t\tconst webhookId = ctx.getNode().webhookId;\n\t\t\t\tconst realm = webhookId ? `Webhook ${webhookId}` : 'Webhook';\n\t\t\t\tres.writeHead((error as IDataObject).responseCode as number, {\n\t\t\t\t\t'www-authenticate': `Basic realm=\"${realm}\"`,\n\t\t\t\t});\n\t\t\t\tres.end((error as IDataObject).message as string);\n\t\t\t\treturn { noWebhookResponse: true };\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t\tif (nodeMode === 'hostedChat') {\n\t\t\t// Show the chat on GET request\n\t\t\tif (webhookName === 'setup') {\n\t\t\t\tconst webhookUrlRaw = ctx.getNodeWebhookUrl('default');\n\t\t\t\tif (!webhookUrlRaw) {\n\t\t\t\t\tthrow new NodeOperationError(ctx.getNode(), 'Default webhook url not set');\n\t\t\t\t}\n\n\t\t\t\tconst webhookUrl =\n\t\t\t\t\tmode === 'test' ? webhookUrlRaw.replace('/webhook', '/webhook-test') : webhookUrlRaw;\n\t\t\t\tconst authentication = ctx.getNodeParameter('authentication') as\n\t\t\t\t\t| 'none'\n\t\t\t\t\t| 'basicAuth'\n\t\t\t\t\t| 'n8nUserAuth';\n\t\t\t\tconst initialMessagesRaw = ctx.getNodeParameter('initialMessages', '');\n\t\t\t\tassertParamIsString('initialMessage', initialMessagesRaw, ctx.getNode());\n\t\t\t\tconst instanceId = ctx.getInstanceId();\n\n\t\t\t\tconst i18nConfig: Record<string, string> = {};\n\t\t\t\tconst keys = ['getStarted', 'inputPlaceholder', 'subtitle', 'title'] as const;\n\t\t\t\tfor (const key of keys) {\n\t\t\t\t\tif (options[key] !== undefined) {\n\t\t\t\t\t\ti18nConfig[key] = options[key];\n\t\t\t\t\t}","sourceCodeStart":870,"sourceCodeEnd":906,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/ChatTrigger.node.ts#L870-L906","documentation":"Thrown by the Chat Trigger's webhook handler (hostedChat setup GET) when ctx.getNodeWebhookUrl('default') returns a falsy value. The hosted chat page needs a public/known webhook URL to post messages to; without one it cannot render the chat.","triggerScenarios":"The n8n instance has no WEBHOOK_URL / N8N_WEBHOOK_URL environment variable set and cannot derive a URL (common in local/offline setups); the instance is behind a proxy that hasn't been configured so n8n cannot determine its own external URL.","commonSituations":"Running n8n locally without setting WEBHOOK_URL; fresh installs; Docker/behind-reverse-proxy setups missing the VITE/WEBHOOK URL env vars; toggling to production mode without configuring the public URL.","solutions":["Set the WEBHOOK_URL (and if needed N8N_HOST, N8N_PORT, N8N_PROTOCOL) environment variable to the externally reachable base URL, then restart n8n.","If behind a reverse proxy, configure N8N_EDITOR_BASE_URL and the proxy headers (X-Forwarded-*) so n8n computes the URL correctly.","For local testing, set WEBHOOK_URL=http://localhost:5678/.","Confirm the setting took effect by checking the instance settings after restart."],"exampleFix":"# before: no WEBHOOK_URL set → getNodeWebhookUrl returns undefined → throws\n# after (env):\nexport WEBHOOK_URL=https://n8n.example.com/\n# then restart n8n.","handlingStrategy":"validation","validationCode":"const url = ctx.getNodeWebhookUrl('default');\nif (!url) throw new Error('Set WEBHOOK_URL env var so n8n knows its public webhook base');","typeGuard":"function webhookUrlIsConfigured(url: string | undefined): url is string {\n  return typeof url === 'string' && url.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Set WEBHOOK_URL to the externally reachable base URL on every n8n instance.","Configure reverse-proxy headers (X-Forwarded-Proto/Host) when behind a proxy.","For local dev, set WEBHOOK_URL=http://localhost:5678/.","Restart n8n after changing the env so the URL is re-read."],"tags":["chat-trigger","webhook","environment","configuration"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}