uipath-cli
latest
false
UiPath CLI 用户指南
重要 :
请注意,此内容已使用机器翻译进行了本地化。
新发布内容的本地化可能需要 1-2 周的时间才能完成。
“uip api-workflow run”的语法和选项,用于使用捆绑的 Serverless 工作流执行程序在本地执行 API 工作流 JSON 文件。
uip api-workflow run使用捆绑的 Serverless 工作流执行程序在本地执行 API 工作流 JSON 文件。输入参数以 JSON 形式传递。默认情况下,执行程序从uip login会话加载 UiPath 凭据,以便工作流可以访问连接器和云支持的服务;传递--no-auth以跳过凭据加载并以仅本地模式运行。
大纲
uip api-workflow run <file> [options]
uip api-workflow run <file> [options]
<file>— 工作流 JSON 文件的路径。
选项
| 标记 | 描述 |
|---|---|
-i, --input-arguments <json> | 以 JSON 字符串形式运行的输入参数,例如'{"name": "World"}' 。 |
--input-file <name=path> | 上传本地文件并将其作为文件 (JobAttachment) 输入 <name> 传递。可重复用于多个文件。需要登录会话。 |
--output-dir <dir> | 将工作流输出中的每个文件 (JobAttachment) 引用下载到 <dir> 中;每个下载的参考都会获得一个 LocalPath。需要登录会话。 |
--folder-key <guid> | 此运行创建的附件(由文件到 Base64/Base64 到文件活动写入的上传的输入和文件)的 Orchestrator 文件夹密钥。 |
--no-auth | 跳过凭据加载。工作流在仅本地模式下运行,无法访问连接器或云支持的服务(同时禁用 --input-file/--output-dir)。 |
示例
# Run with an inline input object
uip api-workflow run ./workflow.json \
--input-arguments '{"name":"World"}'
# Run without loading credentials (offline / local-only)
uip api-workflow run ./workflow.json --no-auth
# Extract just the output payload
uip api-workflow run ./workflow.json \
--input-arguments '{"name":"World"}' \
--output-filter 'Data.Output'
# Upload a local file as a file (JobAttachment) input, and download any file
# outputs the workflow produces
uip api-workflow run ./workflow.json \
--input-file document=./invoice.pdf \
--output-dir ./out
# Run with an inline input object
uip api-workflow run ./workflow.json \
--input-arguments '{"name":"World"}'
# Run without loading credentials (offline / local-only)
uip api-workflow run ./workflow.json --no-auth
# Extract just the output payload
uip api-workflow run ./workflow.json \
--input-arguments '{"name":"World"}' \
--output-filter 'Data.Output'
# Upload a local file as a file (JobAttachment) input, and download any file
# outputs the workflow produces
uip api-workflow run ./workflow.json \
--input-file document=./invoice.pdf \
--output-dir ./out
数据形状(--输出 json)
{
"Code": "WorkflowRun",
"Data": {
"Status": "Completed",
"Output": {
"greeting": "Hello, World!"
}
}
}
{
"Code": "WorkflowRun",
"Data": {
"Status": "Completed",
"Output": {
"greeting": "Hello, World!"
}
}
}
Status反映执行程序的终止状态( Completed 、 Faulted等)。根据标准退出代码,发生故障的运行会以非零退出。
当工作流输出包含文件 (JobAttachment) 引用并设置了 --output-dir 时,形状会以下载的文件为中心:
{
"Code": "WorkflowRun",
"Data": {
"Encoded": {
"Id": "6f1c0d2e-8a1b-4c3d-9e0f-123456789abc",
"FullName": "invoice.base64",
"MimeType": "text/plain",
"LocalPath": "/abs/path/out/invoice.base64"
}
}
}
{
"Code": "WorkflowRun",
"Data": {
"Encoded": {
"Id": "6f1c0d2e-8a1b-4c3d-9e0f-123456789abc",
"FullName": "invoice.base64",
"MimeType": "text/plain",
"LocalPath": "/abs/path/out/invoice.base64"
}
}
}
仅在设置了 LocalPath 时,系统才会填充 --output-dir — 如果没有设置,返回的引用将不会返回本地文件。
相关内容
- uip api-workflow Build — 在运行项目之前对其进行编译。
- uip api-workflow pack — 打包经过验证的工作流,以进行发布。
另请参阅
- API 工作流工具概述
- 全局选项
- 退出代码
uip login— 凭据将由run加载,除非设置了--no-auth。