Initially they seem to be doing very similar things: Both nodes enable you to provide input parameters for other nodes in the workflow and, unless they are in a component, they seem to provide the same service. Even their dialogs look identical! Just see for yourself in the figure below.
So let’s clarify the difference between Widget and Configuration nodes and when to use them. Here is a summary of the differences:
- Widget nodes enable you to interact with the data by selecting, filtering and entering values, and applying the new settings in both KNIME Analytics Platform and on the KNIME WebPortal. Configuration nodes enable interaction only on KNIME Analytics Platform.
- Configuration nodes implemented inside a component give users the ability to interact with the data to modify the output before running downstream nodes in KNIME Analytics Platform. Use them when you don’t want users on the KNIME WebPortal to provide input parameters for other nodes in the workflow.
- Widget nodes implemented inside a component give users the ability to interact with the data and modify the output that is then applied to other nodes after running downstream nodes in the KNIME Analytics Platform. Use them when you do want users on the KNIME WebPortal to provide input parameters for other nodes in the workflow.
- Summing up: On the KNIME Analytics Platform, either will allow interaction - Configuration nodes before execution and Widget nodes after execution. On the KNIME WebPortal, use Configuration nodes when you want to protect your input parameters, and use the Widget nodes when you want to allow the manipulation of input parameters.
See the table for where you can modify input parameters in each node with respect to software.
Now read on for a more detailed look at first Widget nodes and then Configuration nodes, when to use them, plus an example workflow that demonstrates both.
What Are Widget Nodes and When Do I Use Them?
You use Widget nodes to make it possible for users to interact with the workflow - enabling them to change the default settings of nodes that are inside components. For example you can use different Widget nodes to enable the user to add input like credentials, select something to be output by the workflow - a report, or an image, or filter data in a visualization within a certain date range or similar.
Put more precisely, Widget nodes allow you to set different variables in a so-called component “view”. This selection can be changed on the KNIME Analytics Platform and on the KNIME WebPortal.
Are There Different Types of Widget Nodes? Yes! Widget nodes come in many flavors:
- Input widgets: user inputs some data (like credentials)
- Selection widgets: user selects some data (like a column)
- Output widgets: user outputs some data (like an image)
- Filter widgets: user interactively filters visualized data
- Re-execution widget: user triggers re-execution of downstream nodes
For even more details, see the official documentation in the KNIME Components Guide.
An Example of When to Use a Widget Node
Here are two examples of how a Widget node was used to allow the user to interact with a dashboard showing Netflix movies and TV shows. The user can look at movie data by year, selecting a certain range.
This first example shows the Netflix dashboard on your local installation of KNIME Analytics Platform - accessed when you right-click the component and select Interactive View.
Similarly, on the KNIME WebPortal you can use Widget nodes to enable other users to interactively select the parameters - here as above - they can select a certain range of years but via their browser on the WebPortal.
If you’d like to play with the free KNIME workflow associated with these visuals yourself, you can download it here: Create an interactive dashboard in 3 steps: Netflix dataset. And if you’d like to read the original blog article you can check that out here: How to Create an Interactive Dashboard in Three Steps with KNIME Analytics Platform.
What Are Configuration Nodes and When Do I Use Them?
A Configuration node enables you to set column selection configuration options within a component - giving you a dropdown menu, for example. Note that the options in - for example the dropdown menu - can be changed within KNIME Analytics Platform, but cannot be changed on the KNIME WebPortal.
Configuration nodes share the same “Configure…” options with Widget nodes, but with two important changes:
- In KNIME Analytics platform (when in a component) you are given choices for your parameters
- On the KNIME WebPortal you cannot change the parameter settings
Are There Different Types of Configuration nodes? Yes, but Configuration nodes come in less flavors:
- Input widgets: user inputs some data (like credentials)
- Selection widgets: user selects some data (like a column)
Note that output, filter, and re-execution only exist for Widget nodes and therefore Widgets offer a broader range of possibilities than their Configuration node counterparts.
An Example of When to Use a Configuration Node
In KNIME Analytics Platform, Configuration nodes that are encapsulated by components give us handy dropdown menus (and that is just one type of menu!).
Unlike Widget nodes, on the KNIME WebPortal you cannot use Configuration nodes to give yourself or other users the ability to interactively choose parameters.
An Example Workflow Showing Both Widget and Configuration Nodes
Now, let’s look at a workflow that has both Widget and Configuration nodes. We’ll touch on when you choose one over the other and how both can be used in a single workflow.
In our Widget Nodes vs Configuration Nodes workflow (which you can download from the KNIME Hub to use yourself) we read in our “Customer data” and then pass some nominal value to the row filter. For example, select a product that a customer bought, such as a gold investment package.
We can see that the outputs are exactly the same, and we notice that even the “Configure…” options are similar.
However, when we put the Widget node or Configuration node and any other downstream nodes into components, the resulting components behave differently.
Select Product Category via Configuration node
In the Configuration Component (left) you can see how we can select a Product Category. Select the Configuration Component, right-click it, and choose “Configure…”. Then the dialog box will open where you can change the product selection - or modify the configuration to set a totally different variable - “Marital Status” for example. Then this component’s output could be a subset of the data containing only married couples.
Select Product Category via Widget node
In the Widget Component, we can see that the “Component is not configurable”. So to select a product category here, we right-click the executed Widget Component to access the so-called “Interactive View”. Now, we can select from “Column” and “Value” (see fig. X below).
How To Decide When to Choose One Over the Other?
To decide whether to use a Configuration or a Widget node ask yourself:
- Where will my workflow be used (in KNIME Analytics Platform or will it be deployed to the KNIME WebPortal)?
- If it’s going to be used via the KNIME WebPortal, do I want my user to have a choice of input parameters?
For example, I am building an application for a different team in my organization or for customers that will be accessible to them via the KNIME WebPortal and I only want them to have access to one category of data. In this case I would choose to use a Configuration node - ensuring that my parameters cannot be altered.
On the other hand, if I do want my customers to have some choice with respect to, for example, their product, then I would allow parameter choice by using a Widget node.
When to Use Both Configuration and Widget Nodes
But can I use a combination of Widget nodes and Configuration nodes? Of course! Let’s say we want to give customers access to a subset of the data e.g., married couples, and we don’t want them to be able to change this subset via the KNIME WebPortal. However, we do want them to have the freedom to interact with that subset.
For example - let’s image we want users on the KNIME WebPortal data to look at different investment products like gold, etc., but we are targeting a specific audience, the married couples. We therefore use the Configuration component to subset the data to only those people in our dataset who are married. Now, when customers interact with the WebPortal, they are free to look at data for different products but this data is restricted to that specific segment of the population.
To enable this, the associated workflow would look something like this:
Are the Differences Clear?
At the end of the day, when comparing and contrasting Configuration nodes vs Widget nodes, use Configuration nodes when you want to enable quick selection of parameters within KNIME Analytics Platform and use Widget nodes for the KNIME WebPortal. If you do not want to allow users to modify parameter selection on the KNIME WebPortal, use the Configuration nodes.
Note that Widget nodes give you options for a greater number of use cases which we’ll discuss in a separate article. For this article, we’ve stuck to the basics to show you a simple compare-and-contrast.
Download this free workflow which we have built to play with Widget versus Configuration nodes. Thanks for reading!