UiPath CLI 用户指南
uip flow instance检查和控制单个流程实例— 已发布的 Flow 流程的一次执行。即使侧边栏条目显示为instances ,命令名称也为单数 ( instance )。
大纲
uip flow instance list <instance-id> -f <folder-key> [-l <limit>] [--offset <n>] [--process-key <k>] [--package-id <id>] [--error-code <code>]
uip flow instance get <instance-id> -f <folder-key>
uip flow instance pause <instance-id> -f <folder-key> [--comment <text>]
uip flow instance resume <instance-id> -f <folder-key> [--comment <text>]
uip flow instance cancel <instance-id> -f <folder-key> [--comment <text>]
uip flow instance retry <instance-id> -f <folder-key> [--comment <text>]
uip flow instance migrate <instance-id> <new-version> -f <folder-key> [--comment <text>]
uip flow instance variables <instance-id> -f <folder-key> [--parent-element-id <id>]
uip flow instance incidents <instance-id> -f <folder-key>
uip flow instance asset <instance-id> -f <folder-key>
uip flow instance cursors <instance-id> -f <folder-key>
uip flow instance goto <instance-id> <transitions> -f <folder-key>
uip flow instance element-executions <instance-id> -f <folder-key>
uip flow instance list <instance-id> -f <folder-key> [-l <limit>] [--offset <n>] [--process-key <k>] [--package-id <id>] [--error-code <code>]
uip flow instance get <instance-id> -f <folder-key>
uip flow instance pause <instance-id> -f <folder-key> [--comment <text>]
uip flow instance resume <instance-id> -f <folder-key> [--comment <text>]
uip flow instance cancel <instance-id> -f <folder-key> [--comment <text>]
uip flow instance retry <instance-id> -f <folder-key> [--comment <text>]
uip flow instance migrate <instance-id> <new-version> -f <folder-key> [--comment <text>]
uip flow instance variables <instance-id> -f <folder-key> [--parent-element-id <id>]
uip flow instance incidents <instance-id> -f <folder-key>
uip flow instance asset <instance-id> -f <folder-key>
uip flow instance cursors <instance-id> -f <folder-key>
uip flow instance goto <instance-id> <transitions> -f <folder-key>
uip flow instance element-executions <instance-id> -f <folder-key>
每个子命令都需要-f, --folder-key <key> 。
常见选项
-f, --folder-key <key>(必填) — 文件夹密钥 (GUID)。--comment <text>(仅限操作命令) — 与操作一起记录的可选注释。如果省略,则作为空字符串发送。
子命令
UIP 流实例列表
列出文件夹中定义为 Flow 流程 ( processType=Flow ) 的实例。
选项
| 选项 | 默认 | 描述 |
|---|---|---|
-l, --limit <n> | DEFAULT_PAGE_SIZE | 要返回的项目数 (1-10000)。 |
--offset <n> | 0 | 要跳过的项目数 (0-1000000)。 |
--process-key <k> | — | 按流程键值筛选。 |
--package-id <id> | — | 按包 ID 筛选。 |
--error-code <code> | — | 按错误代码筛选。 |
数据形状
Code: "InstanceList", Data is an array of process-instance objects.
获取 UIP 流实例
按 ID 获取单个实例。
数据形状: Code: "InstanceGet" , Data是流程实例对象。
UIP 流实例暂停
暂停正在运行的实例。数据形状: Code: "InstancePaused" 。
UIP 流实例恢复
恢复已暂停的实例。数据形状: Code: "InstanceResumed" 。
UIP 流实例取消
取消正在运行的实例。数据形状: Code: "InstanceCanceled" 。
uip 流实例重试
重试发生故障的实例。数据形状: Code: "InstanceRetried" 。
UIP 流实例迁移
将实例迁移到其他包版本。
参数: <instance-id> 、 <new-version> (目标包版本)。
数据形状: Code: "InstanceMigrated" 。
UIP 流实例变量
获取实例的变量。
选项: --parent-element-id <id> — 按父元素筛选变量。
数据形状: Code: "InstanceVariables" , Data包含实例变量有效负载。
UIP 流实例事件
获取特定实例的事件。
数据形状: Code: "InstanceIncidents" , Data是事件对象数组。
UIP 流实例资产
获取附加到此实例版本的流程定义( .flow资产)— 在调试以查看实例运行的确切图表时非常有用。
数据形状: Code: "InstanceAsset" , Data是流 JSON。
UIP 流程实例光标
获取当前执行光标位置 — 实例暂停的元素。
数据形状: Code: "InstanceCursors" 、 Data列出当前光标位置。
UIP 流实例转到位置
将执行光标从一个元素移动到另一个元素。可用于通过跳过或重试特定节点来恢复发生故障的实例。
参数
<instance-id>(必填项)<transitions>(必填) — 转换的 JSON 数组,每个转换都包含sourceElementId和targetElementId。
uip flow instance goto c3d4e5f6-… \
'[{"sourceElementId":"Node_1","targetElementId":"Node_3"}]' \
--folder-key c3d4e5f6-…
uip flow instance goto c3d4e5f6-… \
'[{"sourceElementId":"Node_1","targetElementId":"Node_3"}]' \
--folder-key c3d4e5f6-…
在调用 API 之前,CLI 验证 JSON 解析,并且每个条目都具有两个 ID。
数据形状
Code: "InstanceGoto"。
uip 流实例元素执行
获取实例每个元素的执行历史记录(运行了哪些内容、何时运行以及结果如何)。
数据形状
Code: "InstanceElementExecutions", Data is the per-element execution history.
示例
# Paginate through instances for a specific process
uip flow instance list --folder-key <k> --process-key "InvoiceFlow.flow.Flow:1.0.0" --limit 50
# Pause, fix, resume
uip flow instance pause <id> --folder-key <k> --comment "Investigating"
uip flow instance resume <id> --folder-key <k>
# Skip a faulted node by moving the cursor forward, then retry
uip flow instance cursors <id> --folder-key <k>
uip flow instance goto <id> '[{"sourceElementId":"A","targetElementId":"C"}]' --folder-key <k>
uip flow instance retry <id> --folder-key <k>
# Upgrade a long-running instance to a new package version
uip flow instance migrate <id> "1.2.0" --folder-key <k> --comment "Patch release"
# Paginate through instances for a specific process
uip flow instance list --folder-key <k> --process-key "InvoiceFlow.flow.Flow:1.0.0" --limit 50
# Pause, fix, resume
uip flow instance pause <id> --folder-key <k> --comment "Investigating"
uip flow instance resume <id> --folder-key <k>
# Skip a faulted node by moving the cursor forward, then retry
uip flow instance cursors <id> --folder-key <k>
uip flow instance goto <id> '[{"sourceElementId":"A","targetElementId":"C"}]' --folder-key <k>
uip flow instance retry <id> --folder-key <k>
# Upgrade a long-running instance to a new package version
uip flow instance migrate <id> "1.2.0" --folder-key <k> --comment "Patch release"
另请参阅
uip flow incidents— 读取从特定实例分离的事件uip flow job— 实例运行的作业视图uip flow process— 启动新实例- Orchestrator 作业
- 流概述