成功(succeed)节点
更新时间:2024-07-05
概述
succeed 节点用于标记工作流已执行成功,并结束整个工作流的执行。它通常会跟 switch 节点结合使用,在 switch 节点判断某个条件已满足的情况下跳转到 succeed 节点,结束执行。
参数
以下为 succeed 节点所包含的参数字段:
字段 | 类型 | 描述 |
---|---|---|
type(必需) | string | 节点类型,值为 "succeed" |
name(必需) | string | 节点名称 |
description(可选) | string | 节点描述信息 |
succeed 节点已内含了结束执行,因此不允许再指定 next
或 end
参数。
示例
示例工作流定义如下,读取节点输入数据中的 .ready 字段值,读取 ".ready" 的值,若为 "yes" 则跳到成功节点、结束执行,若为 "no" 则执行其它节点继续等待10秒钟。
YAML
1name: demo
2start: checkReady
3states:
4 - type: switch
5 name: checkReady
6 conditions:
7 - condition: .ready == "yes"
8 next: handleReady
9 - condition: .ready == "no"
10 next: handleNotReady
11 default:
12 next: handleReady
13 - type: wait
14 name: handleNotReady
15 seconds: 10
16 end: true
17 - type: succeed
18 name: handleReady