Making OS call from workflows

Hi Team,

Curious to know whether is it acceptable to make some OS calls from workflows ? Few use-cases can be as below but not limited to:

  1. Accessing an env variable and using the same to upsert in search attribute.
    Further, given the value of the env variable can change over the time, I am planning to use sideffect here.
  2. Initiating a command using Exec(). Given maintaining idempotency in activity is complicated here, is it fine to perform command execution from workflow itself ? Again performing this via sideeffect to make sure singleton execution of the same.

Will these use-cases be considered an anti-pattern ?

Hello @nitesh237

for 1) I would use sideEffect or local activity, and if the returned value is null you might want to fail the workflow

for 2) I would local activity or normal activity. How long the command takes to be executed?

In general, any IO operations should be placed in activities


Assuming the command execution will be fire and forget kind, will it be ok ? Or activity route is the recommended way ?