robot
2026.10
false
机器人管理员指南
- 关于本指南
- 入门指南
- 正在安装
- 升级
- Connecting and licensing
- 配置
- Running workloads
- RPA processes and tests
- Agents, functions, and API workflows
- Limits
- Securing and governing
- 监控
- 故障排除
- 参考
机器人 API
通过本地作业管理和特定于领域的界面扩展机器人功能。
UiPath 机器人 API 是旨在扩展您自己机器人功能的组件。它具有多个特征,每个特征均针对自动化管理的特定方面。这些特征包括:
- 单项作业管理:提供运行、停止和跟踪个人自动化流程的功能。
- 特定领域接口:允许开发定制接口,以满足独特的自动化需求。
- 本地可访问性:仅在安装了机器人的计算机上可用,确保安全且直接访问。
- 版本兼容性:与已安装机器人的版本保持一致,从而实现向后兼容。
Robot API uses the UiPath.Robot.Api library. Use the following feed to download the library:
https://pkgs.uipath.com/official/index.json
https://pkgs.uipath.com/official/index.json
兼容性矩阵
| 机器人版本 | API 2026.10.x | API 2025.10.x | API 2024.10.x | API 2023.10.x | API 2023.4.x | API 2022.10.x | API 2022.4.x | API 2021.10.x |
|---|---|---|---|---|---|---|---|---|
| Robot 2026.10.x | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Robot 2025.10.x | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Robot 2024.10.x | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Robot 2023.10.x | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Robot 2023.4.x | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |
| Robot 2022.10.x | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ |
| Robot 2022.4.x | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ |
| Robot 2021.10.x | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
常见机器人 API 调用
- 将客户端纳入您的应用程序中
var client = new RobotClient();var client = new RobotClient(); - 获取可用流程的列表
var processes = await client.GetProcesses(); var myProcess = processes.Single(process => process.Name == "MyProcess"); var job = myProcess.ToJob();var processes = await client.GetProcesses(); var myProcess = processes.Single(process => process.Name == "MyProcess"); var job = myProcess.ToJob(); - 使用流程键开始作业
var job = new Job("812e908a-7609-4b81-86db-73e3c1438be4");var job = new Job("812e908a-7609-4b81-86db-73e3c1438be4"); - 开始流程执行
try { await client.RunJob(job); } catch (Exception ex) { Console.WriteLine(ex.ToString()); }try { await client.RunJob(job); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } - 添加输入参数
job.InputArguments = new Dictionary<string, object> { ["numbers"] = new int[] { 1, 2, 3 } }; await client.RunJob(job);job.InputArguments = new Dictionary<string, object> { ["numbers"] = new int[] { 1, 2, 3 } }; await client.RunJob(job); - 导出输出参数
var jobOutput = await client.RunJob(job); Console.WriteLine(jobOutput.Arguments["sumOfNumbers"]);var jobOutput = await client.RunJob(job); Console.WriteLine(jobOutput.Arguments["sumOfNumbers"]); - 停止流程
await client.RunJob(job, cancellationToken);await client.RunJob(job, cancellationToken); - 监控流程状态
job.StatusChanged += (sender, args) => Console.WriteLine($"{((Job)sender).ProcessKey}: {args.Status}"); await client.RunJob(job);job.StatusChanged += (sender, args) => Console.WriteLine($"{((Job)sender).ProcessKey}: {args.Status}"); await client.RunJob(job); - 使用事件调度程序
new RobotClient(new RobotClientSettings { EventScheduler = TaskScheduler.Default })new RobotClient(new RobotClientSettings { EventScheduler = TaskScheduler.Default })