How to monitor KNIME workflow status

Dear all,
I created a workflow where I’m using KNIME for Data preparation activities. The workflow works good so far as it’s not very complicated :slight_smile: but now I have the challenge how to monitor whether the execution of KNIME is finished/in progress/etc. as some of the workflows can take up to a minute and I don’t want to hardcode any delay time. Has anyone a good proposal for it?

regards

Hi.
Can you use in knime workflow some excel writer node to write the status of the workflow and test it in uipath with File Change Trigger activity?
Regards
HA

Hi @eugen.prinz, you could find some hints here Possible to create a popup message - #7 by RonG - KNIME Analytics Platform - KNIME Community Forum
Good luck,
Kaz

One possible solution is to use a Python script to monitor the execution status of your KNIME workflow. You can use the KNIME REST API to query the status of the workflow execution and update the status accordingly.

Here are the high-level steps you can follow:

  1. Enable the KNIME REST API: In KNIME, go to File → Preferences → KNIME → RESTful Web Services and enable the option “Allow access to the REST API”.
  2. Create a Python script: You can use any Python library that can make HTTP requests, such as requests or urllib, to call the KNIME REST API. Here’s an example Python script that polls the KNIME REST API every 5 seconds to check the status of the workflow execution:

pythonCopy code

import time
import requests

workflow_id = "your_workflow_id"
knime_url = "http://localhost:8080/knime/rest/v4"

while True:
    response = requests.get(f"{knime_url}/executions/{workflow_id}")
    status = response.json()["status"]
    print(f"Workflow status: {status}")
    if status in ["FAILED", "ABORTED", "COMPLETED"]:
        break
    time.sleep(5)

Replace “your_workflow_id” with the ID of your KNIME workflow, and “http://localhost:8080/knime/rest/v4” with the URL of your KNIME server.

  1. Integrate the Python script with your workflow: You can call the Python script as an external program from your workflow using the “External Tool” node in KNIME. Configure the node to execute the Python script, and connect it to the end of your workflow. This will ensure that the Python script is executed after the KNIME workflow has completed.

Once you’ve integrated the Python script with your workflow, you can run the workflow and monitor the status of the execution in real-time using the console output from the Python script.

1 Like