Skip to main content
Tells you whether a flow can still change without any action from your page, which means your page should read it again with getFlow. shouldPollFlow makes no request; it checks the flow you pass. It returns false when the flow:
  • has ended: executionState is cancelled, expired, or failed, or settlementState is completed or failed.
  • waits for the payer: executionState is initiated or source_attached. Only an action from your page moves the flow on, and the function you call returns the updated flow.
An exchange payment is the exception. A flow in source_attached with an exchange source waits for the exchange to confirm the payment, so shouldPollFlow returns true. In every other state, including quoted, signing, broadcasted, source_detected, and source_confirmed, it returns true. A state added in a later version is treated the same way, so a flow is not left unwatched.

Usage

Parameters

Returns

boolean: true while the flow can still change on its own, and false once it has ended or while it waits for the payer. shouldPollFlow does not set an interval. The React hooks read the flow every 3 seconds while it returns true.

Notes

A flow that waits for the payer is not read again, so the page does not notice when it expires. Run a timer on flow.expiresAt and read the flow when it fires, as shown in Build a custom payment UI.

React

useGetFlow and useSubscribeToFlowStateChange already use shouldPollFlow to decide when to refetch. You do not need to call it yourself in React.
Last modified on October 28, 2026