I ran into the need of running a KNIME workflow in the background triggered by a python script in my machine.
I found old posts from 2020 about using knimepy but I don’t know if the new version of KNIME will support this approach or whether it is compatible with simple python scripts running locally.
I know the KNIME server could be a solution, but it sounds overkilling to me given that I just want to have it locally in my mac to avoid having to open the KNIME analytics platform to push the button of run workflow.
Thanks @mlauber71 but it did not manage to see the how your workflow can solve my problem.
I am running a python script from Outside KNIME. Running this python script should trigger a KNIME workflow, which results in generation of a CSV file in my computer. Then I use the results of this file to continue working outside of KNIME.
At the moment I have crafted the following python script that I am running from VS code:
import knime
knime.executable_path = "/Applications/KNIME 5.3.0.app/Contents/MacOS/knime"
workflow_path = "/Volumes/.../BAG system"
with knime.Workflow(workflow_path) as wf:
wf.execute()
output_table = wf.data_table_outputs[0] # Retrieve first output table
print(output_table)