Specify workflow environment when called from another workflow

We are using Retool via Cloud. I have 2 environments: production and staging. I have 2 workflows: parentWorkflow is executed via webhook or manual trigger, and manually triggers a second workflow childWorkflow. When parentWorkflow kicks off childWorkflow, I want to be able to specify the environment that childWorkflow will run in.

Two use cases:

  1. I use workflows to test other workflows. For instance, I’ll have a CSV of scenarios that the test workflow will load up, and then it’ll run the “workflow under test” using each scenario. I want to be able to do this using production data and staging data.
  2. When Salesforce makes call to Retool workflow webhook, it can either come from our production instance or our staging instance. I know that I can set environment in the url (eg ?environment=production and that does work. However, when a staging instance of Salesforce are made, it copies the production url into staging. So we have to manually clean that up every time.

I have tried specifying ”environment”: “staging” in the raw parameters when calling the workflow, and it didn’t work.

What I did not try, and maybe I will now – create a new “REST API” resource that sends request to childWorkflow webhook url, and specify the environment there. I guess in theory that should work. Haven’t tried it though.

Hi @lkiss!

Let us know how the REST API approach works, I think you might be on to something there.

I was going to ask if you wanted a feature request for this or if you were asking if anyone else in the community had been able to accomplish having a parent workflow in one environment call a child workflow in a different environment based on parameters passed between the two :sweat_smile:

I have a feeling the REST API approach would work. I didn’t end up going this route though, so I didn’t prove it out.

For testing workflows, I forgot that I can have a single test workflow, with a different schedule per environment. So I think I’m fine there.

For Salesforce → Retool webhook – my salesforce developer didn’t seem all that bothered by having to update the retool environment being used, when new sandboxes are created.

Would I like to see this working – Absolutely!! Would be at the top of my list of features for your team to work on, probably not. Thanks for circling back on this.

1 Like

Thank you for the details!

Yep being able to have a different scheduler per workflow is super useful for testing cases like these.

Glad to hear the salesforce env updates are not too cumbersome.