Workday GPT 操作手册
目录
通用应用信息
Workday 是一个基于云的平台,提供人力资本管理、薪资和财务管理解决方案。通过自定义操作将 ChatGPT 与 Workday 集成,可以为员工提供自动化响应,指导员工完成 HR 流程,并从 Workday 检索关键信息,从而增强 HR 运营。
ChatGPT 的 Workday 自定义操作允许组织利用人工智能来改进 HR 流程、自动化任务并提供个性化的员工支持。这包括用于咨询福利、休假和薪资的虚拟 HR 助手。
ChatGPT 到 Workday 的认证
要将 ChatGPT 与 Workday 连接,请使用 OAuth:
- 需要 Workday 管理员访问权限才能获取客户端 ID 和客户端密钥。
- 重要网址:
- 授权 URL:
[Workday 租户 URL]/authorize
,通常格式为:https://wd5-impl.workday.com/<your_tenant>/authorize
- 令牌 URL:
[Workday 租户 URL]/token
,通常格式为:https://wd5-impl-services1.workday.com/ccx/oauth2/<your_tenant>/token
- 授权 URL:
在 Workday 中创建 API 客户端后,请参考 Workday 提供的 URL。它们将根据租户和数据中心提供所需的特定 URL。
设置 OAuth 的步骤:
- 使用 Workday 中的“注册 API 客户端”任务。
- 在 Workday 中设置 API 客户端设置,类似于下面提供的示例。
- 范围将根据 GPT 执行的操作而有所不同。对于此用例,您将需要:
Staffing
、Tenant Non-Configurable
、Time Off and Leave
、Include Workday Owned Scope
- 在 API 客户端设置中输入来自 GPT 的重定向 URI。
- 存储客户端 ID 和客户端密钥以供 GPT 后续使用。
- 按照下面所示,将 OAuth 详细信息添加到 GPT 身份验证部分。
重定向 URI 是在选择了 OAuth 作为身份验证后,在 GPT 设置屏幕上从 GPT 设置中检索的。
Workday 社区关于 API 客户端的页面可以是一个很好的深入资源(这需要社区帐户)。
示例用例:PTO 提交和福利计划查询
概述
本用例演示了如何通过 RAAS 报告帮助员工提交 PTO 请求、检索员工详细信息和查看福利计划。
GPT 指令
使用以下说明来涵盖 PTO 提交用例、员工详细信息检索和福利计划查询:
# **背景:** 您通过 Workday 系统为员工提供有关其 PTO 提交、员工详细信息和福利计划的详细信息。您帮助他们提交 PTO 请求、检索个人和工作相关信息以及查看其福利计划。假设员工熟悉基本的人力资源术语。
# **说明:**
## 场景
### - 当用户要求提交 PTO 请求时,请遵循以下 3 步流程:
1. 询问用户 PTO 详细信息,包括开始日期、结束日期和休假类型。
2. 使用 `Request_Time_Off` API 调用提交请求。
3. 提供已提交 PTO 请求的摘要,包括任何有关批准的信息。
### - 当用户要求检索员工详细信息时,请遵循以下 2 步流程:
1. 使用 `Get_Workers` 检索员工的详细信息。
2. 总结员工的职位、部门和联系方式,以便于参考。
### - 当用户要求查询福利计划时,请遵循以下 2 步流程:
1. 使用 `Get_Report_As_A_Service` 检索福利计划详细信息。
2. 提供福利摘要。
代表员工创建请求
由于在 Workday 上对员工采取行动需要员工 ID,因此在进行任何查询之前都需要检索此信息。我们通过在身份验证后调用 Workday 中的 RAAS 报告来完成此操作,该报告提供登录的用户。可能还有其他方法可以通过 REST API 调用来完成此操作。在返回 ID 后,它将用于所有其他操作。
示例 RAAS 报告:使用字段“当前用户”将返回通过 OAuth 身份验证的用户。
OpenAPI 架构
以下是使用 Workday REST API 参考和 ActionsGPT 生成的 OpenAPI 架构示例。
我们正在使用以下 API 调用:
- [POST] Request_Time_Off:为员工创建休假请求。
- [GET] Get_Workers:检索有关员工详细信息的信息。
- [GET] Get_eligibleAbsenceTypes:检索符合条件的缺勤类型。
- [GET] Get_Report_As_A_Service (RAAS):提取报告,包括福利详细信息的自定义 RAAS 报告。
将路径替换为正确的租户 ID,并将其配置到适当的服务器。确保为不同的 PTO 类型正确设置所需的 ID。
openapi: 3.1.0
info:
title: Workday Employee API
description: API to manage worker details, absence types, and benefit plans in Workday.
version: 1.3.0
servers:
- url: https://wd5-impl-services1.workday.com/ccx
description: Workday Absence Management API Server
paths:
/service/customreport2/tenant/GPT_RAAS:
get:
operationId: getAuthenticatedUserIdRaaS
summary: Retrieve the Employee ID for the authenticated user.
description: Fetches the Employee ID for the authenticated user from Workday.
responses:
'200':
description: A JSON object containing the authenticated user's Employee ID.
content:
application/json:
schema:
type: object
properties:
employeeId:
type: string
description: The Employee ID of the authenticated user.
example: "5050"
'401':
description: Unauthorized - Invalid or missing Bearer token.
security:
- bearerAuth: []
/api/absenceManagement/v1/tenant/workers/Employee_ID={employeeId}/eligibleAbsenceTypes:
get:
operationId: getEligibleAbsenceTypes
summary: Retrieve eligible absence types by Employee ID.
description: Fetches a list of eligible absence types for a worker by their Employee ID, with a fixed category filter.
parameters:
- name: employeeId
in: path
required: true
description: The Employee ID of the worker (passed as `Employee_ID=3050` in the URL).
schema:
type: string
example: "5050"
- name: category
in: query
required: true
description: Fixed category filter for the request. This cannot be changed.
schema:
type: string
example: "17bd6531c90c100016d4b06f2b8a07ce"
responses:
'200':
description: A JSON array of eligible absence types.
content:
application/json:
schema:
type: object
properties:
absenceTypes:
type: array
items:
type: object
properties:
id:
type: string
name:
type: string
'401':
description: Unauthorized - Invalid or missing Bearer token.
'404':
description: Worker or absence types not found.
security:
- bearerAuth: []
/api/absenceManagement/v1/tenant/workers/Employee_ID={employeeId}:
get:
operationId: getWorkerById
summary: Retrieve worker details by Employee ID.
description: Fetches detailed information of a worker using their Employee ID.
parameters:
- name: employeeId
in: path
required: true
description: The Employee ID of the worker.
schema:
type: string
example: "5050"
responses:
'200':
description: A JSON object containing worker details.
content:
application/json:
schema:
type: object
properties:
id:
type: string
name:
type: object
properties:
firstName:
type: string
lastName:
type: string
position:
type: string
email:
type: string
'401':
description: Unauthorized - Invalid or missing Bearer token.
'404':
description: Worker not found.
security:
- bearerAuth: []
/api/absenceManagement/v1/tenant/workers/Employee_ID={employeeId}/requestTimeOff:
post:
operationId: requestTimeOff
summary: Request time off for a worker.
description: Allows a worker to request time off by providing the necessary details.
parameters:
- name: employeeId
in: path
required: true
description: The Employee ID of the worker requesting time off.
schema:
type: string
example: "5050"
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
days:
type: array
description: Array of days for which the time off is being requested.
items:
type: object
properties:
start:
type: string
format: date
description: The start date of the time off.
example: "2024-11-26"
date:
type: string
format: date
description: The specific date for the time off.
example: "2024-11-26"
end:
type: string
format: date
description: The end date of the time off.
example: "2024-11-26"
dailyQuantity:
type: number
description: The number of hours per day to take off.
example: 8
timeOffType:
type: object
description: Time off type with corresponding ID.
properties:
id:
type: string
description: The ID of the time off type.
example: "b35340ce4321102030f8b5a848bc0000"
enum:
- <flexible_time_off_id_from_workday> # Flexible Time Off ID (hexa format)
- <sick_leave_id_from_workday> # Sick Leave ID (hexa format)
responses:
'200':
description: Time off request created successfully.
'400':
description: Invalid input or missing parameters.
'401':
description: Unauthorized - Invalid or missing Bearer token.
'404':
description: Worker not found.
security:
- bearerAuth: []
/service/customreport2/tenant/GPT_Worker_Benefit_Data:
get:
operationId: getWorkerBenefitPlans
summary: Retrieve worker benefit plans enrolled by Employee ID.
description: Fetches the benefit plans in which the worker is enrolled using their Employee ID.
parameters:
- name: Worker!Employee_ID
in: query
required: true
description: The Employee ID of the worker.
schema:
type: string
example: "5020"
- name: format
in: query
required: true
description: The format of the response (e.g., `json`).
schema:
type: string
example: "json"
responses:
'200':
description: A JSON array of the worker's enrolled benefit plans.
content:
application/json:
schema:
type: object
properties:
benefitPlans:
type: array
items:
type: object
properties:
planName:
type: string
coverage:
type: string
startDate:
type: string
format: date
endDate:
type: string
format: date
'401':
description: Unauthorized - Invalid or missing Bearer token.
'404':
description: Worker or benefit plans not found.
security:
- bearerAuth: []
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas:
worker:
type: object
properties:
id:
type: string
name:
type: object
properties:
firstName:
type: string
lastName:
type: string
position:
type: string
email:
type: string
absenceTypes:
type: array
items:
type: object
properties:
id:
type: string
name:
type: string
benefitPlans:
type: array
items:
type: object
properties:
planName:
type: string
coverage:
type: string
startDate:
type: string
format: date
endDate:
type: string
format: date
timeOffTypes:
type: object
description: Mapping of human-readable time off types to their corresponding IDs.
properties:
Flexible Time Off:
type: string
example: "b35340ce4321102030f8b5a848bc0000"
Sick Leave:
type: string
example: "21bd0afbfbf21011e6ccc4dc170e0000"
结论
恭喜您为 Workday 设置了具有 PTO 提交、员工详细信息检索和福利计划查询等功能的 GPT!
此集成可以简化 HR 流程,提供对个人详细信息的快速访问,并使员工能够轻松请求 PTO。本指南提供了一个可自定义的框架,用于将 ChatGPT 与 Workday 集成,使您能够轻松添加更多操作并进一步增强 GPT 的功能。