---
title: "List all waiting instances for an organization"
method: GET
path: "/v1/workflows/instances/waiting"
tags: ["Instances"]
---

# List all waiting instances for an organization

`GET /v1/workflows/instances/waiting`

## Request

- Base URL: `https://api.paymongo.com`
- URL: `https://api.paymongo.com/v1/workflows/instances/waiting`
- Auth: none required

Returns paginated list of workflow instances currently waiting for external events. Supports filtering by workflow_id and event_name. Pages by cursor with after_id or before_id. A wait state has no single id, so a cursor is "<instance_id>:<step_index>", the instance_id and step_index of a row from a previous response. The default order is timeout_at ascending with rows that have no timeout last; ties break on instance_id then step_index.

## Query parameters

- `workflow_id` string
- `event_name` string
- `limit` integer
- `after_id` string
- `before_id` string
- `sort_by` 'created_at' | 'updated_at' | 'timeout_at'
- `sort_order` 'asc' | 'desc'
- `internal` boolean

## Response `200`

List of waiting instances

- ListWaitingResponse
  - `data` WaitStateDTO[]
    - `definition_path` string: Position of the wait_event step in the workflow definition, such as "2", "2.steps.0" or "0.then.1". A wait state recorded before positions were stored shows its step_index
    - `description` string
    - `event_name` string
    - `instance_id` string
    - `iteration` integer: 0-based loop iteration that ran the wait_event step; null when the step did not run inside a loop
    - `status` string
    - `step_index` integer
    - `timeout_at` string
  - `has_more` boolean: HasMore is true when more results exist beyond this page: after the last row when paging forward, before the first row when paging backward with before_id.
  - `meta` MetaResponse
    - `limit` integer
  - `next_cursor` string: Opaque cursor for the last row on the page. Echo it as after_id to read the next page. It normally carries the sort it was issued under, so sort_by need not be repeated; for a very long text sort value the API falls back to a plain row id, which carries no sort, so a client pinning a non-default sort should keep sending sort_by. Omitted when the page has no rows.
  - `prev_cursor` string: Opaque cursor for the first row on the page. Echo it as before_id to read the previous page. It normally carries the sort it was issued under, so sort_by need not be repeated; for a very long text sort value the API falls back to a plain row id, which carries no sort, so a client pinning a non-default sort should keep sending sort_by. Omitted when the page has no rows.

## Other responses

- `400`: Invalid query parameters
- `401`: authentication_failed, missing_authorization_header, unsupported_auth_method or jwt_signature_invalid when the credential is missing, malformed or rejected; accountid_identity_required when a superuser or service-to-service caller sends the Account-ID header
- `500`: Internal server error
- `502`: accountid_relationship_lookup_failed or accountid_account_lookup_failed when an upstream service does not answer
- `503`: upstream_unavailable when an upstream service does not answer
- `504`: service_timeout when the request exceeds its deadline

---

[API](https://skmtc.dev/paymongo/apis/workflow.md) - [All operations](https://skmtc.dev/paymongo/apis/workflow/llms.txt) - [OpenAPI document](https://skmtc.dev/paymongo/apis/workflow/revisions/859719cfffa2?raw)
