Dynamically introducing nodes in a workflow

Hi All,

I am a bit of noob to KNIME community and I have been fiddling around KINME in the past few weeks and I have found it incredibly powerful and well documented.

I was wondering if there way to dynamically introduce a node between two existing nodes in a workflow automatically during runtime? I will explain my requirement in detail below.

Currently I am able to read the workflow.knime xml node to get the meta details about an existing workflow. However, I am seeking to add some nodes to an existing workflow depending on presence or absence of the some nodes which I detect thru the reading of workflow.knime xml file. So I am wondering if there is a way to programmatically or thru other knime nodes, that I can dynamically introduce some nodes to an existing workflow during runtime.

Thanks in advance for the help. Please let me know if the requirement is not clear.


1 Like

KNIME is based on Eclipse and so is, itself, heavily extensible if you’re skilled in Java. There’s very little you can’t cajole KNIME into doing if you’re prepared to programmatically alter it.

The easiest way to make yourself comfortable with modifying KNIME would probably be to create a new KNIME node yourself, so you can become familiar with some of the architecture (as well, you should learn about Eclipse’s source code; you’ll be wanting to invoke existing Eclipse GEF Command subclasses that exist in the KNIME code base like CreateNewConnectedNodeCommand.) You use this as an initial reference base: https://www.knime.com/developer-guide

I can’t speak to what portions of the KNIME codebase are officially publicly supported for development help - but it’s all Java, and so endlessly decompile-able and mutable.

Oh thanks for the reply!

But do you reckon there is a way to do it within KNIME currently, without extending KNIME per se?

Were it only a single XML file that dictated the existence of nodes in a workflow, then i would say ‘you could hack-ily sew in new nodes by inserting new elements into the XML,’ however a workflow (if you look at the filesystem) contains actual assets that need to be created.

To that extent, there is no existing publicly available KNIME node which does basically an “add a new node to the workflow referenced at this filesystem point between the nodes with IDa and IDb, connecting port number X to number Y.” (… but you could write one …)

1 Like

Thank you for taking the time! I understand. I just needed to be sure.

1 Like