从另一个工作流调用工作流作为PowerShell中的作业 [英] Calling workflow from another workflow as a job in powershell

查看:86
本文介绍了从另一个工作流调用工作流作为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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆