Development vs Live Workflow API Endpoint

My workflows have api calls that pass my app’s workflow api endpoints as webhooks.

image

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
development: https://app.photohero.ai/version-test/api/1.1/wf
live: https://app.photohero.ai/api/1.1/wf

Can I make (body) your-webhook a dynamic field that contains the workflow api endpoint?

Yes :slight_smile: 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

3 Likes

Same as what @nico.dicagno said, but with some screens via this Twitter post if that helps you process the solution

https://x.com/marinatrajk/status/1745857819654463868?s=20

1 Like

Got it, made sure to include “formatted as text” condition. You guys are awesome, thanks!

1 Like