Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# Workday Get User Profile

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.

## Features

- **Personal Information**: Name, Date of Birth, Gender
- **Employment Details**: Employee ID, Business Title, Organization/Department, Manager, Location
- **Contact Information**: Work Email, Work Phone, Home Email, Home Phone, Home Address
- **Employment Status**: Active/Inactive status, Hire Date
- **Tenure Calculation**: Continuous Service Date and calculated Length of Service (years, months, days)

## Trigger Phrases

Users can activate this topic with phrases like:
- "What is my profile?"
- "Show my profile"
- "What is my employee ID?"
- "What is my job title?"
- "What is my work email?"
- "Who is my manager?"
- "What department am I in?"
- "What is my tenure?"
- "How long have I been with the company?"
- "What is my hire date?"
- "Am I an active employee?"

## Files

| File | Description |
|------|-------------|
| `topic.yaml` | Main Copilot Studio topic definition |
| `msdyn_HRWorkdayHCMEmployeeGetUserProfile.xml` | XML template with XPath extractions for profile data |

## Workday APIs Used

| API | Service | Version | Purpose |
|-----|---------|---------|---------|
| `Get_Workers` | Human_Resources | v45.0 | Retrieve comprehensive employee profile data |

## Data Retrieved

The topic extracts the following fields from Workday:

| Field | XPath Source | Description |
|-------|--------------|-------------|
| `EmployeeID` | Worker_Data/Worker_ID | Employee's Workday ID |
| `Name` | Worker_Descriptor | Employee's full name |
| `DOB` | Personal_Information_Data/Birth_Date | Date of birth |
| `Gender` | Gender_Reference/@Descriptor | Gender |
| `BusinessTitle` | Position_Data/Business_Title | Job title |
| `Organization` | Organization_Reference (SUPERVISORY_ORGANIZATION) | Department/Org |
| `Manager` | Manager_Reference/@Descriptor | Direct manager's name |
| `Location` | Location_Reference/@Descriptor | Work location |
| `HireDate` | Worker_Status_Data/Hire_Date | Original hire date |
| `WorkEmail` | Email_Address (WORK usage type) | Work email address |
| `HomeAddress` | Address_Data (HOME usage type) | Formatted home address |
| `HomeEmail` | Email_Address (HOME usage type, primary) | Personal email |
| `HomePhone` | Phone_Data (HOME usage type, primary) | Home phone number |
| `WorkPhone` | Phone_Data (WORK usage type, primary) | Work phone number |
| `Status` | Worker_Status_Data/Active | Employment status (Active/Inactive) |
| `ContinuousServiceDate` | Worker_Status_Data/Continuous_Service_Date | Service start date |
| `LengthOfService` | *Calculated* | Years, months, days of service |

## Flow Overview

```
┌─────────────────────────────────────────────────────────────┐
│ User Triggers Topic │
│ (e.g., "What is my profile?") │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Call Get_Workers API │
│ (with Employee_ID and As_Of_Date) │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Parse Response via XPath │
│ (Extract all profile fields) │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Calculate Length of Service │
│ (Years, Months, Days from Continuous Service Date) │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Return finalizedData Record │
│ (All fields available for AI to respond) │
└─────────────────────────────────────────────────────────────┘
```

## Length of Service Calculation

The topic automatically calculates the employee's length of service from their Continuous Service Date:

```
Years: RoundDown(DateDiff(ServiceDate, Today, Months) / 12, 0)
Months: Mod(DateDiff(ServiceDate, Today, Months), 12)
Days: DateDiff(AdjustedDate, Today, Days)
```

Output format: "X year(s) Y month(s) Z day(s)"

## Dependencies

This topic requires the following system topics/dialogs:
- `msdyn_copilotforemployeeselfservicehr.topic.WorkdaySystemGetCommonExecution` - For executing Workday API calls

## Global Variables Used

| Variable | Description |
|----------|-------------|
| `Global.ESS_UserContext_Employee_Id` | The logged-in employee's Workday Employee ID |

## Output

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.

```yaml
outputType:
properties:
finalizedData:
type: Record
properties:
EmployeeID: String
Name: String
DOB: String
Gender: String
BusinessTitle: String
Organization: String
Manager: String
Location: String
HireDate: String
WorkEmail: String
HomeAddress: String
HomeEmail: String
HomePhone: String
WorkPhone: String
Status: String
ContinuousServiceDate: String
LengthOfService: String
```

## Important Notes

1. **Privacy**: This topic only returns data for the requesting user. Questions about other employees (managers, colleagues) are explicitly rejected per the model description.

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.

3. **Status Conversion**: The raw `Active` field from Workday (1 or 0) is converted to human-readable "Active" or "Inactive".

4. **Response Optimization**: The Get_Workers request is optimized to exclude unnecessary data (benefits, qualifications, photos, etc.) to improve performance.

## Version History

| Version | Date | Changes |
|---------|------|---------|
| 1.0 | December 2025 | Initial release with comprehensive profile retrieval |
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<?xml version="1.0" encoding="utf-8" ?>
<workdayEntityConfigurationTemplate>
<scenario name="msdyn_HRWorkdayHCMEmployeeGetUserProfile">
<apiRequests>
<apiRequest>
<authType>User</authType>
<endpoint>
<request>Template_GetWorkerRequest</request>
<serviceName>Human_Resources</serviceName>
<version>v45.0</version>
</endpoint>
<responseProperties>
<property>
<extractPath>//*[local-name()='Worker_Data']/*[local-name()='Worker_ID']/text()</extractPath>
<key>EmployeeID</key>
</property>
<property>
<extractPath>//*[local-name()='Get_Workers_Response']/*[local-name()='Response_Data']/*[local-name()='Worker'][1]/*[local-name()='Worker_Descriptor']/text()</extractPath>
<key>Name</key>
</property>
<property>
<extractPath>//*[local-name()='Personal_Information_Data']/*[local-name()='Birth_Date']/text()</extractPath>
<key>DOB</key>
</property>
<property>
<extractPath>//*[local-name()='Personal_Information_For_Country_Data']/*[local-name()='Country_Personal_Information_Data']/*[local-name()='Gender_Reference']/@*[local-name()='Descriptor']</extractPath>
<key>Gender</key>
</property>
<property>
<extractPath>//*[local-name()='Position_Data']/*[local-name()='Business_Title']/text()</extractPath>
<key>BusinessTitle</key>
</property>
<property>
<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>
<key>Organization</key>
</property>
<property>
<extractPath>//*[local-name()='Worker_Supervisory_Management_Chain_Data']/*[local-name()='Management_Chain_Data']/*[local-name()='Manager_Reference']/@*[local-name()='Descriptor']</extractPath>
<key>Manager</key>
</property>
<property>
<extractPath>//*[local-name()='Business_Site_Summary_Data']/*[local-name()='Location_Reference']/*[local-name()='ID'][@*[local-name()='type']='Location_ID']/../@*[local-name()='Descriptor']</extractPath>
<key>Location</key>
</property>
<property>
<extractPath>//*[local-name()='Worker_Status_Data']/*[local-name()='Hire_Date']/text()</extractPath>
<key>HireDate</key>
</property>
<property>
<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>
<key>WorkEmail</key>
</property>
<property>
<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>
<key>HomeAddress</key>
</property>
<property>
<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>
<key>HomeEmail</key>
</property>
<property>
<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>
<key>HomePhone</key>
</property>
<property>
<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>
<key>WorkPhone</key>
</property>
<property>
<extractPath>//*[local-name()='Worker_Status_Data']/*[local-name()='Active']/text()</extractPath>
<key>Status</key>
</property>
<property>
<extractPath>//*[local-name()='Worker_Status_Data']/*[local-name()='Continuous_Service_Date']/text()</extractPath>
<key>ContinuousServiceDate</key>
</property>
</responseProperties>
</apiRequest>
</apiRequests>
</scenario>
<requestTemplates>
<requestTemplate name="Template_GetWorkerRequest">
<bsvc:Get_Workers_Request xmlns:bsvc="urn:com.workday/bsvc" bsvc:version="v45.0">
<bsvc:Request_References bsvc:Skip_Non_Existing_Instances="false" bsvc:Ignore_Invalid_References="true">
<bsvc:Worker_Reference bsvc:Descriptor="Employee_ID">
<bsvc:ID bsvc:type="Employee_ID">{Employee_ID}</bsvc:ID>
</bsvc:Worker_Reference>
</bsvc:Request_References>
<bsvc:Response_Filter>
<bsvc:As_Of_Effective_Date>{As_Of_Effective_Date}</bsvc:As_Of_Effective_Date>
</bsvc:Response_Filter>
<bsvc:Response_Group>
<bsvc:Include_Reference>true</bsvc:Include_Reference>
<bsvc:Include_Personal_Information>true</bsvc:Include_Personal_Information>
<bsvc:Include_Employment_Information>true</bsvc:Include_Employment_Information>
<bsvc:Include_Organizations>true</bsvc:Include_Organizations>
<bsvc:Exclude_Organization_Support_Role_Data>true</bsvc:Exclude_Organization_Support_Role_Data>
<bsvc:Exclude_Location_Hierarchies>true</bsvc:Exclude_Location_Hierarchies>
<bsvc:Exclude_Cost_Centers>true</bsvc:Exclude_Cost_Centers>
<bsvc:Exclude_Cost_Center_Hierarchies>true</bsvc:Exclude_Cost_Center_Hierarchies>
<bsvc:Exclude_Companies>true</bsvc:Exclude_Companies>
<bsvc:Exclude_Company_Hierarchies>true</bsvc:Exclude_Company_Hierarchies>
<bsvc:Exclude_Matrix_Organizations>true</bsvc:Exclude_Matrix_Organizations>
<bsvc:Exclude_Pay_Groups>true</bsvc:Exclude_Pay_Groups>
<bsvc:Exclude_Regions>true</bsvc:Exclude_Regions>
<bsvc:Exclude_Region_Hierarchies>true</bsvc:Exclude_Region_Hierarchies>
<bsvc:Exclude_Supervisory_Organizations>false</bsvc:Exclude_Supervisory_Organizations>
<bsvc:Exclude_Teams>true</bsvc:Exclude_Teams>
<bsvc:Exclude_Custom_Organizations>true</bsvc:Exclude_Custom_Organizations>
<bsvc:Include_Roles>false</bsvc:Include_Roles>
<bsvc:Include_Management_Chain_Data>true</bsvc:Include_Management_Chain_Data>
<bsvc:Include_Benefit_Enrollments>false</bsvc:Include_Benefit_Enrollments>
<bsvc:Include_Benefit_Eligibility>false</bsvc:Include_Benefit_Eligibility>
<bsvc:Include_Related_Persons>false</bsvc:Include_Related_Persons>
<bsvc:Include_Qualifications>false</bsvc:Include_Qualifications>
<bsvc:Include_Employee_Review>false</bsvc:Include_Employee_Review>
<bsvc:Include_Goals>false</bsvc:Include_Goals>
<bsvc:Include_Development_Items>false</bsvc:Include_Development_Items>
<bsvc:Include_Skills>false</bsvc:Include_Skills>
<bsvc:Include_Photo>false</bsvc:Include_Photo>
<bsvc:Include_Worker_Documents>false</bsvc:Include_Worker_Documents>
<bsvc:Include_Transaction_Log_Data>false</bsvc:Include_Transaction_Log_Data>
<bsvc:Include_Succession_Profile>false</bsvc:Include_Succession_Profile>
<bsvc:Include_Talent_Assessment>false</bsvc:Include_Talent_Assessment>
<bsvc:Include_User_Account>false</bsvc:Include_User_Account>
<bsvc:Include_Career>false</bsvc:Include_Career>
</bsvc:Response_Group>
</bsvc:Get_Workers_Request>
</requestTemplate>
</requestTemplates>
</workdayEntityConfigurationTemplate>
Loading