Is there any node or method inside KNIME to automatically retrieve the current workflow (.knwf) name?

Hi everyone,
I’m working with KNIME (version 5.4.x) and I have a question regarding workflow metadata access.
Inside a KNIME workflow, I want to automatically obtain the name of the current workflow file.
For example:

  • Workflow file name: Child01
  • I want to automatically get "Child01" inside the workflow

Use cases include:

  • Automatically naming log files
  • Adding workflow name into run history
  • Auto-naming output files
  • Let each sub-workflow identify itself dynamically

What I have already tried

  1. Java Snippet / Java Edit Variable (failed)
    I attempted to access workflow manager APIs, e.g.:
getWorkflowManager().getProject().getName();

However, in KNIME 5.x these methods do not seem to be exposed to Java Snippet anymore, resulting in:

The method getWorkflowManager() is undefined for the type JSnippet

So reading the workflow name directly from Java Snippet is not possible.

2. Flow Variables (manual setup, not suitable)

I can manually define a variable like workflow_name,
but what I need is:

Automatically retrieving the workflow name, without manually typing it.

My Question

:backhand_index_pointing_right: Is there any built-in node or official method in KNIME that allows retrieving the current workflow name automatically?

Thanks.

Hi,

yep it can be done with

For example:

Andreas

8 Likes

Thank you very much for your suggestion!
I will try the Extract Context Properties node and see if it can retrieve the workflow name.
Really appreciate your help!

1 Like

Have you had a look at the Extract Context Properties node?

1 Like

Sorry… Too late Andreas was faster than me

1 Like

Thank you, Marc_Goossens.
Your proposed solution works very well.
I really appreciate the continuous support from the professional KNIME team.

1 Like

Andreas!
Your solution works perfectly.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.