Icon

Loop Component Switch Sub Workflow - KNIME Forum (91485)

<p>Store Logic in sub workflows (.knwf) and calling them in a loop using variables</p>

URL: Call knwf sub-workflows - KNIME Forum (91485) https://forum.knime.com/t/dynamically-passing-component-as-input-to-another-component/91485/7?u=mlauber71

Component A

Build individual components like this. It has table input/output ports and contains two essential parts.

  1. The individual logic that is distinct between components A, B…

  2. The core loop

2. Core Loop Component

Build and share the core loop component like this. It will have a workflow input port (black square) and table input/output ports.

0. Individual Logic (workflow_0.knwf)

1. Individual Logic (workflow_1.knwf)

Blog: KNIME - Cases, Switches and Catching Errors

https://medium.com/p/5ab748cbeaa3

Blog: KNIME, Paths and Loops — Automate Everything

https://medium.com/p/213455788685

Chunk Loop Start
Workflow Executor
Capture Workflow End
Put the logic for component A here inbetween the Capture Workflow Start and Capture Workflow End nodes
GroupBy
Capture Workflow Start
Example Data Reader
you have to"Remove input and output nodes"
Workflow Reader
Table View
/data/workflow_1.knwf(use custom wf name)
Workflow Writer
No data needed to capture logic, the table spec is enough in production.
Row Filter
Path to String (Variable)
Loop End
v_port=0v_workflow_name=> switch the workflow names
Variable Expression
create anabsolute path
String to Path (Variable)
Create File/Folder Variables
URL to File Path (Variable)
Put the logic for component A here inbetween the Capture Workflow Start and Capture Workflow End nodes
GroupBy
Capture Workflow Start
No data needed to capture logic, the table spec is enough in production.
Row Filter
/data/workflow_0.knwf(use custom wf name)
Workflow Writer
Capture Workflow End

Nodes

Extensions

Links