> For the complete documentation index, see [llms.txt](https://docs.rootcause.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rootcause.ai/more-details/applications/application-modules/poll.md).

# Poll

> Check a GET endpoint until its response matches a condition or the time limit is reached.

Calls an endpoint every `everyS` seconds until `until` holds of the response or `maxWaitS` is reached.

The bounded way to wait on someone else's job: it always terminates, and it always says which way it ended, so a flow can branch on a timeout rather than hang on one. Durable only, for the same reason Delay is — the waiting is a timer, not an occupied worker.

## At a glance

|                          |                        |
| ------------------------ | ---------------------- |
| Module type              | `Poll`                 |
| Category                 | Primitives · Control   |
| Default tier             | `durable`              |
| Runs on                  | `durable`              |
| Starts a flow            | no                     |
| Holds a body             | no                     |
| Keeps state between runs | no                     |
| Available in             | every application type |

## Parameters

### `body`

`string` · required · defaults to `""`

A request body, for an endpoint that wants one.

### `everyS`

`number` · required · defaults to `5`

Seconds between polls.

### `headers`

`object[]` · required · defaults to `[]`

Headers sent with each poll; each entry is a `key` and a `value`.

### `method`

`"GET"` · required · defaults to `"GET"`

Always GET: polling must be safe to repeat.

### `url`

`string` · required · defaults to `""`

The endpoint to poll.

### `queryParams`

`object[]` · required · defaults to `[]`

Query string parameters; each entry is a `key` and a `value`.

### `executionMode`

`"once"` · required · defaults to `"once"`

Always once: a poll is one conversation, not one per row.

### `credentialSlotId`

`string` · required · defaults to `""`

The slot holding the endpoint's credentials.

### `timeoutS`

`number` · required · defaults to `60`

Seconds any single poll may take.

### `maxWaitS`

`number` · required · defaults to `90`

Total seconds before the module gives up and reports `done` false.

### `until`

`string` · required · defaults to `"response.done = true"`

The condition over the response that ends the polling.

## Inputs

| Port      | Kind    | Required | Description                                                                                                                           |
| --------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `on`      | `event` | no       | Implicit on every module that does not itself start a flow: wire an event here to make this module the start of what that event runs. |
| `request` | `json`  | no       | Values for the request body or query, per poll.                                                                                       |

## Outputs

| Port       | Kind              | Connects to                        | Description                                                          |
| ---------- | ----------------- | ---------------------------------- | -------------------------------------------------------------------- |
| `response` | `json`            | `json`, `scalar`, `signal`         | The last response received.                                          |
| `done`     | `scalar<boolean>` | `scalar`, `json`, `text`, `signal` | Whether `until` was satisfied, as opposed to `maxWaitS` running out. |
| `elapsedS` | `scalar<number>`  | `scalar`, `json`, `text`, `signal` | How long the polling took.                                           |

***

[← All application modules](/more-details/applications/application-modules.md)
