> ## Documentation Index
> Fetch the complete documentation index at: https://docs.b3os.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Wait for Event

Pause the workflow until a specific event happens — a price change, an on-chain event, an external callback, and more. A timeout is required to prevent waiting forever.

Logic action Logic

Pause the workflow until a specific event happens — a price change, an on-chain event, an external callback, and more. A timeout is required to prevent waiting forever.


## At a Glance

| Field | Value |
| --- | --- |
| Action ID | `wait` |
| Category | Logic |
| Connector | Not required |
| Requires gas | No |
| Funds movement | None declared |
| Tags | `logic`, `wait`, `trigger`, `pause`, `control-flow` |

## Payload Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `timeoutMs` | `number` | Yes | Timeout in milliseconds. The node fails if no trigger fires within this duration. Range: 1 second to 7 days. |
| `triggerType` | `string` | Yes | The trigger type to wait for. |
| `triggerConfig` | `object` | Yes | Trigger-specific configuration. Schema depends on triggerType. |

## Result Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | `string` | Yes | Initially 'waiting'; changes to 'resumed' \(trigger fired\) or 'timed_out' \(timeout elapsed\). |
| `triggerResult` | `object` | No | Data from the resume trigger \(e.g. resume payload\). Set when the node is resumed. |
| `source` | `string` | No | Source that resumed the node \(e.g. 'manual', 'token-price-cexes'\). |
| `branch` | `string` | No | Routing branch: 'resumed' if trigger fired, 'timed_out' if timeout elapsed |
| `timeoutMs` | `number` | No | Configured timeout in milliseconds \(present in timed_out results\) |

## Examples

**Workflow node**

```json
{
  "type": "wait",
  "payload": {
    "timeoutMs": 60000,
    "triggerType": "approval",
    "triggerConfig": {}
  },
  "children": []
}
```
  **Test with API**

```bash
curl -X POST "https://api.b3os.org/v1/actions/wait/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "inputs": {
    "timeoutMs": 60000,
    "triggerType": "approval",
    "triggerConfig": {}
  }
}'
```

**Use expressions for dynamic values**

Payload fields can use workflow expressions such as `{{$trigger.body.amount}}`, `{{$nodes.fetch.result.price}}`, and `{{$props.asset}}` when the value should come from a trigger, prior node, or reusable workflow prop.