blokboard/ Open app
getting-startedconditionsvariablesworkflows

Build a balance check with Variables and If

Learn how values move through a workflow, test both sides of a condition, and check the exact boundary before connecting real wallet data. Includes a workflow you can run without credentials.

Before you begin

Use Blokboard in your browser and select the Browser runtime. This lesson uses a fictional balance: you do not need a wallet, RPC credits, a Telegram bot, or an email connection. No blockchain request or transaction is made.

A useful automation starts with a decision you can explain. For example: is a balance high enough to continue, or should the workflow take another path?

We will build that decision with sample numbers first. By the end, you will have run both branches, checked the boundary value, and learned where to inspect an unexpected result. The same pattern can later sit between a wallet balance read and an alert.

1. Open the workflow#

Choose Use this workflow on the workflow attached below. You can also download the file and import it into the app. The copy belongs to your workspace, so changing it does not change the article's version.

The workflow has five nodes:

NodeWhat it does
StartBegins one run.
Variable: sample valuesDefines a balance of 125 and a threshold of 100.
IfCompares the balance with the threshold.
Variable: true branchProduces a message when the balance meets the threshold.
Variable: false branchProduces a message when the balance is below the threshold.

Follow the connections from Start to the sample values, then to If. The two outgoing connections from If lead to separate results.

2. Understand the inputs#

Select the Variable node immediately after Start. It contains two entries:

{
  "balance": 125,
  "threshold": 100
}

These are numbers chosen for the lesson, not a live account balance. Keep them as numbers when editing the values.

Select If. Its left value is {{balance}}, its operator is >=, and its right value is {{threshold}}.

The double braces tell Blokboard to read a value from the workflow. An expression occupying the whole field, such as {{balance}}, keeps the underlying value's type. Text around an expression makes a string: Balance: {{balance}} would produce a message instead.

The condition reads: balance is greater than or equal to threshold. You do not need a Code node for this comparison.

3. Run the true branch#

Run the workflow once with the original values. Since 125 is greater than or equal to 100, If follows its true output.

Inspect the Variable node connected to that output. Its result should be:

{"message":"Balance meets the threshold"}

The Variable node on the false branch should not execute in this run. An idle node on an unselected branch is expected; it is not a failed step.

4. Test the other path and the boundary#

Change the sample balance to 75, leaving the threshold at 100. Run again and inspect the node connected to If's false output:

{"message":"Balance is below the threshold"}

Now set the balance to exactly 100 and run a third time.

BalanceThresholdExpected outputResult
125100trueBalance meets the threshold
75100falseBalance is below the threshold
100100trueBalance meets the threshold

That final run matters. The equals sign in >= includes the boundary. If your rule should accept only balances strictly above 100, change the operator to >; a balance of exactly 100 should then take the false branch.

Testing a value above, below, and exactly at your threshold is a small habit that catches many workflow mistakes.

5. Diagnose an unexpected result#

Check the source values first. The entries must be named balance and threshold, matching the expressions in If. Editing a label is not the same as changing a variable name.

Then inspect the condition and connections. Confirm the operator, and make sure each result node is attached to the intended true or false output. Reading a previous run's result on the other branch can be misleading; check which nodes executed in the current run.

If both outcomes show the same message, inspect the two result nodes. Each sets a variable named message, but their text is intentionally different.

If a value is missing, trace backward to the Variable node and confirm that it runs before If. Connections define the execution path; placing two nodes next to each other does not connect them.

6. Turn the pattern into a real automation#

Once these sample runs make sense, choose where the balance should come from. A wallet-reading node can provide real data; use its documented output and units when writing the expression. Do not assume every integration calls its output balance, or compare a value in a base unit with a threshold in a whole-token unit.

Keep the decision separate from the action. A later version could send an alert on the false branch or continue preparing a report on the true branch. A successful condition alone should not be treated as proof that a trade is safe or that a later action succeeded.

For now, both branches only produce text. This lets you check the rule without sending messages or signing transactions.

Keep building#

Test mode selects the supported test chain for blockchain nodes. It does not create these sample values; the Variable node does. This lesson behaves the same without any blockchain connection.

Explore the workflows

WORKFLOW SNAPSHOT

Practice a balance check

5 nodes

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

A complete five-node practice workflow. Run 125, 75, and 100 to check the true branch, false branch, and boundary.

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

Set up your copy

Open the attached copy, use the Browser runtime, and leave the starting balance at 125 for the first run. Change only the balance to 75 and then 100 for the next two runs. Keep the threshold at 100. No credentials or connection bindings need replacing.

← All articlesKeep learning in the docs