Calling workflow from another workflow as a job in powershell

对着背影说爱祢 提交于 2020-07-19 11:10:34

问题


I have to call a long running workflow from another workflow asynchronously. Is there a way to do that in powershell?

workflow CalledWorkflow
{
    Start-Sleep -s 100;
}
workflow CallingWorkflow
{
   CalledWorkflow
   "CalledWorkFlow Invoked"
}

Now when i call

CallingWorkflow

I need the callingworkflow to immediately return printing "CalledWorkflow Invoked" so that i can start continue my work while the calledworkflow is running in backgroud.


回答1:


What environment are you running the workflows in? In Azure Automation, you can accomplish this by starting a new job from within CallingWorkflow:

workflow CallingWorkFlow
{
  Start-AzureAutomationRunbook -Name CalledWorkflow -Parameters ...
  "CalledWorkFlow Invoked"
}

(Or Start-AzureRMAutomationRunbook for the RM version of the command).

I imagine you can do something similar in SMA, etc.



来源:https://stackoverflow.com/questions/31103544/calling-workflow-from-another-workflow-as-a-job-in-powershell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!