# 等待时间

节点类型 `browser_waitTime`

## 功能说明

按固定时长或随机时长暂停流程。

## 客户端配置界面

![等待时间节点的客户端配置界面](/assets/wait-time.baeb9488957584671d844e83fb78621cd781fe391578aa8f14ad3d32ec4be64b.0538f3a9.webp)

截图来自 MoreLogin 桌面客户端 V2.73.101 的英文界面。

## 输入字段

以下字段位于 `data.browserUi.inputs`。

| 字段 | 类型或取值 | Schema 必填 | 执行默认值 | 说明与边界 |
|  --- | --- | --- | --- | --- |
| `timeoutType` | `"fixed"` / `"randomInterval"`（支持变量引用） | 否 | `"fixed"` | 等待方式 编辑器初值 `"fixed"` |
| `timeout` | `WorkflowNumber` | 否 | `1000` | 等待时间（毫秒）; minimum after resolution: 0 编辑器初值 `1000` |
| `timeoutMin` | `WorkflowNumber` | 否 | — | 最短时间（毫秒）; minimum after resolution: 0 |
| `timeoutMax` | `WorkflowNumber` | 否 | — | 最长时间（毫秒）; minimum after resolution: 0 |


## 条件与边界

**`timeoutType` `eq` `"fixed"`**

- timeout 求值后为 0…2147483647 的有限数，毫秒。
- 校验错误码 `RPA_NODE_INPUT_INVALID`


**`timeoutType` `eq` `"randomInterval"`**

- timeoutMin/timeoutMax 为 0…2147483647 的数，可为小数；timeoutMin <= timeoutMax；取 timeoutMin + floor(random × (timeoutMax − timeoutMin + 1))：两端为整数时是闭区间均匀随机整数，含小数时以 1 为步长，结果可能超出 timeoutMax 不到 1 毫秒。
- 校验错误码 `RPA_NODE_INPUT_INVALID`
- fixed 的 timeout 缺省 1000ms；randomInterval 缺省 [1000,3000]ms，timeoutMin ≤ timeoutMax。
- 校验错误码 `RPA_NODE_INPUT_INVALID`


**`timeoutType` `eq` `"randomInterval"`**

- 必填 `timeoutMin`, `timeoutMax`
- 编辑器必填项，没有默认值；省略时写入与校验返回 RPA_NODE_INPUT_INVALID（reason=required），运行前同样拒绝。
- 校验错误码 `RPA_NODE_INPUT_INVALID`


## 输入引用

| 字段 | 允许的形式 |
|  --- | --- |
| `timeoutType` | `literal`, `template` |
| `timeout` | `literal`, `numericExpression` |
| `timeoutMin` | `literal`, `numericExpression` |
| `timeoutMax` | `literal`, `numericExpression` |


## 输出字段

| 输出字段 | 类型或取值 |
|  --- | --- |
| `waitedMs` | `number` |
| `requestedMs` | `number` |


按契约用 `${nodeId.data.field}` 引用公开字段。

## JSON 示例

本例随机等待 1 到 3 秒。把节点放在需要暂停的两个步骤之间。

```json
{
  "id": "pause",
  "type": "browser_waitTime",
  "data": {
    "title": "随机等待 1 到 3 秒",
    "browserAction": "waitTime",
    "browserUi": {
      "inputs": {
        "timeoutType": "randomInterval",
        "timeoutMin": 1000,
        "timeoutMax": 3000
      },
      "exception": {
        "timeout": 30000,
        "policy": "interrupt"
      }
    }
  }
}
```

[返回节点目录](/zh/browser-rpa/nodes)