UiPath Documentation
uipath-cli
latest
false
重要 :
请注意,此内容已使用机器翻译进行了本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

UiPath CLI 用户指南

UIP 流程节点和 UIP 流程边缘

流是一个图表。节点是端点(触发器、活动、连接器、智能体); Edge是它们之间的有向连接。uip flow nodeuip flow edge命令就地编辑.flow文件 — 添加、配置、列出和删除两者。

此页还涵盖以相同方式编辑.flow文件的三个附带命令组: variablevariable-updatebinding

大纲

uip flow node add       <file> <node-type> [-i <json>] [--position <x,y>] [--label <label>] [--source <uuid>]
uip flow node configure <file> <node-id> --detail <json>
uip flow node list      <file>
uip flow node delete    <file> <node-id>

uip flow edge add    <file> <source-id> <target-id> [--source-port <port>] [--target-port <port>]
uip flow edge list   <file>
uip flow edge delete <file> <edge-id>
uip flow node add       <file> <node-type> [-i <json>] [--position <x,y>] [--label <label>] [--source <uuid>]
uip flow node configure <file> <node-id> --detail <json>
uip flow node list      <file>
uip flow node delete    <file> <node-id>

uip flow edge add    <file> <source-id> <target-id> [--source-port <port>] [--target-port <port>]
uip flow edge list   <file>
uip flow edge delete <file> <edge-id>

使用全局选项。退出代码遵循标准合同


UIP 流节点添加

.flow文件添加节点。节点类型必须存在于注册表中 — 使用uip flow registry search发现有效的<node-type>值。

参数

  • <file> (必填).flow文件的路径。
  • <node-type> (必填项) — 节点类型标识符(例如core.trigger.manualuipath.connector.slack.send-message )。

选项

选项描述
-i, --input <json>要在节点上设置的输入值的 JSON 对象(例如'{"script":"…"}' )。必须为 JSON 对象,而不是数组或标量。对于连接器节点( uipath.connector.*类型),请勿在此处传递--input — 之后运行node configure
--position <x,y>画布位置,例如250,150 。x 和 y 都是必填数字。
--label <label>显示节点的标签。
--source <uuid>内联代理节点的源标识符(填充model.source )。

示例

uip flow node add invoice-flow.flow uipath.connector.slack.send-message --label "Notify team"
uip flow node add invoice-flow.flow uipath.connector.slack.send-message --label "Notify team"

Data shape (--output json)

{
  "Code": "NodeAddSuccess",
  "Data": {
    "Node": { "id": "node_a1b2c3d4", "type": "uipath.connector.slack.send-message" },
    "DefinitionAdded": true,
    "BindingsCreated": 0,
    "VariableCount": 0
  }
}
{
  "Code": "NodeAddSuccess",
  "Data": {
    "Node": { "id": "node_a1b2c3d4", "type": "uipath.connector.slack.send-message" },
    "DefinitionAdded": true,
    "BindingsCreated": 0,
    "VariableCount": 0
  }
}

在第一次插入给node-type DefinitionAdded时为true — 会创建.flow definitions[]中的相应条目。


UIP 流节点配置

在已添加的节点上填充inputs.detail并创建其所需的工作流绑定。在node add之后为连接器和托管 HTTP 节点运行此操作。

参数

  • <file> (必填).flow文件的路径。
  • <node-id> (必填) — 要配置的节点的 ID(使用node list查找)。

选项

  • --detail <json> (必填) — 配置 JSON。形状取决于节点类型:

连接器节点 (uipath.connector.*)

registry get输出中从connectorMethodInfo获取methodendpoint

  • 必需connectionIdfolderKeymethodendpoint
  • 可选bodyParametersqueryParameterspathParameters
uip flow node configure invoice-flow.flow node_a1b2c3d4 --detail '{
  "connectionId": "b2c3d4e5-0000-0000-0000-000000000001",
  "folderKey":    "c3d4e5f6-0000-0000-0000-000000000001",
  "method":       "POST",
  "endpoint":     "/issues",
  "bodyParameters": { "summary": "Bug" }
}'
uip flow node configure invoice-flow.flow node_a1b2c3d4 --detail '{
  "connectionId": "b2c3d4e5-0000-0000-0000-000000000001",
  "folderKey":    "c3d4e5f6-0000-0000-0000-000000000001",
  "method":       "POST",
  "endpoint":     "/issues",
  "bodyParameters": { "summary": "Bug" }
}'

托管 HTTP 节点 (core.action.http.v2)

两种身份验证模式:

连接器模式( authentication: "connector" ) — 使用 Integration Service 连接进行身份验证:

  • 必需authenticationmethodconnectionIdfolderKeytargetConnector
  • methodGETPOSTPUTPATCHDELETEOPTIONSHEAD
  • 可选url (路径附加到连接器基本 URL)、 headersquerybody
uip flow node configure invoice-flow.flow node_abc --detail '{
  "authentication":  "connector",
  "targetConnector": "uipath-microsoft-outlook365",
  "connectionId":    "…",
  "folderKey":       "…",
  "method":          "GET",
  "url":             "/me"
}'
uip flow node configure invoice-flow.flow node_abc --detail '{
  "authentication":  "connector",
  "targetConnector": "uipath-microsoft-outlook365",
  "connectionId":    "…",
  "folderKey":       "…",
  "method":          "GET",
  "url":             "/me"
}'

手动模式( authentication: "manual" ) — 无需连接器身份验证,请自行提供完整的 URL 和任何身份验证标头:

  • 必需authenticationmethodurl (完整 URL)
  • 可选headersquerybody (字符串;可以是表达式,例如=js:({…}) )。
uip flow node configure invoice-flow.flow node_abc --detail '{
  "authentication": "manual",
  "method":         "GET",
  "url":            "https://api.example.com/data",
  "headers":        { "Authorization": "Bearer <token>" }
}'
uip flow node configure invoice-flow.flow node_abc --detail '{
  "authentication": "manual",
  "method":         "GET",
  "url":            "https://api.example.com/data",
  "headers":        { "Authorization": "Bearer <token>" }
}'

Data shape (--output json)

{
  "Code": "NodeConfigureSuccess",
  "Data": {
    "NodeId": "node_a1b2c3d4",
    "BindingsCreated": 2,
    "DetailPopulated": true
  }
}
{
  "Code": "NodeConfigureSuccess",
  "Data": {
    "NodeId": "node_a1b2c3d4",
    "BindingsCreated": 2,
    "DetailPopulated": true
  }
}

UIP 流节点列表

列出.flow文件中的所有节点。

参数

  • <file> (必填).flow文件的路径。

Data shape (--output json)

{
  "Code": "NodeListSuccess",
  "Data": {
    "Nodes": [
      { "id": "start",          "type": "core.trigger.manual" },
      { "id": "node_a1b2c3d4",  "type": "core.action.http.v2" }
    ],
    "Count": 2
  }
}
{
  "Code": "NodeListSuccess",
  "Data": {
    "Nodes": [
      { "id": "start",          "type": "core.trigger.manual" },
      { "id": "node_a1b2c3d4",  "type": "core.action.http.v2" }
    ],
    "Count": 2
  }
}

每个条目至少包含idtype ;该服务还会附加.flow definitions[]数组中的显示元数据。


UIP 流节点删除

删除节点及其拥有的所有内容。移除:

  • 已连接的边线
  • 孤立绑定
  • 孤立定义
  • 已删除节点拥有的节点变量
  • 更新已删除节点拥有的变量

参数

  • <file> (必填).flow文件的路径。
  • <node-id> (必填) — 要删除的节点的 ID。

Data shape (--output json)

{
  "Code": "NodeDeleteSuccess",
  "Data": {
    "DeletedNode":           { "id": "node_a1b2c3d4", "type": "core.action.http.v2" },
    "EdgesRemoved":          1,
    "BindingsRemoved":       0,
    "DefinitionsRemoved":    0,
    "VariablesRemoved":      0,
    "VariableUpdatesRemoved": 0
  }
}
{
  "Code": "NodeDeleteSuccess",
  "Data": {
    "DeletedNode":           { "id": "node_a1b2c3d4", "type": "core.action.http.v2" },
    "EdgesRemoved":          1,
    "BindingsRemoved":       0,
    "DefinitionsRemoved":    0,
    "VariablesRemoved":      0,
    "VariableUpdatesRemoved": 0
  }
}

UIP 流边线添加

在两个节点之间添加边线。

参数

  • <file> (必填).flow文件的路径。
  • <source-id> (必填) — 源节点的 ID。
  • <target-id> (必填) — 目标节点的 ID。

选项

  • --source-port <port> — 源端口名称(默认值: output )。
  • --target-port <port> — 目标端口名称(默认: input )。

Data shape (--output json)

{
  "Code": "EdgeAddSuccess",
  "Data": {
    "Edge": {
      "id":         "edge_a1b2c3d4",
      "source":     "Node_1",
      "target":     "Node_2",
      "sourcePort": "output",
      "targetPort": "input"
    }
  }
}
{
  "Code": "EdgeAddSuccess",
  "Data": {
    "Edge": {
      "id":         "edge_a1b2c3d4",
      "source":     "Node_1",
      "target":     "Node_2",
      "sourcePort": "output",
      "targetPort": "input"
    }
  }
}

UIP 流边缘列表

{
  "Code": "EdgeListSuccess",
  "Data": {
    "Edges": [
      { "id": "edge_a1b2c3d4", "source": "Node_1", "target": "Node_2" }
    ],
    "Count": 1
  }
}
{
  "Code": "EdgeListSuccess",
  "Data": {
    "Edges": [
      { "id": "edge_a1b2c3d4", "source": "Node_1", "target": "Node_2" }
    ],
    "Count": 1
  }
}

UIP 流边线删除

按 ID 删除单条边线。使用edge list查找 ID。

{
  "Code": "EdgeDeleteSuccess",
  "Data": {
    "DeletedEdge": { "id": "edge_a1b2c3d4", "source": "Node_1", "target": "Node_2" }
  }
}
{
  "Code": "EdgeDeleteSuccess",
  "Data": {
    "DeletedEdge": { "id": "edge_a1b2c3d4", "source": "Node_1", "target": "Node_2" }
  }
}

变量和变量更新

两个附带命令组(尚未在侧边栏中)编辑.flow文件的variables和变量更新子树。

UIP 流变量

uip flow variable add    <file> <variable-id> -d <direction> [-t <type>] [--default-value <val>] [--description <text>] [--schema <json>] [--sub-type <type>]
uip flow variable list   <file>
uip flow variable delete <file> <variable-id>
uip flow variable add    <file> <variable-id> -d <direction> [-t <type>] [--default-value <val>] [--description <text>] [--schema <json>] [--sub-type <type>]
uip flow variable list   <file>
uip flow variable delete <file> <variable-id>
  • directioninoutinout (必填项)。
  • typestringnumberbooleanobjectarrayfile (默认为string )。
  • --default-value的解析方式为--typeobject array的值必须是匹配形状的有效 JSON。
  • --schema必须是 JSON 对象(例如'{"type":"string"}' )。

数据形状: VariableAddSuccessData.Variable )、 VariableListSuccessData.Variables[]Count )、 VariableDeleteSuccessData.DeletedVariable )。

uip 流变量更新

将 JS 表达式附加到完成时运行的节点,并赋值给全局变量(必须为outinout )。

uip flow variable-update add    <file> --node-id <id> --variable-id <id> --expression <expr>
uip flow variable-update list   <file> [--node-id <id>]
uip flow variable-update delete <file> <node-id> <variable-id>
uip flow variable-update add    <file> --node-id <id> --variable-id <id> --expression <expr>
uip flow variable-update list   <file> [--node-id <id>]
uip flow variable-update delete <file> <node-id> <variable-id>

如果表达式缺失,系统会自动使用=js:为其添加前缀。示例: --expression "=js:ctx.output"

数据形状: VariableUpdateAddSuccessData.VariableUpdate )、 VariableUpdateListSuccessData.VariableUpdates[]Count )、 VariableUpdateDeleteSuccessData.DeletedUpdate )。


Bindings

绑定声明了流在发布/部署时所需的外部资源(目标流程、智能体、连接、队列等),以及它们连接到的节点属性。

uip flow binding add    <file> <name> <resource> <default-value> [--resource-key <key>] [--property-attribute <attr>] [--resource-sub-type <type>]
uip flow binding list   <file>
uip flow binding delete <file> <resource-key>
uip flow binding add    <file> <name> <resource> <default-value> [--resource-key <key>] [--property-attribute <attr>] [--resource-sub-type <type>]
uip flow binding list   <file>
uip flow binding delete <file> <resource-key>
  • <resource>必须是服务的其中一个VALID_RESOURCE_TYPES (如果传递的值无效,则在add命令的错误消息中显示)。
  • --property-attribute是绑定填充的目标节点属性(例如namefolderPathconnection )。
  • --resource-sub-type提供子分类(例如AgentProcess )。
  • binding delete根据给定资源密钥删除所有绑定,而非按 ID 删除单个条目。

数据形状: BindingAddSuccessData.Binding )、 BindingListSuccessData.Bindings[]Count )、 BindingDeleteSuccessData.DeletedBindings[]Count )。


UIP 流整洁

自动布局:重新定位.flow文件中的节点,以删除重叠并清晰地排列图表。

uip flow tidy <file>
uip flow tidy <file>

数据形状: Code: "FlowTidy"Data: { File, NodesTotal, EdgesTotal, NodesRepositioned }

另请参阅

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新