- 发行说明
- 入门指南
- UiPath Assistant
- 安装和升级
- 机器人类型
- 机器人组件
- 许可
- 将机器人连接到 Orchestrator
- 流程与活动
- 日志记录
- Robot JavaScript SDK
- 特定场景
- 监管
- 故障排除
Unattended Robot 用于自动执行不需要人工监督的任务,它们通常在专用计算机上的虚拟环境中运行,并且自动化由 Orchestrator 控制。
可以在需要时从 Orchestrator 手动启动无人值守的自动化,但是如果任务必须在特定的时间间隔(每天,每小时,每周)或在特定的时间和日期(一周的结束)开始,则还可以安排无人值守的自动化。
本文档将指导您完成使用 UiPath 社区版许可版本运行第一个无人值守的自动化的过程,从构建自动化,设置环境以及运行无人值守的流程开始。
要运行无人值守的自动化,需要采取以下步骤:
1. 创建自动化并将其发布到 Orchestrator
为了提供一个真实的例子,让我们假设我们需要每天早上 9 点在服务器上备份日志文件。为此,我们需要将当天的日志文件复制到另一个文件夹。在此示例中,我们将“Logs.txt”文件从“Logs”文件夹复制到“Old Logs”文件夹,每次都覆盖备份。
-
创建新流程,添加“复制文件”活动,配置文件的字段/路径,然后选择“覆盖”选项,以便每天可以替换新复制的文件。
-
将流程发布到 Orchestrator。
-
单击 Studio 功能区右侧的“发布”按钮,
-
在“发布属性”选项卡中,输入包的名称。
-
在“发布选项”选项卡中,将“发布至”选项选择为“Orchestrator 租户流程订阅源”,即无人值守机器人可以访问自动化的位置。
-
Click Publish.
For more information, see About Publishing Automation Projects in the Studio Guide.
-
在 Orchestrator 中,创建无人值守机器人用于运行自动化的流程。
-
访问 https://cloud.uipath.com,访问您的 Automation Cloud 实例, 然后选择 Orchestrator 租户。
-
在 Orchestrator 中,选择“共享”文件夹>“流程”,然后单击右侧的“添加”按钮以打开“添加流程”页面。
-
选择包,然后单击“创建”,以将流程添加到共享文件夹中。
备注:请记住,您将在此流程中使用两个实体。第一个实体是您,即创建和发布流程的开发者。第二个是在无人值守计算机上运行自动化和机器人的无人值守用户。
2. 设置 Windows 计算机以运行 Unattended Robot
Set up a Windows machine on which to run the unattended robot, ideally this would be a cloud virtual machine that matches the Hardware and Software Requirements. Make sure that the screen saver is disabled on the Windows machine.
For example, you can host your virtual machine in Azure. For details on how to set up a Windows virtual machine in Azure, see Windows VMs Overview.
Other environments such as AWS, VMware, or Citrix are supported as well if they match the Hardware and Software Requirements.
3. 在 Orchestrator 中创建 Unattended Robot
无人值守机器人由两部分组成:帐户和运行作业的计算机。帐户是用于权限和触发机器人作业的身份证明,而计算机则提供执行作业的计算能力。
-
创建并设置帐户。
-
Creating the account: For unattended automations, we recommend creating a robot account, which is a service-type identity that does not require an email address. However, if the job must run under a particular user's identity (for permissions or audit purposes), you can opt for creating a user account instead.
-
Add the account to folders which contain the jobs it needs to run.
-
创建计算机模型。
备注:While you could opt to create a single standard machine, for this example we are creating a machine template instead. Machine templates make it easier to deploy several machines by defining the configuration once and then using a single set of client credentials to allow multiple robots to connect to Orchestrator.
-
In Orchestrator, go to Tenant > Folders.
-
Select the target folder from the list, and then select the Machines tab.
-
In the top right, click Manage Machines in Folder.
-
On the Manage Machines in Folder page, click the Add machine in the top right and select Machine template.
-
Configure the machine template and assign one unattended runtime only. For detailed instructions, see Adding a machine template.
-
复制计算机密钥以备后用。
If this machine template should be used to run jobs from several folders, add the machine template you created to all the necessary folders. For instructions, see Assigning machine objects to folders.
4. 在无人值守计算机上安装 UiPath Studio
In order to run unattended automations on a machine with a Community License, you need to install UiPathStudio.msi on the unattended machine. If you opt for the Quick Setup during installation, the Robot is deployed in User Mode, meaning that it runs under the user that started it, and has the exact rights as that particular user.
可以从资源中心或直接从 Automation Cloud 主页下载 UiPathStudio.msi 安装程序。
为了从 Orchestrator 启动作业,Windows 用户在计算机上必须处于登录状态。无论是否在 Windows Server 上安装机器人,用户模式机器人均无法针对其他用户运行并发作业。
下载 UiPath Studio 和机器人的社区版本后,您需要将其连接到 Orchestrator 实例。对于无人值守的自动化,建议使用计算机密钥连接。
5. 将机器人连接到 Orchestrator
来自 Studio
安装完成后,系统将向您显示“开始使用”屏幕,默认情况下会要求您进行身份验证。 选择“使用计算机密钥”,因为这是针对无人值守的机器人推荐的配置。系统会自动填充计算机名称,您只需键入创建计算机模型时保存的计算机密钥https://cloud.uipath.com/organisation/tenant、Orchestrator URL,然后点击继续。
通过 UiPath Assistant
还可以通过以下步骤,从 UiPath Assistant 中建立机器人和 Orchestrator 之间的连接:
-
打开 UiPath Assistant。
-
在“首选项”菜单上,选择“首选项”。
-
导航到“Orchestrator 设置”。
-
在 Orchestrator URL 字段中,输入您的 Orchestrator URL。
-
In the Machine Key field, enter the key you copied earlier when you created the machine template in Orchestrator.
For details about the differences between machine entities in Orchestrator and when to use each one, see Machines in the Orchestrator Guide.
-
单击“连接”。状态应显示为
Connected, Licensed。备注:设置计算机时,如果设置基于虚拟环境,则可以断开远程会话的连接,但请确保使无人值守用户登录计算机,以使与 Orchestrator 的连接保持活动状态。
6. 测试自动化
-
在 Orchestrator 中,选择“共享”文件夹>“自动化”>“流程”。查找在步骤 1 中部署的流程,然后单击右侧的“启动作业”按钮以打开“启动作业”页面。
-
选择用户和之前配置的计算机,然后单击“启动”。
这将启动所选计算机上的所选无人值守流程。您可以在 Orchestrator 中“共享文件夹”的“作业状态”部分中监视作业。
7. 安排自动化
让我们将本示例中的自动化安排为每天早上 9 点运行:
-
在 Orchestrator 中,选择“共享”文件夹>“触发器”,然后单击右侧的“添加”按钮以打开“创建触发器”页面。
-
确保选择了“时间”,然后提供所需的信息:输入触发器的名称,选择流程、用户和每天 9 点的每日重复。
-
点击添加。
根据上面的屏幕截图设置时间表后,将触发 Logs.Backup 流程每天在世界标准时间上午 9 点代表选定的用户在无人值守计算机上运行。