CORS Error when running FORMS in test mode with seperate Webhook URL

Describe the problem/error/question:

I have the main node and webhook node on two separate URLs:

https://n8n.mydomain.com
https://hook.n8n.mydomain.com

When running a workflow in Test mode that involves a Form trigger and subsequent Next Form or End Form response, I receive a CORS error.

Mainly, my initial form trigger (in test mode) launches on the main node via https://n8n.mydomain.com/form-test/formname but then after submitting the form and attempting to process the next form or end form nodes it redirects me to the webhook URL e.g. https://hook.n8n.mydomain.com/form-waiting/1343596/n8n-execution-status

Since the hook. subdomain is not responding with an Access-Control-Allow-Origin header permitting the main node domain as an origin, it fails to load.

I cannot locate any valid options to control CORS via n8n, despite many references throughout the community forums related to variable environment variables to be set, none of them seem to be officially documented or working. In my deployment I do not have the ability to append any response headers through a reverse proxy either unfortunately as a workaround.

What is the error message (if any)?

Access to fetch at ‘https://hook.n8n.mydomain.com/form-waiting/1338041/n8n-execution-status’ from origin ‘https://n8n.mydomain.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Information on your n8n setup

  • n8n version: 1.109.2
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): queue
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system:

It would be good if anyone else has any tips, but from my research it appears that this is expected and the best solution is to host them under the same sub-domain.. :confused:

I was worried about that. We just went through a bunch of work to move the webhook domain to a seperate sub-domain for some networking requirements just to be faced with this issue now.

I’m also facing the same issue and setting N8N_CORS_ALLOW_ORIGIN=* on the webhook nodes does not seem to do anything.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.