Nesting Tools and reusing logic
The Tool Builder allows you to create modular workflows by nesting tools and reusing logic across multiple workflows. This feature promotes efficiency, consistency, and scalability by enabling you to reference existing tools within new workflows. Below is a guide on how to effectively nest tools and map parameters correctly.
What is Tool Nesting?
Tool nesting refers to the ability to use one tool as a step within another tool. This allows you to:
Reuse existing logic without duplicating steps.
Break down complex workflows into smaller, manageable components.
Maintain consistency across workflows by centralizing shared logic.
For example, you can create a reusable tool for fetching customer data from a CRM and reference it in multiple workflows that require customer information.

Example of using Tool nesting and Logical conditions
How to Reference a Tool
When referencing a tool, you include it as a step in your workflow. The referenced tool will execute its logic and return its results to the parent workflow.
Steps to Reference a Tool:
Add a Tool Step:
Select the tool you want to reference from the list of available tools.
Parameter Mapping:
Map the parameters of the referenced tool to the appropriate variables or values in the parent workflow.
Each required parameter in the referenced tool must be assigned a value to ensure proper execution.
Example:
If the referenced tool requires parameters like
AccountId
,email
, andClientId
, you need to map these to variables or static values from the parent workflow.
Execute the Workflow:
Once the parameters are mapped, the referenced tool will execute as part of the parent workflow, using the provided inputs.
Note: Correct parameter mapping is essential for the successful execution of nested tools. Parameters define the inputs required by the referenced tool, and these must be supplied by the parent workflow.
Benefits of Nesting Tools
Logic Reuse:
Avoid duplicating logic by centralizing shared functionality in reusable tools.
Update the logic in one place, and all workflows referencing the tool will automatically reflect the changes.
Modularity:
Break down complex workflows into smaller, reusable components, making them easier to manage and debug.
Scalability:
Create a library of reusable tools that can be referenced across multiple workflows, reducing development time for new workflows.
Consistency:
Ensure consistent behavior across workflows by reusing the same logic for similar tasks.
Best Practices for Nesting Tools
Design Reusable Tools:
When creating tools, design them with reusability in mind. Use generic parameter names and avoid hardcoding values.
Document Parameters:
Clearly document the parameters required by each tool to make it easier for others to reference and map them correctly.
Test Independently:
Test each tool independently before referencing it in other workflows to ensure it functions as expected.
Avoid Over-Nesting:
While nesting tools is powerful, avoid excessive nesting as it can make workflows harder to debug and maintain.
Use Descriptive Names:
Name your tools and parameters descriptively to make their purpose clear when referenced in other workflows.
By leveraging tool nesting and parameter mapping effectively, you can create modular, reusable, and scalable workflows that save time and ensure consistency across your processes.