'Relative to' 'Current workflow data area' in Agent Workflow on KBH

Dear All,
I would like to use the ‘Relative to’ ‘Current worflow data area’ setting inside a Tool workflow of an Agent Workflow (KAP 5.8.2 and KBH 5.8.2).

In the Tool workflow, files are transfered from a sharepoint, stored into a temp folder in the Tool workflows data folder and processed by a python script. For the temp folder creation, I am using the Create Temp Folder node with the setting ‘Relative to’ ‘Current workflow data area’ and as folder ‘input’.

If I execute the Tool workflow outside of the Agent, the file is correctly saved (Toolworkflow/data/input/knimetemp-XXXX/file) and accessible by the python script via the path ./data/input/knimetemp-XXXX/file.

If I execute the Agent workflow, I would expect that the input folder is created inside the data folder of the Agent workflow as the Tool workflow is only executed virtually. When I double check I do not find the input folder, the knimetemp folder nor the file inside the Agent workflow nor the Tool workflow. The Agent provides me only with an error message that downstream of the python script nodes could not be executed as the output of the python script are missing. (Same behaviour in local KAP 5.8.2 and KBH 5.8.2)

I also tried ‘Mountpoint’ ‘knime-business-hub’ and ‘Mountpoint’ ‘knime-temp-space’ in the Create Temp Folder node as well as connecting it via the Knime Hub Authenticator and Space Connector node to the Hub Space (HubSpace/knimetemp-XXXX/file). In all my attempts, the python script (incl. knio for file path) of the Tool executed by the Agent was not able to find the transfered file on the KBH.

I do not understand, how the ‘Relative to’ ‘Current workflow data area’ / ‘Current workflow’ works for Agent workflows (both locally and on the Hub with its Executor & Jobs)?
Also what needs to be done to get the absolute path (e.g. of a file stored in a temp folder under the Hub Space) resolved inside a python script of a Tool workflow executed by an Agent workflow?
Is there an option, to visualize virtually Tool workflows for bug fixing?

Could anyone please help?

Thank you in advance,
Armin

Hey there,

I think right now relative to paths inside tools dont work. If I recall correctly the issue is that tools are executed in their on virtual environment and the path resolution always points to the main agent.

There are a couple of topics related to the issue where moutpoint relative paths might be a solution (that said not inside the data folder…):

2 Likes

Hi @MartinDDDD ,

thank you very much for the reply. I had set up an agent with tools which was running fine in KAP (5.5.1) and KBH (5.5.2) based on Mointpoint paths. Since the update to KAP and KBH to 5.8.2 the Mointpoint solution is no longer working for me.

Thank you very much for clarifying:image

I am not sure what “in their own virtual enviroment” means: Does this mean the Extract Context Property node in a tool workflow will have a tool specific Job ID? Or will it show the Agent Job ID? In my previous 5.5.1/2 solution, I used the Agent JobID to assign the tool outputs to the respective Agents Jobs by using extracted context to load/save job-specifically data. It seems not work right now in my current Agent/Tool version & 5.8.2 setup.

I also tried the mlauber71 provided solution (ProductGroupDataRetrieval). It works for me only locally, not on the Hub.

I am now trying absolute paths. The point is, one of the tools needs python scripts to process files now stored in my data folder (since relative & mountpoints are not working). The issue is, I do not find a way to resolve the “knime://knime-business-hub/Users/TEAM/MEMBER” absolute path inside the script. I am using knio in the Python Script node and this seems not to work:

Do you know how to resolve absolute paths inside python scripts (inside tool workflow)? In addition, is there any documentation how agents & tools interact on the Hub?? Any thoughts/ideas on the how of the Agent/Tool interaction i.e. Job specific data collection/exchange are highly wellcome.

Best, Armin