How to get workflow description from metadata programatically

Hi Team,

In my NodeModel, how can I programatically get the current workflow’s description which is part of the metadata of the workflow?

WorkflowManager.getCustomDescription() did not return me anything.

Thanks
Ravikiran

Hi @ravikiran,

you can the description of a component but not of the workflow. The workflow metadata view reads the metadata file from disk directly, but that is not accessible from a node:

Can I ask you why you want to read that data from a node? We did not consider anyone ever wanting to do that before.

best,
Gabriel

Dear Gabriel,

Thanks for looking into this. We would need this workflow description in order to document the workflows deployed to our server based tool LiveDesign: we have a node similar to your Deploy workflow to Server node that wrap up the workflow it runs in and deploy it on the LiveDesign server.
So we would have to ready the information directly from the disk file, right?
Best,

Jean-Christophe

I played around with importing the XML files of the workflows. Maybe you can adapt such an approach.

https://hub.knime.com/mlauber71/spaces/Public/latest/kn_example_metasearch/

1 Like

The workflow looks good but we need the KNIME java apis to call them from my NodeModel. I.,e we need to get the workflow description programmatically and not by running another workflow.

Thanks
Ravikiran

Yes, there is currently no other way, you are looking at the workflow data anyway when you are deploying it to the server so that shouldn’t be too difficult.

best,
Gabriel