At a glance
Counter uses a number from Run Parameters as a remaining budget. A positive value takes met and decreases by one; a zero or negative value takes unmet.
Before you start
Complete setup and know your Stop shortcut. Use a fresh tree with bulk off. This practice loop uses Wait, so you can check its count without spending currency.
1. Create the two loop nodes
On the Hub, press +, name the tree Five pauses, and open Edit. Add a Counter and a Wait node from the palette.
For Wait, choose Timer only, select Fixed ms, and enter 500. Confirm each node so both appear on the canvas. The wait makes each permitted pass visible without introducing an item condition.
2. Give Counter a number parameter
Open Counter's Run Parameters counter picker. Choose Create new, make a Number parameter labelled Passes, and select it.
Open Params on the toolbar. Find Passes, expand Details, and set Fallback default to 5. Keep its kind as Run setting (with fallback default) so you can change the starting budget from the Hub.
3. Put the Counter before the action
Connect Start → Counter. Connect Counter's met output to Wait. Connect Wait's output back to Counter. Connect Counter's unmet output to Finish.
Placing Counter before Wait means it grants permission for each pass. The unmet route exits without doing another wait. Check that there is no direct Start-to-Wait route that bypasses the budget.
4. Trace the last pass
For this hypothetical 5 budget, the met checks are 5 → 4, 4 → 3, 3 → 2, 2 → 1, and 1 → 0. Each one permits a Wait.
The 1 → 0 check still takes met. Only the following visit sees 0 and takes unmet. This is why you should count met passes rather than treating zero after decrement as an immediate exit.
5. Save and run
Use Back to Hub. Set Passes to 5 in Run Parameters and wait for Saved, then start. After completion, open Logs and find the counter's decreasing values.
For a second check, save 1 and run again. You should get one wait, followed by the zero-budget exit on the next Counter visit.
6. Reuse the pattern carefully
Once the count is clear, you can put a single action where Wait sits. Keep the same budget check before it and return route afterward.
Use different parameters for independent budgets. Two Counter nodes bound to the same parameter spend the same remaining value during that run. A new run initializes the budget from its start configuration.
Check the result
The first run permits five waits, and the second permits one. In both cases, the final Counter visit follows unmet to Finish. A read through Compare Parameter can inspect a value without decrementing it.
If it does not work
- Exits immediately: verify Passes has a positive saved value or fallback.
- Runs too often: check for a route that bypasses Counter.
- Uses budget unexpectedly: inspect other Counter nodes for the same parameter binding.