Rabbinatix
Sign inGet started
Store

Retry until it works

FreeLogic
@rabbinatix/retry-until-it-works by Rabbinatixupdated Oct 4, 2026

Tries up to 3 times; succeeds once the attempt number reaches `succeedOn`.

Sign in to add

A safe way to see Retry: the Attempt fails on purpose until attempt succeedOn. When an attempt finishes without an error Retry fires Succeeded; after 3 failures it fires Failed with the last error. In your own logic the Attempt would call something that can fail now and then. The backoff is 0 here; in real code it waits between attempts.

Shows: Retry (attempts, Succeeded, Failed, attemptNo, error), Throw Error.

How to use it

Add it to your logic, then add a Call Function step in any logic and pick Retry. It belongs to no system, so every system can use it. Or download the TypeScript and call it from your own code.

Inputs
succeedOn: Whole number
Outputs
ok: Yes / No
attempts: Whole number
error: Text (may be empty)
Previewdrag the steps around; scroll to zoom
Function Entry, Input / output. 0 inputs, 2 outputs. step 1 of 8
Retry
succeedOn
Retry, Flow control. 1 input, 5 outputs. step 2 of 8
Retry
Attempt
attemptNo
Succeeded
Failed
error
Less Than, Operators. 2 inputs, 1 output. step 3 of 8
<
A
B
result
Branch, Flow control. 2 inputs, 2 outputs. step 4 of 8
Branch
condition
True
False
Throw Error, Flow control. 2 inputs, 0 outputs. step 5 of 8
Throw Error
message
Return, Input / output. 4 inputs, 0 outputs. step 6 of 8
Return
ok
attempts
error
Return, Input / output. 4 inputs, 0 outputs. step 8 of 8
Return
ok
attempts
error
Get Property, Object. 1 input, 2 outputs. step 7 of 8
Get .message
object
message
exists

Arrow keys: next or previous step in flow order. Alt with arrows: nearest step in that direction. Enter: open. Shift F10: more actions.

100%
Examplesrun live against the logic · 2/2 pass
PassedExampleInputOutput
Works on the 2nd attempt{"succeedOn":2}{"ok":true,"attempts":2,"error":null}
Never works{"succeedOn":5}{"ok":false,"attempts":3,"error":"Not yet"}
Try it
Versions
In this package
Retry (entry)