简体   繁体   中英

Calling workflow from another workflow as a job in powershell

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM