Default workflow environment not being used

When I deploy a workflow with a webhook trigger for a selected environment, this is not the environment that is necessarily executed when the trigger is called.

Steps to reproduce:

  • Create a simple workflow containing a webhook trigger and a webhook return which returns the executed environment as part of its payload, e.g. { env: workflowContext.environment } (see attached screenshot)
  • Ensure the webhook is enabled and deploy the workflow to an enrivonment
  • Call the webhook's URL (e.g. using postman) - the executed environment is returned
  • Change the environment for the workflow and redeploy it
  • Call the webhook's URL again - the returned executed environment is unchanged - I expected it to be the new deployment environment (i.e. doesn't match what you deployed it as)

I realise you can override which environment is used by setting the environment query param in the webhook request (e.g. environment=production) and maybe my expectations are not correct around this feature but it seems like it should be clear(er) what the default environment is for a workflow when this param is not supplied.

@CWhite Update: I confirmed with the Workflows eng team that this isn't a bug - The webhook trigger has a specified default environment that can be configured. (see screenshot) Your comment here initially seemed related to a separate bug but I was mistaken on that.

When a workflow is calling another workflow, the child workflow will run in the same environment that the parent workflow is running in (which could be different from the environment the parent workflow was deployed in, for example if passing in a different environment in the webhook url).

This part of your original post may be the key here!

maybe my expectations are not correct around this feature but it seems like it should be clear(er) what the default environment is for a workflow when this param is not supplied.

I've conveyed this feedback internally and can keep you updated here if we release updates to make this a bit clearer! Thank you for surfacing :bow: