Hi, I’m not very technical but I’m trying to embed an n8n chatbot into my Shopify store. I’ve tried several proxy setups to securely send messages to my n8n workflow, but I keep running into errors and can’t get the integration to work. Here’s what I’ve tried so far:
Summary of Solutions Attempted (Embed/Proxy Issue)
Goal:
Embed an n8n-powered chatbot into my Shopify store using a secure proxy that injects an Authorization header, so my API key isn’t exposed client-side. I need to make POST requests from the Shopify frontend (iframe or AJAX) to n8n’s /chat
endpoint.
Solutions Tried and Outcomes:
- Direct n8n API call from Shopify frontend
- Result: Not possible, as exposing the API key to the browser is insecure and leads to CORS/auth problems.
- Supabase Edge Function as Proxy
- Set up an Edge Function to forward requests and add the Authorization header using an env variable.
- Tried both CLI and Web UI deployments.
- Result: All deployments returned a static
{"code":401,"message":"Missing authorization header"}
error, no matter what code was deployed. Function code was not being updated or executed. (Suspected platform bug or cache issue, already escalated to Supabase support.)
- Cloudflare Pages as Proxy
- Attempted to use Cloudflare Pages to proxy requests and inject headers.
- Result: Not viable, since Pages only supports static sites (no serverless code execution).
- Cloudflare Workers as Proxy (RECOMMENDED SETUP)
- Created a Worker to accept POST requests, add the Authorization header from a secret, and forward to n8n
/chat
. - Worker GET test worked fine (“Cloudflare Worker is running!”).
- POST requests from curl to the Worker resulted in a 500 Internal Server Error from n8n.
- Debugging revealed: The error is NOT from the Worker (proxy), but from n8n itself—direct POST to the n8n
/chat
endpoint also returns 500 Internal Server Error. - Conclusion: The Worker is correctly proxying requests, but n8n returns 500s for all POSTs (even with correct Authorization).
- Checked n8n Execution History
- Found that some executions were successful, but current POST attempts still result in 500 errors.
- Not sure if the issue is with request format, webhook node settings, or internal n8n logic.
Current State:
- Proxying through Cloudflare Worker is working as intended (GET works, POST is forwarded).
- All POST requests to n8n
/chat
return 500 Internal Server Error, even when called directly via curl with the correct API key and JSON. - Suspect the issue is either with:
- n8n webhook node configuration (method, payload shape),
- workflow logic error,
- or something environmental in n8n.
What I’m Asking:
- Has anyone successfully embedded an n8n chatbot in Shopify (or any frontend) using a secure proxy for header injection?
- What is the best way to configure the webhook node and workflow to avoid 500 errors on POST?
- Any known pitfalls with n8n’s handling of webhook payloads, headers, or authentication that might cause this?
Happy to provide code snippets, workflow exports, or logs if helpful!