Introduction

Data Apps provide a user interface to perform scalable and shareable data operations, such as visualization, data import, export, and preview. In KNIME Analytics Platform, workflow developers can build such a Data App without coding, rather by using workflows. They can deploy them to the KNIME Business Hub where business users can interact with the data without touching the workflow that is working under the hood.

With a KNIME Data App, a workflow developer can control what the end-user can do without losing the complexity of the workflow. Alongside accessing KNIME’s visual programming environment, KNIME Data Apps also provide the possibility to reach out to any number of technologies that are integrated into KNIME’s open ecosystem (scripting languages like Python, machine learning libraries like H2O, etc). Furthermore, through KNIME Business Hub you can also share your Data App with 5, 10, or 1000 end-users with a scope to monitor and tweak based on feedback.

The aim of this guide is to build your understanding of KNIME Data Apps. You will learn how to build your first KNIME Data App from scratch and deploy it to the KNIME Business Hub.

Build Your First KNIME Data App

KNIME Data Apps are built using special nodes in KNIME Analytics Platform that allow the user to update the look and feel of each page, build in interaction, and combine multiple pages in the app.

This section provides a step-by-step guide for building and deploying a simple KNIME Workflow as a data app by building a composite view with re-execution capabilities. Any workflow that is built in KNIME Analytics Platform can be deployed as a data app, provided the appropriate components are included. This gives the workflow developer significant control over the data science operations and user interface.

As a starting point, we use the workflow shown in Figure 1 and adapt it to build our first data app. The example workflow demonstrates how to access, preprocess, and visualize sales data.

01 workflow visualization sales data
Figure 1. Workflow for Visualization of Sales Data

You can download the initial and the resulting deployment-ready workflow from KNIME Hub. Follow steps one to five to adapt the workflow and build your first data app.

Step 1/5 – Create a Component

The first step in order to create a data app is to encapsulate the View nodes in a component. A component in this context is the basic building block of your data app. In fact, the composite views of all root level components of your workflow will correspond to pages in the data app. This means that if you have more than one component on the root level, the data app will be a multi-page application, and the end-user will be able to navigate back and forth through the pages. To create a component select the nodes you want to encapsulate. Then, click the Create component button at the top of the Workflow Editor as shown in Figure 2. Alternatively, you can right-click one of the selected nodes and click Create component.

02 create component
Figure 2. Encapsulating View nodes in Component

If you upload this workflow to KNIME Hub, you can enable other users to start the data app on the browser. The data app will comprise a single page that will show the same view of the component you just created. You will learn more about this in Step 7

If you add a second component the data app will be a multi-page data app and you will enable the end-users to navigate through pages in the KNIME Hub via a next button.

To adapt the given workflow for our analysis we will reconfigure the Column Filter Node in the given example to include some of the columns that were previously excluded as shown in Figure 3.

03 configure column filter
Figure 3. Configure Column Filter node

Now, you might want to give the end-user of the data app the opportunity to explore the data further, like to configure the view on data or filter the data. For example, you can add specific filter options in the component. To do so, first open the component created in Step 1 to add additional nodes. To open the component, right-click it, select Component > Open component as shown in Figure 4.

04 open component
Figure 4. Open Selected Component

For example, suppose you would like the end-user to view only sales by time for a specific country “Brazil”. You can add a Row Filter node in the component, as shown in Figure 5, and configure it to show results for Brazil.

05 country data analysis
Figure 5. Analyzing country-specific data

Step 2/5 – Add Widget Node

Up until now, we have manually configured the Row Filter node to display and analyze specific data. For the given example, to allow the end-user to select which country to analyze without having to explicitly change the configuration of the Row Filter node, you can use a Widget node.

The Value Selection Widget node gets the data you want to filter as input flow variable that reflects the user choice on the Widget node. The Row Filter node will then be configured to use the incoming flow variable to filter rows that have the value of ‘Country’ equivalent to the flow variable. Let’s assume you want to analyze further and view sales over time for a specific Product in each country’s record as a line plot. To do so, add another Value Selection Widget as a downstream node to the first Widget node as shown in Figure 6.

If you want to learn more about how to use flow variables, refer to the Flow Control Guide.

06 selection widget node example
Figure 6. An example of Selection Widget nodes to provide user input

Step 3/5 – Add Refresh Button Widget Node

Now, you need to make sure that the desired visualizations will update according to the configuration options selected through the Widgets. To do so, you need to add re-execution capabilities to the workflow. Add a Refresh Button Widget node and connect its flow variable port to the Widget node, as shown in Figure 7. This will add a Refresh Button in the visualization.

07 reexecutable data app
Figure 7. Data app with re-execution capabilities

In addition to Refresh Button Widget it is also possible to configure the Value Selection Widget node so that the change in the value in the composite view upon user interaction will directly trigger re-execution of the component downstream nodes. This will result in the update of the visualizations of the composite view corresponding to the Widget and the View nodes that are in the branch downstream to the re-executable Widget node. In order to activate this option open the Widget node configuration dialog, go to the Re-execution tab, and check the option Re-execution on widget value change. Refer to Re-execution of Widget Nodes section for more details.

Step 4/5 – Add Domain Calculator Node (Optional)

The Value Selection Widget still shows the label option ‘unknown’ for the column ‘Country’. To skip the ‘unknown’ option in the selection widget you can use a Domain Calculator node before the component. It will recalculate the domain and apply the filter to the data. The complete workflow is shown in Figure 8

08 data app visualization sales data
Figure 8. Data app for visualization of sales data

When the workflow is executed you can right-click the component and select Open view. This will show the available Views and Widgets that have been encapsulated in the component. From here you can interact with your data app, e.g. for testing purposes.

Step 5/5 – Change the Layout of the Composite View

Finally, you might want to change the layout of the composite view. You can do this through the Visual Layout Editor, that provides a simple drag and drop approach to get a layout of your choice. To do so, right-click the component and click Component > Open component. The layout editor button in the toolbar is now accessible to you as shown in Figure 9.

09 layout editor button
Figure 9. The Layout Editor button in the toolbar

You can adjust the layout by defining which Widget and View nodes should be displayed next to or below each other. Refer to Figure 10.

10 composite view layout editor
Figure 10. Composite View Layout Editor

The final Interactive Composite View that would be visible to the user upon workflow sharing is depicted in Figure 11.

11 composite view data app
Figure 11. Interactive Composite View for data app

Data apps on KNIME Hub

KNIME Business Hub provides a web interface that lists all accessible workflows deployed to it, enabling their execution and investigation of results. The input and output of workflows can be parameterized, and their visualizations customized, using Configuration and Widget nodes, Interactive Widget and View nodes.

Workflows are published on KNIME Hub by simply uploading the workflow from the local workspace to the corresponding Hub mount point. One major significance of data apps relies on making these interactive views available to any user in your organization via a web browser. Follow the given steps in order to deploy a data app to KNIME Business Hub.

To create a data app deployment from the workflow you just created, follow the steps below:

If you have subscribed to a Team plan on KNIME Community Hub (https://hub.knime.com) with enabled execution you can also execute ad hoc your data application workflow (step 3), by connecting to the KNIME Community Hub mount point and uploading the workflow to a team space (step 2).

Step 1/7 – Connect to KNIME Hub

In KNIME Analytics Platform open the Preferences window. In the top right corner, click the Preferences button.

To add the new Hub mount point click KNIME > KNIME Explorer > New…​ in the Preferences window.

The Select New Content window opens. Select KNIME Hub and insert the Hub url, as shown in Figure 12.

12 hub mount point
Figure 12. Add new Hub mount point

For more information refer to the section on how to connect to KNIME Hub in the KNIME Business Hub User Guide.

Step 2/7 – Upload the workflow to KNIME Hub

To upload the workflow to KNIME Hub, right-click it in the space explorer and select Upload from the context menu. Then select the destination Hub in the Destination window as shown in Figure 13. Check the option Reset Workflow(s) before upload and click Ok.

If you are not connected to KNIME Hub, right-click the workflow in the space explorer, select Connect to, and choose your Hub instance.
13 upload to hub
Figure 13. Upload workflow to KNIME Hub

Step 3/7 – Run the workflow on KNIME Hub

To run the workflow with ad hoc execution on KNIME Hub, navigate to the space explorer in KNIME Analytics Platform. Select the Hub space to which you uploaded the workflow as detailed in Step 2. Next, right-click the workflow and select Open in Hub.

Make sure to select your KNIME Hub space instead of your local directory in the space explorer. The option Open in Hub is only available from a Hub space.

Your KNIME Hub instance opens in a new web browser tab. Start by entering your access credentials – username and password. Once signed in, the workflow page appears. In the top-right corner, click Run. Within the ad hoc execution configuration panel on the left, select your execution context.

Click the yellow Run button at the bottom of the panel to execute the workflow. This process is shown in Figure 14. The data app opens in a new tab.

14 open run workflow in hub
Figure 14. Open and run the workflow in an ad hoc execution on KNIME Hub

Finally, for a comprehensive overview of all the ad hoc execution jobs of a specific workflow, navigate to the menu on the right of the workflow page and select Ad hoc executions.

Please bear in mind that an ad hoc execution is always performed on the current version of the workflow from which the run is initiated. To run an ad hoc execution of a workflow from a different space version, consult the KNIME Business Hub User Guide.

Step 4/7 - Create a version of your workflow on KNIME Hub

Upon uploading a workflow to KNIME Hub, different types of deployments can be created. One of them is the data app you are currently setting up. To create a new deployment of a workflow already uploaded to one of your team’s spaces, you first need to have created at least one version of the workflow, as shown in the following:

  • Access the page corresponding to the workflow you want to create a version of by navigating through the KNIME Hub instance. On the workflow page click History.

  • The Workflow history panel will appear on the right, showing all existing versions and unversioned changes of the workflow since the last version was created.

  • Click Create version to create a new version, as shown in Figure 15. Proceed by assigning a name and adding a description to the version.

  • Conclude the process by clicking the yellow Create button at the panel’s base.

The newly created version will be visible within the Workflow history panel on the right.

15 create version hub
Figure 15. Versioning of a workflow

Learn more about versioning in the KNIME Business Hub User Guide.

Step 5/7 - Deploy your workflow as data app

With a version of your workflow now available, you can proceed to deploy it as a data app. On the workflow page in your web browser, click the Deploy button. Adjacent to the Data app option, select the Create data app button. The Create data app panel on the right opens as shown in Figure 16.

16 deploy workflow as data app
Figure 16. Creating a data app deployment for a workflow on KNIME Hub
If the Deploy button is inactive, please make sure you have a created a version of your workflow.

Within the Create data app panel you can:

  1. Assign a name to the deployment under Deployment name.

  2. Select the version you want to deploy. In this instance, you only have the previously created version.

  3. Select the desired execution context

  4. Add a category

  5. Provide a description similar to the process of creating a version. If you added a workflow description in KNIME Analytics Platform it is added automatically to the Description field.

Additionally, you can enable Workflow actions and adjust the Advanced settings. No modifications are necessary for this deployment. Learn more about these features in the KNIME Business Hub User Guide.

After finalizing the deployment settings, conclude by clicking the yellow Create button at the base of the Create data app panel. This process is shown in Figure 16 as well.

Step 6/7 - Manage access to data app deployments

Upon successfully creating a data app for a workflow version, there are two options to control who can access them. Both are detailed in the following and shown in Figure 17.

  • Option 1: Manage access via pop-up notification

Directly after creating your data app, you are prompted to manage access to it by the Data app created pop-up notification, as shown in Figure 17. It emerges at the lower-left corner of the workflow page. By clicking Manage access you can determine who has permission to access your deployment. Inside the Manage access panel that appears on the right of the workflow page, you can locate users and groups using the search function and choose the access type.

Setting the access type to "Any signed in user" will allow every user who has access to the KNIME Hub instance to execute the deployment.

Clicking the yellow Apply button at the panel’s base activates a confirming popup notification at the lower-left corner, verifying that "Deployment access has been updated".

  • Option 2: Manage access from list of all deployments

Manage the individual deployments linked to a specific workflow by navigating to the workflow page on KNIME Hub. Access the list of all deployments by selecting Deployments from the menu on the right, as indicated in Figure 17. This will direct you to a list of all deployments to the bottom of the workflow page.

Click the three points menu at the end of the corresponding deployment row and select Manage access. This opens the Manage access panel.

The three dot menu also offers to run, edit, or delete deployments. Find more about deployment related actions in the KNIME Business Hub User Guide. Take note that depending on the type of deplyoment some actions might not be available.

17 manage access deployment
Figure 17. Two options of managing access to your deployment

Step 7/7 - Data Apps Portal

The Data Apps Portal is a collection of all the data apps that have been shared with you.

You can access the Data Apps Portal by navigating to the address:

https://apps.<base-url>

e.g., apps.hub.example.com

This page is available to every registered user. Consumers, for example, can access this page to see all the data apps that have been shared with them, execute them at any time, interact with the workflow via a user interface, without the need to build a workflow or even know what happens under the hood.

To execute a data app click the corresponding tile. A new page will open in the browser showing the user interface of the data app, as indicated by the green pop-up notification at the bottom of the Data Apps Portal. This process is shown in Figure 18.

18 data apps portal
Figure 18. Execute a data app from the Data Apps Portal

The result is displayed as a single page data app since there is only one component.

The following points about the data app are worth noting:

  • Each page of your data app will depict the execution of one component which encapsulates widgets, views, and intermediate nodes

  • You can define the layout of each component

  • Parts of a page that should be updated after a user input are implemented via a Refresh Button Widget node or the Re-execution tab of a Widget node (optional).

Glossary

Component

A component in Data Apps will provide a composite view as a single page in the browser. In general, a component is an isolated block of logical operations in a KNIME Workflow that can be encapsulated inside a component. A component can have its own configuration dialog and can also be assigned a view. Components enable you to bundle functionality for a particular part of the workflow and allow sharing and reusing. For more information refer to KNIME Components Guide. Widget nodes, View nodes, and Refresh Button Widgets are encapsulated together to form a component in KNIME Data Apps.

Composite View

Composite views contain the interactive views of Widget nodes, Interactive Widget nodes, and View nodes, that are encapsulated within a component. All composite views on the root level also define a web application, accessible through the KNIME Hub. In order to inspect the composite view in KNIME Analytics Platform, once the execution is done, right-click the component and select Open view. The layout of the composite view is also customizable. You can edit the appearance of the component’s composite view with the Visual Layout Editor. For more details refer to the Layout of composite views section.

Widget nodes

You can use Widget nodes inside a component to build a composite view that will be visualized as a web page on the KNIME KNIME Hub. The use of Widget nodes is aimed to set specific configurations, e.g to filter a data table by selecting a value from a specific column. On the web page, you will then be able to enter values for specific parameters before proceeding with the workflow execution. These values are injected into the workflow and used to parameterize its execution.

Interactive Widget nodes and View nodes

You can use Interactive Widget nodes and View nodes inside a component to build a composite view that will be visualized as a web page on the KNIME Hub. View nodes are used to build specific visualizations, like tables, charts, and plots, which are displayed as web pages. Interactive Widget nodes can be also used alongside the View nodes in order to interact with the visualizations directly on the web page.

Refresh Button Widget

You can use the Refresh Button Widget node inside a component to build a composite view that will be visualized as an interactively re-executable web page on the KNIME Hub. Button Widget node creates a button visual element to the data application that allows re-execution of specific nodes thus refreshing the desired visualizations. Consequently, enhancing the flexibility of the visual programming.

Re-execution of Widgets

In addition to the functionality of the Refresh Button Widget node, it is also possible to configure some of the Widget nodes (Selection Widget node and Boolean Widget node) so that the change in their value in the composite view upon user interaction will directly trigger re-execution of the component downstream nodes. You can read more about it in the Re-execution of Widgets section.