# Multi-node templates Code Workbook supports multi-node templates for templatized workflows. A template can be created from multiple other templates, and you can bind the values of parameters in these templates together. The following example uses `titanic_dataset` to templatize a workflow selecting two numeric columns and plotting them in two graphs. The first graph is a scatterplot of the two numeric columns. The second plot is a histogram of whether or not the passengers survived, based on filtering on the numeric columns. Here is a visual overview of the workflow we are templatizing: ![mnt\_workflow.png](../../../assets/2dfc1362facb9ee410ba5663a462cc8fd06d6bc61c869f9c34c505c3d6b2cb48.webp) ## Creating Templates First, create a template selecting two numeric columns from the input dataset, along with `Survived`. Title this template `Filter`. ![filter\_template](../../../assets/cce12f442ff8bedd01a6d3ea989ceffc3b13c682eda1681ee99bb29248047a5f.webp) Second, create a template plotting a scatterplot of the two numeric columns, reading the input dataset in as a Pandas dataframe. Title this template `Scatterplot`. ![scatterplot\_template](../../../assets/9a0566859f0f6723719ea586a2517c98312d3562eb6434df889dea7efd597edb.webp) Finally, create a template that filters the input dataset based on the two numeric columns and two templatized inputs, reading the input dataset in as a Spark dataframe. ![filter\_then\_histogram](../../../assets/e40e1144f31a635bf2da6e7659c4356ce640b5d378dc3f3097c541ca4569aa2d.webp) ## Creating Multi-Node Templates Select all three templates and right-click to open the menu, then select **Create new template**. You should now see the template editor. ![creating\_multi\_node\_template](../../../assets/c6fc67d177160d9ce76b663d2331dbf97920f73795b0b2eb625e34bb44f6f653.webp) We want to link the values of the `col1` parameters, and link the values of the `col2` parameters. First, click into the `Filter` template. Click into `col1`, and select **Create shared parameter** in the dropdown. ![shared-mnt-parameter](../../../assets/b54c26877c815152819f0e0d616d789fdd155357428ea6aae07fcef4db972fed.webp) On the right-hand side, a new parameter titled `col1` has been created. Select `titanic_dataset` as the source dataset in the right-hand pane. Then, click into the two other templates and choose to link `col1` to the new `col1` Multi-Node Template parameter. Repeat for `col2`, and then save the multi-node template. ## Using Multi-Node Templates The three templates we previously created are now part of a multi-node template. Click into the `Filter` template. Next to the `col1` and `col2` parameters, there is an icon indicating this parameter value is controlled by the multi-node template parameter. ![mnt\_logic\_pane\_1](../../../assets/58d8691192ee23c1d1e5b107c71c84e4920bccef0a336db14240bdcbd543487f.webp) Select `View Group` at the top of the pane. You now see a view highlighting the nodes in the Multi-Node Template, and listing the shared parameters in the template. You can change the value of `col1` and `col2` in this view, and all instances in the three nodes will also be changed. ![mnt\_logic\_pane\_2](../../../assets/e6c5c2ee802f52adcac78c5264b2108353d1b567e9d8660722511bd692805227.webp) If you change the value of a shared parameter in the child node pane, the value will also be changed for all instances in the multi-node template. Add a new instance of this template. ![add-new-mnt-titanic.png](../../../assets/15bf41ce65d15c93bbc07cff245a669564f467630f63de03246a748df1e167cb.webp) Analyze `Fare` and `PClass`. By selecting these two columns in the view for the child node, notice that you are setting the column values across the group. ![mnt\_workflow\_new\_instance](../../../assets/b7a47bbc82f65c203aa270c55636bcf111af140e74b58941ccb6da89c869ca47.webp) Then, update the cutoff values in `Filter then histogram`. Run the templates to create the same graphs for a different set of numeric columns.