Hi, i’m trying to call an external API with Logic, it works perfectly from the designer, but when i deploy the web and i execute it raises a CORS policy error between my web (on webflow) and the webflow/api
By “external API” do you mean a 3rd party API, or the Webflow API itself?
It’s not possible to connect to the Webflow API from Logic.
CORS works on the basis of domain origin and comparisons, so it’s not a surprise that you’re getting a different response from your workbai.com site. However if you’re using a 3rd party API you’ll need to check their CORS setup.
The scenario has all kinds of funkiness around it;
First, from the error it looks as though the request is being made to Webflow’s API. But you say that this happens when you’re calling a 3rd party API. Can you share your project readonly link? Is your flow form triggered?
Second, the weirdness around XMLHttpRequest and CORS… I might need to unpack that further. Even if Webflow is rendering & publishing the Logic flow code directly into your hosted site, it should be handled as a server-to-server call and CORS would not be in play. Yet for some reason Webflow’s own API is CORS blocking Logic, which suggests that Logic’s mechanism for making API calls is triggering CORS verification. That would cause problems with nearly every API.
I have a slight suspicion that Webflow has changed something in the past week or two that has unintentionally worsened this issue, because I’ve seen a few posts recently indicating that certain Logic flows work in the designer, but begin failing when they are pushed to production. I haven’t seen specific errors mentioned, but… spidey-sense is tingling.
Wait!
Theory time. I think you’re using a form to trigger the Logic flow, and that Webflow’s anti-SPAM team is tightening the form submission channel by using CORS to lock down the submission endpoints. I think a recent adjustment is probably blocking Logic too.
If my guess is right, your call isn’t getting past the form submit, and the flow likely isn’t getting executed at all. Are you seeing the error client-side or in your flow execution history?
Either way, this is one for the support team, have you contacted Webflow yet?