Workflow Overview

The previous workflow BB-121 Monopoly Optimization Loop showed a more flexible way to use a Recursive Loop to optimize Market KPIs. But that workflow was restricted to a Monopoly Market.

This workflow shows how the flexible Recursive Loop would be used in a Commodity Market where two Competitors are trying to simultaneously find their Revenue Maximizing Price.

The Market used in this loop is originally based based upon the BB-113 Commodity Competitive Loop. But there the Competitors both attempted to simultaneously set Profit Maximizing Prices. In this workflow, the second Competitor will review the Pricing decision made by the first Competitor before setting their own new Price.

The results of this Market Simulation are uninteresting. But the use of Meta-Nodes and the introduction of Flow Variables are useful to understand, as is seeing how outer-loops work with inner-loops.

This Building Blocks example assumes you have already downloaded the open-source KNIME analytics platform and installed the free Market Simulation (Community Edition) plugin. If not, start by returning to Getting Started.

Maximize Revenue

Two Competitors are trying to simultaneously find the Revenue Maximizing Price. Unfortunately, as the Product is an undifferentiated commodity, the Competition drives Price to Marginal Cost.

Starting with the first Competitor, Spacely Sprockets, the Loop checks whether raising or lowering the Price by 10% increases Revenue. The Loop continues until no further improvement is possible. These Prices are then pushed out into the Market.

Then the second Competitor, Cogswell Cogs, reviews the Price set by the first then also decides whether raising or lowering the Price by 10% increases Revenue. This sequence continues 10 times.


As with previous workflows, the Product Generate creates a Product Array and WTP Matrix.

Product Array

The two Products, Spacely Sprockets and Cogswell Cogs, along with the associated WTP Matrix, are defined by the Product Generator node.

WTP Matrix

Both the Product Array and the WTP Matrix is passed to a Market Simulation node.

Simulate Market

The ‘Simulate Market’ node calculates the starting conditions for the Market.

Starting Conditions

The Simulate Market node calculates the starting Quantity, Revenue, and Profitability of both Products.

Outer Loop

An Outer Loop is created within which each Competitor will identify its own Revenue Maximizing Price. The Outer Loop iterates 5 times.


As the second Competitor, Cogswell Cogs, always has the opportunity to set a lower Price after it sees the Spacely Sprockets Price, the first Competitor Spacely Sprockets can never lower Price enough to catch up.

Meta-Node #1

Meta-Nodes are containers that contain sub-workflows. This Meta Node contains the sub-workflow that sets Price to maximize Spacely Sprocket’s Revenue.

Inner Loop #1

The Spacely Sprockets Meta-Node contains the same loop from the workflow BB-121 Monopoly Optimization Loop.


Quick-Forms allow the user to set ‘Flow Variables’. Flow Variables can override workflow parameters.


This Quick-Form allows the user to set the ‘Price Experiment Adjustment’. This is the percentage increase/decrease in Price that is tested within the inner loop. It is set to 10% by default.


The value of Flow Variables can be seen in the ‘Flow Variables’ tab from within any output table. Here you can see the Price Experiment Adjustment Flow Variable set to 10%.

Meta-Node #2

The second Competitor runs its own Revenue Maximization after seeing the results from the first Competitor.

Inner Loop #2

The Cogswell Cogs Meta-Node also contains the same loop from the workflow BB-121 Monopoly Optimization Loop.


Line Charts

The final trends from the Outer Loop and Inner Loop can then be plotted using the ‘Line Chart’ node.

Price Trend

The Price trend for Cogswell Cogs (red) is always lower than the Price for Spacely Sprockets (blue) as Cogswell has the advantage of first seeing Spacely’s Price before setting its own lower Price.


The Revenue maximizing Prices will continue down below the $50 Cost as Revenue maximization takes no account of Cost.