> ## 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.

# Polymarket Heartbeat

Send a heartbeat (dead-man switch) to Polymarket. Creates a new heartbeat or refreshes an existing one. If a heartbeat is not refreshed before it expires, Polymarket auto-cancels all open orders associated with the account. Ideal for: automated trading safety nets, market-making workflows, crash protection.

![Polymarket Heartbeat logo](https://cdn.b3.fun/b3os-icons/polymarket-icon.png)
Catalog action Utility wallet

Send a heartbeat (dead-man switch) to Polymarket. Creates a new heartbeat or refreshes an existing one. If a heartbeat is not refreshed before it expires, Polymarket auto-cancels all open orders associated with the account. Ideal for: automated trading safety nets, market-making workflows, crash protection.

**Review wallet and value movement**

This action can require a wallet connector, gas, token movement, or an external side effect. Test with simulation or a controlled amount before using it in a live workflow.

## At a Glance

| Field | Value |
| --- | --- |
| Action ID | `polymarket-heartbeat` |
| Category | Utility |
| Connector | `wallet` |
| Requires gas | No |
| Funds movement | None declared |
| Tags | `polymarket`, `trading`, `orders`, `write` |

## Payload Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `heartbeatId` | `string` | No | Existing heartbeat ID to refresh. If omitted, creates a new heartbeat. Store the returned heartbeatId and pass it in subsequent calls to keep the heartbeat alive. If the heartbeat is not refreshed in time, Polymarket auto-cancels all associated orders. |

## Result Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | `string` | Yes | - |
| `heartbeatId` | `string` | No | The heartbeat ID. Pass this back in subsequent calls to refresh the heartbeat. |
| `message` | `string` | No | Additional context about the heartbeat operation. |

## Examples

**Workflow node**

```json
{
  "type": "polymarket-heartbeat",
  "payload": {
    "heartbeatId": "example-heartbeatId"
  },
  "children": [],
  "connector": {
    "type": "wallet",
    "id": "conn_wallet"
  }
}
```
  **Test with API**

```bash
curl -X POST "https://api.b3os.org/v1/actions/polymarket-heartbeat/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "inputs": {
    "heartbeatId": "example-heartbeatId"
  }
}'
```

**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.