从另一个工作流调用工作流作为PowerShell中的作业 [英] Calling workflow from another workflow as a job in powershell
问题描述
我必须从另一个工作流异步调用一个长时间运行的工作流.有没有办法在 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"
}
现在当我打电话
CallingWorkflow
我需要调用工作流立即返回打印CalledWorkflow调用"以便我可以在被调用的工作流在后台运行时开始继续我的工作.
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.
推荐答案
您在什么环境中运行工作流?在 Azure 自动化中,您可以通过从 CallingWorkflow 中启动新作业来完成此操作:
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"
}
(对于 RM 版本的命令,或者 Start-AzureRMAutomationRunbook).
(Or Start-AzureRMAutomationRunbook for the RM version of the command).
我想你可以在 SMA 等中做类似的事情.
I imagine you can do something similar in SMA, etc.
这篇关于从另一个工作流调用工作流作为PowerShell中的作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!