# Call the workflow table based on the variable that does not accept with the path

**URL:** <https://forum.knime.com/t/call-the-workflow-table-based-on-the-variable-that-does-not-accept-with-the-path/77150>\
**Category:** KNIME Analytics Platform\
**Created:** [February 9, 2024, 8:37am UTC](https://forum.knime.com/t/call-the-workflow-table-based-on-the-variable-that-does-not-accept-with-the-path/77150 "2024-02-09T08:37:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![cridiaz](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/c/45deac/32.png) [@cridiaz](https://forum.knime.com/u/cridiaz)\
**Post date:** [February 9, 2024, 8:37am UTC](https://forum.knime.com/t/call-the-workflow-table-based-on-the-variable-that-does-not-accept-with-the-path/77150/1 "2024-02-09T08:37:16Z")

</div>

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?

 ![CallWkf](https://forum-cdn.knime.com/uploads/default/original/3X/6/6/660dafecd685fbaf1f0edf3f9dcd8e44a7cc4dce.png)

If it’s not possible with table based is it possible in some other way? The important thing is that you can call via variable  
If it helps, the main wkf and the one called are in two different paths

---

<div class="post-metadata">

**Author:** ![AlexanderFillbrunn](https://forum-cdn.knime.com/user_avatar/forum.knime.com/alexanderfillbrunn/32/357_2.png) [@AlexanderFillbrunn](https://forum.knime.com/u/AlexanderFillbrunn)\
**Post date:** [February 12, 2024, 8:52am UTC](https://forum.knime.com/t/call-the-workflow-table-based-on-the-variable-that-does-not-accept-with-the-path/77150/2 "2024-02-12T08:52:17Z")

</div>

Hi,  
Have you tried the [Call Workflow Service](https://kni.me/n/EkT0WUPnhzoKf3YG) together with [Workflow Service Input](https://kni.me/n/SjCp1LKYnOOV8KMB) and the corresponding [Workflow Service Output](https://kni.me/n/9xSDVHDks-V8M3VU) 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).  
Kind regards,  
Alexander

---

<div class="post-metadata">

**Author:** ![cridiaz](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/c/45deac/32.png) [@cridiaz](https://forum.knime.com/u/cridiaz)\
**Post date:** [February 12, 2024, 9:08am UTC](https://forum.knime.com/t/call-the-workflow-table-based-on-the-variable-that-does-not-accept-with-the-path/77150/3 "2024-02-12T09:08:41Z")

</div>

Hi, thanks, no I haven’t tried the call workflow service, I’ll try to find some examples

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [February 12, 2024, 12:36pm UTC](https://forum.knime.com/t/call-the-workflow-table-based-on-the-variable-that-does-not-accept-with-the-path/77150/4 "2024-02-12T12:36:36Z")

</div>

@cridiaz I can offer these examples. Best to load the whole workflows group each.

This one communicates between main and sub workflow via JSON files

> **[Call sub workflow from a main KNIME workflow – mlauber71](https://hub.knime.com/mlauber71/spaces/Public/kn_example_call_workflow/a_001_main_workflow~uPGki0nVinczB7SZ/current-state)**
>
> Call sub workflow from a main KNIME workflow. Communicate between them via JSON files

This example exchanges tables and Flow Variables between main and sub:

> [@Call workflow table based not accepting variable with path](https://forum.knime.com/t/call-workflow-table-based-not-accepting-variable-with-path/48189/6):
>
> @lelloba you could try the new: It seems it would accept String variables (as realtive paths):

---

<div class="post-metadata">

**Author:** ![cridiaz](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/c/45deac/32.png) [@cridiaz](https://forum.knime.com/u/cridiaz)\
**Post date:** [February 13, 2024, 7:50am UTC](https://forum.knime.com/t/call-the-workflow-table-based-on-the-variable-that-does-not-accept-with-the-path/77150/5 "2024-02-13T07:50:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [February 13, 2024, 8:15am UTC](https://forum.knime.com/t/call-the-workflow-table-based-on-the-variable-that-does-not-accept-with-the-path/77150/6 "2024-02-13T08:15:43Z")

</div>

@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.

> [@use data from another workflow into current workflow](https://forum.knime.com/t/use-data-from-another-workflow-into-current-workflow/45698/2):
>
> @sanderlenselink you can call a KNIME workflow from another one and transfer data to that workflow: What you want to keep in mind is that you will have to make sure what data is created when and do you have the relevant status. KNIME does that via Flow Variables and Workflow orchestration. I would suggest to combine the approaches. Transfering data via KNIME table should be stable:

There is another framework where you can execute something like a compacted workflow called “[Integrated Deployment](https://hub.knime.com/knime/extensions/org.knime.features.buildworkflows/latest)”:

[https://docs.knime.com/latest/integrated\_deployment\_guide/index.html#introduction](https://docs.knime.com/latest/integrated_deployment_guide/index.html#introduction)

> **[parent – armingrudd](https://hub.knime.com/armingrudd/spaces/Public/Workflows/Calling%20knwf%20with%20a%20relative%20path/parent~3ADGZwzphmZGgKus/current-state)**
>
> Solutions for data science: find workflows, nodes and components, and collaborate in spaces.

---

<div class="post-metadata">

**Author:** ![cridiaz](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/c/45deac/32.png) [@cridiaz](https://forum.knime.com/u/cridiaz)\
**Post date:** [February 20, 2024, 1:39pm UTC](https://forum.knime.com/t/call-the-workflow-table-based-on-the-variable-that-does-not-accept-with-the-path/77150/7 "2024-02-20T13:39:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [February 20, 2024, 1:50pm UTC](https://forum.knime.com/t/call-the-workflow-table-based-on-the-variable-that-does-not-accept-with-the-path/77150/8 "2024-02-20T13:50:44Z")

</div>

@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.

> [@Call workflow table based not accepting variable with path](https://forum.knime.com/t/call-workflow-table-based-not-accepting-variable-with-path/48189/6):
>
> @lelloba you could try the new: It seems it would accept String variables (as realtive paths):

A basic [batch](https://www.knime.com/faq#q12)/cmd file might look like this:

```auto
REM Set the path to your KNIME executable (Windows)
set KNIME_PATH=C:\Users\%USERNAME%\software\knime_4.7.0\knime.exe

REM Set the path to your workflow directory (the workflow you want to run)
set WORKFLOW_DIR=C:\Users\%USERNAME%\knime-workspace\KNIME_Batch\KNIME_Batch_Workflow

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
set STRING_VAR_NAME=var_data_path
set STRING_VAR_VALUE=C:\Users\%USERNAME%\knime-workspace\KNIME_Batch\data\

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%" ^
-workflow.variable=%STRING_VAR_NAME%,%STRING_VAR_VALUE%,String

```

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.

![image](https://forum-cdn.knime.com/uploads/default/original/3X/3/8/38496c1bce9717003ea4322ad4567de07c5a520e.png)

![image](https://forum-cdn.knime.com/uploads/default/original/3X/1/4/145085a8999af7f7385fd944e38d9dc0a192fa24.png)

---

<div class="post-metadata">

**Author:** ![cridiaz](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/c/45deac/32.png) [@cridiaz](https://forum.knime.com/u/cridiaz)\
**Post date:** [February 20, 2024, 3:02pm UTC](https://forum.knime.com/t/call-the-workflow-table-based-on-the-variable-that-does-not-accept-with-the-path/77150/9 "2024-02-20T15:02:14Z")

</div>

thx i will try soon 🙂

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [March 13, 2024, 7:46am UTC](https://forum.knime.com/t/call-the-workflow-table-based-on-the-variable-that-does-not-accept-with-the-path/77150/10 "2024-03-13T07:46:08Z")

</div>

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