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 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?
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
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:
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”.
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)
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.