How we can fetch the orchestrator environments dynamically?

Hi All,

I wanted to fetch the environments name (Dev, Test or Prod) where my processes are running. (Depending on that environment, I have to make it as a subject of the email).

For Ex:
“Dev - Process ABC”
“Test - Process ABC”
“Prod - Process ABC”

Note: I don’t want to use API’s, and I am not using config files.

Kindly help me with this.

BR,
NK

A very common technique is to define an Asset e.g. with Name: Environment and assign it a Marker like Dev, Test, Prod …

Hi @ppr ,

Getting an asset value from orchestrator would be Static value, but when I run the BOT, how will I be able to know which environment my BOT is running (dynamically) if I take the value from asset (which is static in this case)?

Asset is for cross checking the environment. But I need the dynamic environment where my process is running (can be either in Dev, Test or Prod).

BR,
NK

When the process is offered on a tenant / folder using an asset with name:

the set asset value (also think on linked assets) is constant, but different to the different environments.

Better you share more details on the setup.

Also have a look at the input arguments of a process which can also be exploited for marking the environment

1 Like

@Nitesh,

Easiest way I think would be passing the tenant through process arguments.

@ashokkarale ,

Can you please share the screenshot how we achieve this?

I believe you have different orchestrator / Tenant / Folder for each of these environments rite?

If you keep an asset name as “Environment” where the value is different in each of the environment and using the same while sending email should solve the problem rite??

Let me know if I am missing something here

1 Like

@Nitesh,

Declare an argument in Main.xaml of your bot for tenant name for example in_TenantName

Publish the package → Add Process → assign the argument value here as per tenant specific.

@sharazkm32 & @ppr & @ashokkarale

Yes, I have 3 different tenants/environments.

Say suppose, if I keep the asset name as Environment and the value as either Dev or Test Or Prod.
And if I run the BOT in Dev how will my process knows that it is running in Dev or if I run the BOT in Prod, how my process will come to know that it is Prod?

Hope now I make it clear.

BR,
NK

@Nitesh,

Bot will pick up the asset from the tenant your bot machine connected to. Your PROD bot will be connected to PROD tenant so bot will fetch asset from the tenant which would have value PROD. This way your bot will get to know which environment it is in.

1 Like

This can also be done via a custom activity. I am not sure if there are any on the Marketplace, I have one I development myself but my access to the marketplace is abit messed up so I cannot upload it.

As far as I know if cannot be converted out of an activity due to it needing the use reflection to gather information about the current robot runner.

Hi @Nitesh ,

Create assets in all the three environments
Environment = Dev
Environment = Test
Environment = Prod

Now in the studio
Use get asset activity
Use if conditon to check if the environment variable contains test or dev or prod and send the email accordingly
Also you can use switch case
Expression : Environment variable
Case “test”
Case “dev”
Case “prod “

@parvathi_ayanala & Thanks everyone for your kind support.

Thanks a lot. It worked. Below is the design.

BR,
NK

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.