My workflows have api calls that pass my app’s workflow api endpoints as webhooks.
The problem is, when I deploy to live, I need to update the endpoint urls in my workflows to the live endpoint. But then, the development branch of my app no longer works during preview because the workflows are using the live workflow api endpoint urls. So how can I have the development branch workflows contain the development endpoint url, and the live branch workflows contain the live endpoint url?
workflow api endpoints
Can I make (body) your-webhook a dynamic field that contains the workflow api endpoint?
Yes you can.
Use the ‘isn’t live version’ function. As the name suggests, this returns a ‘yes’ when evaluated on any test environment, and returns a ‘no’ on your live version.
Your dynamic expression would look like this:
‘Isn’t live version: formatted as text’
Yes → https://app.photohero.ai/version-test/api/1.1/wf
No → https://app.photohero.ai/api/1.1/wf
Same as what @nico.dicagno said, but with some screens via this Twitter post if that helps you process the solution
Got it, made sure to include “formatted as text” condition. You guys are awesome, thanks!