Objective/Scenario:
You are trying to ping your Tray webhooks via your browser, perhaps using the JavaScript fetch function. However, the workflow is never triggered, and your browser receives an error containing a message similar to: "Access ... has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource ..."
Solution:
First, please ensure you have the enabled the flag/checkbox "Allow webhooks from browsers" in your webhook connector, as instructed in our docs
As noted there, this flag should automatically add the following three headers to the webhook response:
Access-Control-Allow-Origin
Access-Control-Allow-Headers
Access-Control-Allow-Method
However, there are times when the origin has stricter requirements, and the error is still returned even though the flag is enabled. In these cases, you may need to explicitly define Access-Control headers in your trigger-reply, as shown below:
Also note that to use the trigger-reply, your webhook will need to use an operation such as "Await workflow and respond"
Comments
0 comments
Please sign in to leave a comment.