Hi, I have a main workflow that I use several times with different input files. I would need to call a second workflow via variable workflow, I tried the Call Workflow (Table Based) but I can’t pass the path of the second workflow.The path written directly in the node works correctly, can anyone help me?
Have you tried the Call Workflow Service together with Workflow Service Input and the corresponding Workflow Service Output nodes? Call Workflow Service definitely works with flow variables, I have done it before. It is also the better option if you do not want to invoke the callee workflow from outside of KNIME, as it uses a more efficient proprietary format for data representation (Call Workflow (Table Based) uses JSON).
Thank you both for the proposed solutions I will do some testing I only have one other question when I launch it in batch mode the called wkf must be in the same work directory as the caller or it can be in another path and how should I indicate the path
Thank you @mlauber71 thank you, I had seen your examples and it was from those that the idea came from but I couldn’t quite understand how it worked
@cridiaz I reworked some of the workflows and updated to the new call workflow environment. This now seems to be easier to understand. You configure a sub-workflow with inputs and outputs and then you point the main-workflow to the sub-workflow and apply the settings so magically the input and output ports will appear like in the sub-workflow. And I think you can then work with them.
Another example just stores data locally and then loads them in the sub-workflow but maybe that is not so elegant.
There is another framework where you can execute something like a compacted workflow called “Integrated Deployment”:
Hello thank you @mlauber71 I didn’t understand in your first example that it has the call to another wkf via JSON I always have the problem of knowing how and where I should put the wkf that I have to recall because in my case I have the first wkf that I call DB_GEN in a path saved as zip and launched via batch and the second which I call LK always in zip and which I should use in the first but I don’t know if I should copy it into the work folder of the first
@cridiaz from my experience it would be best to provide the paths via a workflow variable in the batch. The path should not have any blanks or funny characters. You can call the sub-workflow directly and do not need to use the JSON communication.
REM Set the path to your KNIME executable (Windows)
REM Set the path to your workflow directory (the workflow you want to run)
REM Set a string variable to pass to the workflow (a variable to bed used in workflow)
REM you have to define them as workflow variable in in WF
REM Run KNIME in batch mode with the specified workflow, string variable, proxy settings, and save the log output
"%KNIME_PATH%" -reset -nosave -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir="%WORKFLOW_DIR%" ^
You would have to set the “var_data_path” as Workflow Variable in the workflow. That would later be replaced by the value sent thru the CMD batch file.