Icon

Group 1 - Define a tool (AI free!)

<p><strong>Agentic AI Learnathon - Group 1</strong></p><p>In this exercise you will develop a simple tool that has access to employees information. For a selected employee, this tool retrieves the employee's location and the number of employees at that location. You will also practice how to transform a workflow into a callable workflow and set the tool description.</p>

Group 1 - Define a tool (AI free! 🧑‍🌾)

🛠️ Tool - Employee Location


In this exercise you will develop a simple tool that has access to employees information. For a selected employee, this tool retrieves the employee's location and the number of employees at that location. You will also practice how to transform a workflow into a callable workflow and set the tool description.



Step 5. Number of employees at selected employee's location

  1. Connect the nodes from Step 3 and 4 to a new Value Lookup node. Use Location as lookup column and key column.

  2. Configure a Column Filter node to keep only the columns

    • Employee ID

    • Name

    • Location

    • Num Employees



📊 (Optional) Step 6. Create a dashboard to explore the data

  1. Calculate the number of employees in each department.

    1. Connect the output of the Joiner node from Step 2 to a new Row Aggregator node.

    2. Select Department as category column and the Occurrence Count aggregation method.

  2. Visualize the number of employees in each department with a Bar Chart node.

  3. Similarly, visualize the number of employees in each location by connecting the output of the Column Renamer node from Step 4 to a Pie Chart node.

  4. Create a simple dashboard by wrapping up the two visualization nodes in a component.



Step 8-9. Tool definition

This is the last step of the exercise! Come back here once you have completed the other steps. Open the metanode and follow the instructions.



📝 Example input

This table shows an example input to use during development. In Step 9, you will replace this example with the actual input from the caller.



Step 1. Read employee data files

The Reader nodes read the files of employees data.

  1. Use a Concatenate node to stack the three tables in a single table. Add more input ports with the plus button ⨁.



Step 2. Merge office location info

The table in the CSV Reader node contains the office location for each employee.

  1. Add a Joiner node to merge the employee data from the Concatenate node in Step 1 with the information from the CSV Reader node (Location information).

  2. In the configuration of the Joiner node, select the Employee ID as matching column for the top and bottom tables.



Step 3. Lookup location of selected employee

  1. Add a Value Lookup node and connect

    • the Table Creator (Example employee) to the top input

    • the first output of the Joiner node from Step 2 to the bottom input.

  2. Use the Employee ID as both the lookup column and key column.



Step 4. Count number of employees by location

  1. Add a Row Aggregator node and connect it to the Joiner node from Step 2. Select Location as category column and the Occurrence Count aggregation method.

  2. Configure a Column Renamer node to rename the column OCCURRENCE_COUNT to Num Employees.



Step 7. Configure the tool output

Remember that a tool is a workflow that can be called by a caller, receive data from it, and send data back to the caller.

This tool retrieves the selected user's location and the number of employees in that location, and sends it as a JSON object to the caller workflow.

  1. Convert the data table into a JSON using the Columns to JSON node.

  2. Add a Container Output (JSON) node. In its configuration, click the button "Fill example JSON from input data".
    This is the output produced by the tool given the example input.

  3. Move back to the beginning of the workflow and complete Step 8 and 9, where you will set the tool description and configure the tool input.



Employees with e0100 ID
CSV Reader
Combine the employee tables
Concatenate
Location information
CSV Reader
Merge location info
Joiner
DB Table Selector
Aggregate by Department
Row Aggregator
Convert columnsto JSON object
Columns to JSON
Employees with e0300 ID
Excel Reader
Employees with e0200 ID
DB Reader
Num Employeesat the employee'sLocation
Value Lookup
Visualization
Example employee
Table Creator
Keep only the Employee ID,Name, Location,and Num Employees
Column Filter
Tool definition
Container Output (JSON)
Aggregate by Location
Row Aggregator
Find data for employee of interest
Value Lookup
H2 Connector
Rename Occurrence toNum Employees
Column Renamer

Nodes

Extensions

Links