Why test the rule before the build
Most business rules start as a sentence: orders of £2,000 or more get priority handling. Then someone builds it, and the questions arrive. Is that before or after the discount? What about an order of exactly £2,000? Who agreed the limit, and what happens when it changes? When these questions come up after the build, each answer costs a change to working software.
This guide shows how to settle them first with FlowLab, a free tool in Digital Campaign Labs. You lay the rule out as connected steps on a canvas, try it with real numbers and watch every value as it moves through. It runs in your browser and nothing is uploaded. The page opens with an order approval template, so you can follow along and see the same numbers as this guide.
A worked example: an order approval rule
- Look at the template. The page opens with Order approval. On the left are three Number nodes: Unit price (25), Quantity (100) and Discount (%) (10). Gross value multiplies the first two with the formula a * b. Net value applies the discount with a * (1 - b / 100). A Condition node called At least £2,000? tests the net value and sends it down a True path to Priority order or a False path to Standard order.
- Read the result. Live is on, so the flow has already run. The strip at the top of the tool says Ran 7 of 8 nodes. Gross value shows 2,500 and Net value shows 2,250, which is at least £2,000, so the True path ran and Priority order lit up. Standard order says Not executed, because its branch was not taken. On the Test step, the console's run order lists every node and how long it took.
- Inspect a step. Select Net value on the canvas. The inspector shows its formula, then the inputs from the last run (a is 2,500 and b is 10) and the output, 2,250. Select At least £2,000? and the inspector shows that only its True output was taken. This is the most useful habit in FlowLab: when a result surprises you, select the node and read what went in.
- Try the cases people ask about. Select Quantity and change it to 80. The flow runs again as you type. Gross value is now exactly 2,000, but Net value is 1,800, so the order goes to Standard order. That one change answers the first question in this guide: the rule tests the value after the discount. Set Discount (%) to 0 with the quantity back at 100, and the net value is 2,500 and the order goes priority. Put the discount back to 10, select At least £2,000? and change Compared with from 2000 to 3000: the same £2,250 order now goes the standard way. Change it back to 2000.
- Find the boundary. With a 10% discount, set Quantity to 88. The net value is 1,980 and the order goes standard. Set it to 89 and the net value is 2,002.5, so it goes priority. Everyone who signs off the rule should know the change happens between 88 and 89 units, because that is where customers will notice it.
- Lock in the answer with a test. Set Quantity back to 100. In the node library, find Assert under Logic and validation and select it to add it to the canvas. In the inspector, set What is checked to Net value is £2,250, Expect to equals and Expected to 2250. Under Inputs, set Actual to Net value: Result. The strip now adds 1 of 1 tests passed, and the console on the Test step lists the test.
- Watch the test catch a change. Set Discount (%) to 15. The net value falls to 2,125 and the console on the Test step shows Failed: Net value is £2,250 (expected equals 2250, got 2,125). The order still goes priority, so the test is the only thing that tells you the price changed. Set the discount back to 10 and the test passes again.
- Step through it. Clear the Live tick box at the top of the tool, open the Test step and select Step. The status line says Step 1 of 9: Unit price ran, and the console marks which nodes have run and which are waiting. Keep selecting Step to follow the values one node at a time, in the same order the full run uses. Select Reset to start again, or Run flow to run everything at once. Tick Live again when you have finished.
- Keep the flow. On the Share step, Download flow (JSON) saves the flow as a file you can send to a colleague or import again later. Save in this browser keeps it on this device, but only after you agree to it. The saved list has Open, Delete and Clear all.
In about ten minutes the example answers three questions that usually come up mid-build. The limit applies after the discount. The change happens between 88 and 89 units. And a test now guards the agreed price.
Using it on your own rules
Start from a template that looks like your problem, or clear the canvas and build from the library. A few habits make the result more useful.
- Name every node. Each node has a label setting. Gross value and Net value are clearer than two Calculate nodes, and the labels appear in the console and in the exported file.
- Put each decision in its own node. One Condition per question makes it easy to see which branch was taken and why. Switch routes a value by matching cases, such as a plan name or a region.
- Use your own data. A CSV node reads a file from your computer or text you paste in. Filter, Transform and Aggregate then work on every row. The Data clean-up template shows how Validate separates the valid rows from the ones to fix.
- Add an Assert for every answer people agree. When a manager says an order of 100 units at £25 should cost £2,250, make it a test. The Test harness template shows three checks on one calculation.
- Check the edges. For every limit, try the values just below it, on it and just above it. Those are the cases a rule is most likely to get wrong.
FlowLab also works without a mouse. Tab to a node on the canvas, move it with the arrow keys, and connect inputs with the Connected from lists in the inspector. Undo and Redo cover every change.
What it gives each person involved
- Business analysts get a rule they can show working with real numbers. Everyone reads the same flow, where a paragraph in a requirements document can be read several ways.
- Product owners can decide edge cases, such as an order of exactly £2,000, in a meeting, while changing them still costs nothing.
- Developers receive a precise flow and a set of agreed tests to build against, which cuts the back and forth about what the rule should do.
- Finance and operations teams can see the effect of changing a limit or a discount before the change goes live, and check that the agreed prices still hold.
- Consultants and trainers can walk a group through how a decision is made, one step at a time, with the values on screen.
Rules like these often sit inside larger changes to how a business works. Our digital transformation service helps teams map those decisions before they are built into systems.
When FlowLab is not the right tool
- When the logic loops or runs over time. A flow runs each node once, from inputs to outputs, and cannot loop back. Retry loops and processes that run over hours fit the Agent Simulator better.
- When you need to match two data sets. Finding the differences between two versions of a list is what DataResolve is for.
- When the rule must run in production. FlowLab does not connect to other systems or run on a schedule. It is where you work out and test the logic, so the real system gets built right.
- When the data is very large. A table can have up to 50,000 rows and a CSV file can be up to 5 MB.
If you are planning to automate decisions like these across a business, our AI and automation strategy service can help you decide what to build and in what order.
Try it
Open FlowLab, follow the order approval steps above, then rebuild one of your own rules with your own numbers. Add an Assert for each answer your team agrees, and send the exported file to whoever builds it.



