Skip to content

Subgraph Wrapper

Sudhanshu edited this page Nov 11, 2026 · 1 revision

HR/IT Wrapper Subgraph (Different State Schemas)

flowchart TD
 S([START: HRState]) --> WELCOME["HR_Welcome_Node"]
 WELCOME --> WRAP["IT_Wrapper_Node: call_it_department"]
 subgraph IT["IT subgraph: ITState"]
  IS([START]) --> EMAIL["Create_Email_Node"] --> LAP["Assign_Laptop_Node"] --> IE([END])
 end
 WRAP --> MAP["Map employee_name -> new_hire_name; invoke IT"]
 MAP --> IS
 IE --> NOTES["Map assets -> HR hr_status"]
 NOTES --> E([END: HRState])
Loading

example_subgraph_wrapper() builds an IT subgraph with ITState(new_hire_name, assets), then invokes it inside the parent IT_Wrapper_Node. The parent graph uses a different HRState(employee_name, hr_status).

The wrapper maps input from employee_name to new_hire_name, calls the compiled IT graph, and maps output assets back into the parent hr_status string. The IT steps create a sample company email and assign a MacBook Pro in a local simulation. There are no real provisioning APIs.

This is a pattern for modular task decomposition and schema isolation, not an autonomous HR and IT AI-agent exchange.

Clone this wiki locally