You can call retry() on a Flow to indicate that if the Flow throws an exception, the Flow work should be retried the specified number of times. If exceptions keep occurring, then after the stated number of retries, the exception proceeds normally to the FlowCollector.

You can learn more about this in:
Run Edit