Skip to content

Commit 8bc4a32

Browse files
User/ankurrana/supporting phase 1 workday topics (#431)
Supporting new scenarios in Workday
1 parent 743fc10 commit 8bc4a32

11 files changed

Lines changed: 2064 additions & 0 deletions

File tree

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
# Workday Get User Profile
2+
3+
This scenario enables employees to retrieve their profile information from Workday through a conversational interface. It provides comprehensive employee data including personal details, employment information, contact details, and tenure calculations.
4+
5+
## Features
6+
7+
- **Personal Information**: Name, Date of Birth, Gender
8+
- **Employment Details**: Employee ID, Business Title, Organization/Department, Manager, Location
9+
- **Contact Information**: Work Email, Work Phone, Home Email, Home Phone, Home Address
10+
- **Employment Status**: Active/Inactive status, Hire Date
11+
- **Tenure Calculation**: Continuous Service Date and calculated Length of Service (years, months, days)
12+
13+
## Trigger Phrases
14+
15+
Users can activate this topic with phrases like:
16+
- "What is my profile?"
17+
- "Show my profile"
18+
- "What is my employee ID?"
19+
- "What is my job title?"
20+
- "What is my work email?"
21+
- "Who is my manager?"
22+
- "What department am I in?"
23+
- "What is my tenure?"
24+
- "How long have I been with the company?"
25+
- "What is my hire date?"
26+
- "Am I an active employee?"
27+
28+
## Files
29+
30+
| File | Description |
31+
|------|-------------|
32+
| `topic.yaml` | Main Copilot Studio topic definition |
33+
| `msdyn_HRWorkdayHCMEmployeeGetUserProfile.xml` | XML template with XPath extractions for profile data |
34+
35+
## Workday APIs Used
36+
37+
| API | Service | Version | Purpose |
38+
|-----|---------|---------|---------|
39+
| `Get_Workers` | Human_Resources | v45.0 | Retrieve comprehensive employee profile data |
40+
41+
## Data Retrieved
42+
43+
The topic extracts the following fields from Workday:
44+
45+
| Field | XPath Source | Description |
46+
|-------|--------------|-------------|
47+
| `EmployeeID` | Worker_Data/Worker_ID | Employee's Workday ID |
48+
| `Name` | Worker_Descriptor | Employee's full name |
49+
| `DOB` | Personal_Information_Data/Birth_Date | Date of birth |
50+
| `Gender` | Gender_Reference/@Descriptor | Gender |
51+
| `BusinessTitle` | Position_Data/Business_Title | Job title |
52+
| `Organization` | Organization_Reference (SUPERVISORY_ORGANIZATION) | Department/Org |
53+
| `Manager` | Manager_Reference/@Descriptor | Direct manager's name |
54+
| `Location` | Location_Reference/@Descriptor | Work location |
55+
| `HireDate` | Worker_Status_Data/Hire_Date | Original hire date |
56+
| `WorkEmail` | Email_Address (WORK usage type) | Work email address |
57+
| `HomeAddress` | Address_Data (HOME usage type) | Formatted home address |
58+
| `HomeEmail` | Email_Address (HOME usage type, primary) | Personal email |
59+
| `HomePhone` | Phone_Data (HOME usage type, primary) | Home phone number |
60+
| `WorkPhone` | Phone_Data (WORK usage type, primary) | Work phone number |
61+
| `Status` | Worker_Status_Data/Active | Employment status (Active/Inactive) |
62+
| `ContinuousServiceDate` | Worker_Status_Data/Continuous_Service_Date | Service start date |
63+
| `LengthOfService` | *Calculated* | Years, months, days of service |
64+
65+
## Flow Overview
66+
67+
```
68+
┌─────────────────────────────────────────────────────────────┐
69+
│ User Triggers Topic │
70+
│ (e.g., "What is my profile?") │
71+
└─────────────────────────────────────────────────────────────┘
72+
73+
74+
┌─────────────────────────────────────────────────────────────┐
75+
│ Call Get_Workers API │
76+
│ (with Employee_ID and As_Of_Date) │
77+
└─────────────────────────────────────────────────────────────┘
78+
79+
80+
┌─────────────────────────────────────────────────────────────┐
81+
│ Parse Response via XPath │
82+
│ (Extract all profile fields) │
83+
└─────────────────────────────────────────────────────────────┘
84+
85+
86+
┌─────────────────────────────────────────────────────────────┐
87+
│ Calculate Length of Service │
88+
│ (Years, Months, Days from Continuous Service Date) │
89+
└─────────────────────────────────────────────────────────────┘
90+
91+
92+
┌─────────────────────────────────────────────────────────────┐
93+
│ Return finalizedData Record │
94+
│ (All fields available for AI to respond) │
95+
└─────────────────────────────────────────────────────────────┘
96+
```
97+
98+
## Length of Service Calculation
99+
100+
The topic automatically calculates the employee's length of service from their Continuous Service Date:
101+
102+
```
103+
Years: RoundDown(DateDiff(ServiceDate, Today, Months) / 12, 0)
104+
Months: Mod(DateDiff(ServiceDate, Today, Months), 12)
105+
Days: DateDiff(AdjustedDate, Today, Days)
106+
```
107+
108+
Output format: "X year(s) Y month(s) Z day(s)"
109+
110+
## Dependencies
111+
112+
This topic requires the following system topics/dialogs:
113+
- `msdyn_copilotforemployeeselfservicehr.topic.WorkdaySystemGetCommonExecution` - For executing Workday API calls
114+
115+
## Global Variables Used
116+
117+
| Variable | Description |
118+
|----------|-------------|
119+
| `Global.ESS_UserContext_Employee_Id` | The logged-in employee's Workday Employee ID |
120+
121+
## Output
122+
123+
The topic outputs a `finalizedData` record containing all profile fields that can be used by the AI orchestrator to formulate responses based on what the user specifically asked for.
124+
125+
```yaml
126+
outputType:
127+
properties:
128+
finalizedData:
129+
type: Record
130+
properties:
131+
EmployeeID: String
132+
Name: String
133+
DOB: String
134+
Gender: String
135+
BusinessTitle: String
136+
Organization: String
137+
Manager: String
138+
Location: String
139+
HireDate: String
140+
WorkEmail: String
141+
HomeAddress: String
142+
HomeEmail: String
143+
HomePhone: String
144+
WorkPhone: String
145+
Status: String
146+
ContinuousServiceDate: String
147+
LengthOfService: String
148+
```
149+
150+
## Important Notes
151+
152+
1. **Privacy**: This topic only returns data for the requesting user. Questions about other employees (managers, colleagues) are explicitly rejected per the model description.
153+
154+
2. **Tenure Information**: Length of Service is only included in the AI's response when the user specifically asks about tenure, service length, or how long they've been with the company.
155+
156+
3. **Status Conversion**: The raw `Active` field from Workday (1 or 0) is converted to human-readable "Active" or "Inactive".
157+
158+
4. **Response Optimization**: The Get_Workers request is optimized to exclude unnecessary data (benefits, qualifications, photos, etc.) to improve performance.
159+
160+
## Version History
161+
162+
| Version | Date | Changes |
163+
|---------|------|---------|
164+
| 1.0 | December 2025 | Initial release with comprehensive profile retrieval |
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<workdayEntityConfigurationTemplate>
3+
<scenario name="msdyn_HRWorkdayHCMEmployeeGetUserProfile">
4+
<apiRequests>
5+
<apiRequest>
6+
<authType>User</authType>
7+
<endpoint>
8+
<request>Template_GetWorkerRequest</request>
9+
<serviceName>Human_Resources</serviceName>
10+
<version>v45.0</version>
11+
</endpoint>
12+
<responseProperties>
13+
<property>
14+
<extractPath>//*[local-name()='Worker_Data']/*[local-name()='Worker_ID']/text()</extractPath>
15+
<key>EmployeeID</key>
16+
</property>
17+
<property>
18+
<extractPath>//*[local-name()='Get_Workers_Response']/*[local-name()='Response_Data']/*[local-name()='Worker'][1]/*[local-name()='Worker_Descriptor']/text()</extractPath>
19+
<key>Name</key>
20+
</property>
21+
<property>
22+
<extractPath>//*[local-name()='Personal_Information_Data']/*[local-name()='Birth_Date']/text()</extractPath>
23+
<key>DOB</key>
24+
</property>
25+
<property>
26+
<extractPath>//*[local-name()='Personal_Information_For_Country_Data']/*[local-name()='Country_Personal_Information_Data']/*[local-name()='Gender_Reference']/@*[local-name()='Descriptor']</extractPath>
27+
<key>Gender</key>
28+
</property>
29+
<property>
30+
<extractPath>//*[local-name()='Position_Data']/*[local-name()='Business_Title']/text()</extractPath>
31+
<key>BusinessTitle</key>
32+
</property>
33+
<property>
34+
<extractPath>//*[local-name()='Worker_Organization_Data']/*[local-name()='Organization_Reference']/*[local-name()='ID'][@*[local-name()='type']='Organization_Reference_ID' and contains(text(),'SUPERVISORY_ORGANIZATION')]/../@*[local-name()='Descriptor']</extractPath>
35+
<key>Organization</key>
36+
</property>
37+
<property>
38+
<extractPath>//*[local-name()='Worker_Supervisory_Management_Chain_Data']/*[local-name()='Management_Chain_Data']/*[local-name()='Manager_Reference']/@*[local-name()='Descriptor']</extractPath>
39+
<key>Manager</key>
40+
</property>
41+
<property>
42+
<extractPath>//*[local-name()='Business_Site_Summary_Data']/*[local-name()='Location_Reference']/*[local-name()='ID'][@*[local-name()='type']='Location_ID']/../@*[local-name()='Descriptor']</extractPath>
43+
<key>Location</key>
44+
</property>
45+
<property>
46+
<extractPath>//*[local-name()='Worker_Status_Data']/*[local-name()='Hire_Date']/text()</extractPath>
47+
<key>HireDate</key>
48+
</property>
49+
<property>
50+
<extractPath>//*[local-name()='Email_Address_Data'][*[local-name()='Usage_Data']/*[local-name()='Type_Data']/*[local-name()='Type_Reference']/*[local-name()='ID'][@*[local-name()='type']='Communication_Usage_Type_ID' and text()='WORK']]/*[local-name()='Email_Address']/text()</extractPath>
51+
<key>WorkEmail</key>
52+
</property>
53+
<property>
54+
<extractPath>//*[local-name()='Address_Data'][*[local-name()='Usage_Data']/*[local-name()='Type_Data']/*[local-name()='Type_Reference']/*[local-name()='ID'][@*[local-name()='type']='Communication_Usage_Type_ID' and text()='HOME']]/@*[local-name()='Formatted_Address']</extractPath>
55+
<key>HomeAddress</key>
56+
</property>
57+
<property>
58+
<extractPath>//*[local-name()='Email_Address_Data'][*[local-name()='Usage_Data']/*[local-name()='Type_Data'][@*[local-name()='Primary']='1']/*[local-name()='Type_Reference']/*[local-name()='ID'][@*[local-name()='type']='Communication_Usage_Type_ID' and text()='HOME']]/*[local-name()='Email_Address']/text()</extractPath>
59+
<key>HomeEmail</key>
60+
</property>
61+
<property>
62+
<extractPath>//*[local-name()='Worker_Data']/*[local-name()='Personal_Data']/*[local-name()='Contact_Data']/*[local-name()='Phone_Data'][*[local-name()='Usage_Data']/*[local-name()='Type_Data'][@*[local-name()='Primary']='1']/*[local-name()='Type_Reference']/*[local-name()='ID'][@*[local-name()='type']='Communication_Usage_Type_ID' and text()='HOME']]/@*[local-name()='Tenant_Formatted_Phone']</extractPath>
63+
<key>HomePhone</key>
64+
</property>
65+
<property>
66+
<extractPath>//*[local-name()='Worker_Data']/*[local-name()='Personal_Data']/*[local-name()='Contact_Data']/*[local-name()='Phone_Data'][*[local-name()='Usage_Data']/*[local-name()='Type_Data'][@*[local-name()='Primary']='1']/*[local-name()='Type_Reference']/*[local-name()='ID'][@*[local-name()='type']='Communication_Usage_Type_ID' and text()='WORK']]/@*[local-name()='Tenant_Formatted_Phone']</extractPath>
67+
<key>WorkPhone</key>
68+
</property>
69+
<property>
70+
<extractPath>//*[local-name()='Worker_Status_Data']/*[local-name()='Active']/text()</extractPath>
71+
<key>Status</key>
72+
</property>
73+
<property>
74+
<extractPath>//*[local-name()='Worker_Status_Data']/*[local-name()='Continuous_Service_Date']/text()</extractPath>
75+
<key>ContinuousServiceDate</key>
76+
</property>
77+
</responseProperties>
78+
</apiRequest>
79+
</apiRequests>
80+
</scenario>
81+
<requestTemplates>
82+
<requestTemplate name="Template_GetWorkerRequest">
83+
<bsvc:Get_Workers_Request xmlns:bsvc="urn:com.workday/bsvc" bsvc:version="v45.0">
84+
<bsvc:Request_References bsvc:Skip_Non_Existing_Instances="false" bsvc:Ignore_Invalid_References="true">
85+
<bsvc:Worker_Reference bsvc:Descriptor="Employee_ID">
86+
<bsvc:ID bsvc:type="Employee_ID">{Employee_ID}</bsvc:ID>
87+
</bsvc:Worker_Reference>
88+
</bsvc:Request_References>
89+
<bsvc:Response_Filter>
90+
<bsvc:As_Of_Effective_Date>{As_Of_Effective_Date}</bsvc:As_Of_Effective_Date>
91+
</bsvc:Response_Filter>
92+
<bsvc:Response_Group>
93+
<bsvc:Include_Reference>true</bsvc:Include_Reference>
94+
<bsvc:Include_Personal_Information>true</bsvc:Include_Personal_Information>
95+
<bsvc:Include_Employment_Information>true</bsvc:Include_Employment_Information>
96+
<bsvc:Include_Organizations>true</bsvc:Include_Organizations>
97+
<bsvc:Exclude_Organization_Support_Role_Data>true</bsvc:Exclude_Organization_Support_Role_Data>
98+
<bsvc:Exclude_Location_Hierarchies>true</bsvc:Exclude_Location_Hierarchies>
99+
<bsvc:Exclude_Cost_Centers>true</bsvc:Exclude_Cost_Centers>
100+
<bsvc:Exclude_Cost_Center_Hierarchies>true</bsvc:Exclude_Cost_Center_Hierarchies>
101+
<bsvc:Exclude_Companies>true</bsvc:Exclude_Companies>
102+
<bsvc:Exclude_Company_Hierarchies>true</bsvc:Exclude_Company_Hierarchies>
103+
<bsvc:Exclude_Matrix_Organizations>true</bsvc:Exclude_Matrix_Organizations>
104+
<bsvc:Exclude_Pay_Groups>true</bsvc:Exclude_Pay_Groups>
105+
<bsvc:Exclude_Regions>true</bsvc:Exclude_Regions>
106+
<bsvc:Exclude_Region_Hierarchies>true</bsvc:Exclude_Region_Hierarchies>
107+
<bsvc:Exclude_Supervisory_Organizations>false</bsvc:Exclude_Supervisory_Organizations>
108+
<bsvc:Exclude_Teams>true</bsvc:Exclude_Teams>
109+
<bsvc:Exclude_Custom_Organizations>true</bsvc:Exclude_Custom_Organizations>
110+
<bsvc:Include_Roles>false</bsvc:Include_Roles>
111+
<bsvc:Include_Management_Chain_Data>true</bsvc:Include_Management_Chain_Data>
112+
<bsvc:Include_Benefit_Enrollments>false</bsvc:Include_Benefit_Enrollments>
113+
<bsvc:Include_Benefit_Eligibility>false</bsvc:Include_Benefit_Eligibility>
114+
<bsvc:Include_Related_Persons>false</bsvc:Include_Related_Persons>
115+
<bsvc:Include_Qualifications>false</bsvc:Include_Qualifications>
116+
<bsvc:Include_Employee_Review>false</bsvc:Include_Employee_Review>
117+
<bsvc:Include_Goals>false</bsvc:Include_Goals>
118+
<bsvc:Include_Development_Items>false</bsvc:Include_Development_Items>
119+
<bsvc:Include_Skills>false</bsvc:Include_Skills>
120+
<bsvc:Include_Photo>false</bsvc:Include_Photo>
121+
<bsvc:Include_Worker_Documents>false</bsvc:Include_Worker_Documents>
122+
<bsvc:Include_Transaction_Log_Data>false</bsvc:Include_Transaction_Log_Data>
123+
<bsvc:Include_Succession_Profile>false</bsvc:Include_Succession_Profile>
124+
<bsvc:Include_Talent_Assessment>false</bsvc:Include_Talent_Assessment>
125+
<bsvc:Include_User_Account>false</bsvc:Include_User_Account>
126+
<bsvc:Include_Career>false</bsvc:Include_Career>
127+
</bsvc:Response_Group>
128+
</bsvc:Get_Workers_Request>
129+
</requestTemplate>
130+
</requestTemplates>
131+
</workdayEntityConfigurationTemplate>

0 commit comments

Comments
 (0)