blokboard/ Open beta
All articles

LEARN BY RUNNING

Build a balance check with Variables and If

One balance. One decision. Two possible paths.
Build the rule with sample numbers, then run it three ways.

START HERE

Open the five-node workflow

Use the Browser runtime. These are fictional balances: no wallet, credentials, or blockchain connection is needed. Your copy opens inactive; select Run when you are ready.

WORKFLOW SNAPSHOT

Practice a balance check

5 nodes

Interactive workflow preview loads here. Download the JSON to inspect it in the app.

Select a node to inspect its settings. Use this workflow to open your own editable copy.

Opens as a new, inactive workflow. Review the nodes before running.

Follow Start → Variable → If. Each output from If leads to a different Variable node. The connections decide which one runs; placing nodes next to each other does not connect them.

01 / INPUTS

Give the rule two numbers

Select the Variable node after Start. Keep the Number type selected for both entries:

balance
125
threshold
100

Now select If. Set its left value to {{balance}}, its operator to >=, and its right value to {{threshold}}.

The double braces read a value from the workflow. An exact expression such as {{balance}} keeps the number type. Text around it, such as Balance: {{balance}}, produces a string instead.

Keep the variable names exactly balance and threshold. Renaming the node’s display label does not rename these variables.

02 / EXECUTION

Change one value. Run three times.

Leave the threshold at 100. Change only the balance, run again, then inspect the Variable node on the selected branch.

  1. ABOVE

    125 ≥ 100

    true branch

    Balance meets the threshold

  2. BELOW

    75 < 100

    false branch

    Balance is below the threshold

  3. EXACTLY EQUAL

    100 = 100

    true branch

    Balance meets the threshold

Each result sets a message variable to the text shown above. The other branch should stay idle for that run. To see why the boundary matters, change the operator to >: a balance of 100 will then take the false path.

03 / INSPECTION

If the result surprises you

  • Missing value? Check the variable name and the connections leading to If. The source node must run first.
  • Unexpected branch? Check both numbers and the operator. >= includes equality; > does not.
  • The same message on both paths? Inspect the two result nodes. Both define message, but their text should differ.
  • A result on the unselected branch? It may be from a previous run. Check which nodes executed in the current run. An idle node is expected, not a failed step.

04 / NEXT STEP

Replace the sample with a real balance

A wallet-reading node can provide live data in place of the sample Variable. Check its documented output and units: a balance in lamports must not be compared with a threshold in SOL.

Keep the decision separate from the action. Add an alert or another step only after the rule produces the expected result. A successful condition does not prove that a later action succeeded.

Test mode chooses the supported test chain for blockchain nodes. The sample values in this lesson come from Variable, so this workflow makes no blockchain requests in either mode.