Specify which environment to run from a client by webhook

I have a workflow that is activated through a webhook and I need to specify from a client which environment I want it to run, test, prod or staging.
This is possible? maybe some parameter in the url?

1 Like

Maybe a different endpoint?

Hey @zeroray! Hmm, I think the best way to do this would be to have different Workflows (one for each environment) and then just you can just trigger the Workflow you want.

How would you ideally like to pass in the environment?

I see some ways, for example, when the user changes the environment.


Each environment has its own endpoint, so manage these endpoints from the client.

Another option is to use query parameters, https://....../id-workflow?environment=production|testing|staging

Another option is to use headers.

Currently the running environment is that I leave it set before exiting workflows which is very error prone.

Got it, thank you for clarifying! I'll add this to the ticket and keep you updated :+1:

In the meantime, the best workaround would definitely be to create separate Workflows (to each hit production vs staging vs testing data) and trigger each one depending on which environment you want.


@zeroray Circling back to cross-reference this post mentioning that the ?environment=staging / ?environment=production parameter has been implemented. For Cloud this was released June 16th with this changelog note in that Cloud release:

  • Added support for specifying the environment to use for webhook-triggered workflows.

For self-hosted, this is available for folks on version 3.4.2 with a feature flag enabled (would need to reach out to us to turn it on) and it will be generally available on self-hosted later this month, targeting v3.8.0!

Specifying environment to use for webhook-triggered workflows is now available on self-hosted version 3.8.0 and up, in addition to being available on Cloud as mentioned above :rocket: