Tag of Workflows

Hi,

For security concern, my company asks us to “tag” each workflows with a data classification (like MS Office files) for data conained in Knime WF.

I’ve a looooot of workflows in knime and doing it one by one will take me a lot of time.

The tag must be entered in Workflow Description.

I’m wondering if there is a way to tag all my workflows (that are saved locally), via a batch file or a script or a knime WF or via another way ?

Thank you.

Hi,
So I think the Tags are stocked in workflow-metadata.xml of each workflows/folders.
and I think a massive change would consist in listing all WF, then edit (or create if it doesn’t exist) each workflow-metadata.xml by injecting those lines in the XML.

    <tags>
        <tag>TAG1: NON-PERSONAL</tag>
        <tag>TAG2: HIGHLY RESTRICTED</tag>
    </tags>

Do you think this is possible via knime directly ?

Hi @Zarkoff95 , it can probably be achieved, but I first have some questions:

  • How do you know what tag(s) to give each workflow?

    Will you have a data file/table with a list of workflow names which match exactly the name of each workflow, and the tag that is required?

  • Do you as a first step need to use KNIME to get a list of all your workflows, so you can supply the list of tags?

  • Do you intend this to be a continual process (e.g. execute it each week), with workflow tags added/updated on regular basis (in which case you need to ensure you don’t double-tag any previously tagged workflows each time), or will they be tagged manually after this “one-off” run.?

btw, as a starting point, if you were to download, disconnect and expand my component “recent workflows” this contains the code that will return you all the workflow folders within your current KNIME workspace.

It searches for the workflow.knime file in each, but it’s only a small step to read the workflow-metadata.xml file from the same folder.

Big warning though: if you are going to attempt to programmatically modify a knime workflow metadata file (e.g. workflow-metadata.xml), please do make sure that you have taken a full backup of your entire workspace first!!

2 Likes

@takbb
Thank you for taking the time to answer.

Here is my answer:

Yes, ideally that’s what I would do:

  • Have an output of all “workflow.knime”.
  • import in excel (or else)
  • add 4 tags I’ve to add to all my workflow (1 by column, it’s always 4)
  • Reinject as a table in knime
  • create the workflow-metadata.xml if it doesn’t exit,
  • and/or add
  • <description/> <tags> <tag>TAG1: Answer</tag> <tag>TAG2: Answer</tag> <tag>TAG2: Answer</tag> <tag>TAG4: Answer</tag> </tags>

Yes, I already tried to do it. I’ve a list of all “workflow.knime”.
(I have adapted a workflow I found here link)
But I don’t find a solution to check if the file exists (or I didn’t find how to setup the javasnippet).
Also, I’m not an expert in XML Manipulation. But I always happy to learn
Thank you your Knime, I’ll have a look.

Yes, after this massive update, I will tag manually when I create a new WF.
But If I could check where it’s missing time to time it would also help.

Yes, I’ll save everything, and do a first run on a little set of knime WF that became obsolete.

Thank you so much.

1 Like