本文介绍了如何通过控制台和命令行工具停止执行。
使用控制台停止执行
- 登录云工作流控制台。
- 在流程页面,选择要查看的流程。
- 在流程详情页面,选择要查看的执行。
- 在执行详情页面,单击停止执行,并在停止执行的提示框中单击确定,停止正在运行的执行。停止后,执行处于已终止状态。
说明 如果执行已经结束,则停止执行会返回错误。
使用命令行工具停止执行
- 您可以通过以下命令停止执行。
aliyun fnf StopExecution --FlowName cli_guide_1 --ExecutionName run2 --Error Cancel --Cause "execution is not needed"
预期输出:
{ "Name": "run2", "FlowName": "cli_guide_1", "FlowDefinition": "version: v1\ntype: flow\nsteps:\n - type: pass\n name: pass1", "Input": "", "Output": "", "Status": "Running", "StartedTime": "2019-06-24T22:00:30.365Z", "StoppedTime": "2019-06-24T22:00:32.862Z", "RequestId": "xxxx" }
- 停止执行后,您可以通过以下命令查看执行。执行状态处于Stopped状态。
aliyun fnf DescribeExecution --FlowName cli_guide_1 --ExecutionName run2
预期输出:
{ "Name": "run2", "FlowName": "cli_guide_1", "FlowDefinition": "version: v1\ntype: flow\nsteps:\n - type: pass\n name: pass1", "Input": "", "Output": "", "Status": "Stopped", "StartedTime": "2019-06-24T22:00:30.365Z", "StoppedTime": "2019-06-24T22:00:32.866Z", "RequestId": "xxxx" }