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