Skip to content
Open
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
118 changes: 118 additions & 0 deletions catalog/createAWorkEventWithAgent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
title: Create A Work Event With Agent
description: Enable employees to propose, manage, and register for work events via interactive UI views or an AI Custom Agent featuring Agent File Uploads and Custom Scripts in Skill Files.
version: 2026.1
---

# Create A Work Event With Agent

Enable employees to propose, manage, and register for work events using interactive UI views (including a multi-select calendar widget) or through an AI Custom Agent featuring **Agent File Uploads** and **Custom Scripts in Skill Files**.

- **Version:** 2026.1

---

## 1. Resources

### Extend App Overview

- [Review the Create A Work Event forum page](https://forum.developer.workday.com/t/app-catalog-app-create-a-work-event/7301) for even more details and a video demo of the app.

### Agent Feature References

- [Feature Overview: Agent File Uploads in Custom Agents](https://forum.developer.workday.com/t/feature-overview-agent-file-uploads-in-custom-agents/47396)
- [Feature Overview: Custom Scripts in Agent Skills](https://forum.developer.workday.com/t/feature-overview-custom-scripts-in-agent-skills/47481)

---

## 2. Deployment Instructions

> ⚠️ **Important:** The application, its data models, and business process components **must be deployed first** to establish tenant-specific App Reference IDs and WIDs before configuring agent skill files.

### Step 1: Package the Application
1. Clone or download this repository.
2. Compress (zip) the `createAWorkEventWithAgent` folder located in the `catalog/` directory.
3. Use this `.zip` package when importing the application into Workday App Builder.

### Step 2: Import & Deploy via App Builder
1. Build an Extend App by choosing the `Upload a Zip File` option.
2. Import the `createAWorkEventWithAgent` package.
3. Deploy the application to your tenant.

> ℹ️ **Expected Warning During Initial Deployment:**
> You may see an **"Agent Registry Update Failed"** error modal stating:
> *"The app was deployed successfully, but the agent could not be registered with the Agent System of Record."*
> **This is expected and normal.** The underlying data model components and application deployed successfully. The agent registration fails at this stage because the skill `.md` files contain invalid placeholder WIDs and source tool names. You will fix these references in **Section 4**.

---

## 3. Security & Business Process Configuration

### A. Domain Security Policies (App Manager)

#### 1. Manage: Create an Event Security Domain
1. In the **Model Components** section of App Manager, locate the Security Domain `Manage: Create an Event` and click **Create** in the **Domain Security Policy** column.
2. Check `Confirm` and click **OK**.
3. Add the following permissions:
- **Report/Task Permissions (Modify):** `HR Administrator`

#### 2. Register For Events Security Domain
1. In the **Model Components** section of App Manager, locate the Security Domain `Register For Events` and click **Create** in the **Domain Security Policy** column.
2. Check `Confirm` and click **OK**.
3. Add the following permissions:
- **Report/Task Permissions (Modify):** `All Employees`

---

### B. Business Process Configuration

#### 1. Create a Work Event Business Process Security
1. Locate the `Create Work Event` Business Process in App Manager and click **Edit** in the **Security Policy** column.
2. Configure the Business Process Security Policy with the following permissions:
- **Initiate Create a Work Event:** `Employee as Self`
- **Action Steps: Book Event Space:** `HR Administrator`
- **View All:** `Employee as Self`, `HR Administrator`
- **Approve:** `Manager`
- **Deny:** `Manager`
3. Run the **Activate Pending Security Policy Changes** task to activate your updates.

#### 2. Business Process Definition
1. Locate the `Create a Work Event` Business Process in App Manager and click **Create** in the **Business Process Definition** column. Click **OK**.
2. On the **Edit Business Process** screen, click **OK** and **Done** to create an empty definition that auto-completes.
- *(Optional)* Add additional steps as needed (e.g., an approval step for **HR Administrators**).

---

## 4. Custom Agent Configuration & Activation

### Step 1: Update Skill Files Using Developer Agent
1. In **App Builder**, verify you are connected to your active tenant.
2. Open and run **Developer Agent** using the following prompt:

> *"The Agent Skill files were imported from an application outside the current organization. Please find all references in the skill files to `createAWorkEventWithAgent_mcwslt` and replace them with the current app reference ID. For any tool where you make this change, also update the tool with the valid WID for this tenant. Do not make changes to any other tools."*

### Step 2: Re-Deploy the Application
1. Save all updated skill files in App Builder.
2. Deploy the application again to apply the updated, tenant-specific references.

### Step 3: Register & Activate the Agent
1. In Workday, navigate to the **Agent System of Record**.
2. Register the newly configured **Work Event** agent.
3. Verify that all skills, custom scripts, and tools are associated correctly.
4. Set the agent status to **Active**.

---

## 5. Usage & Verification

### Standard UI Usage
1. In your Development tenant, search for and run the **Work Event Registration** task.
2. **Create an Event:** Propose a new work event.
3. **Manage Events:** Create or update existing Work Events.
4. **Register for an Event:** Sign up for an existing Work Event (users may register only once per event; a charity must exist to use the Donations page).
5. **Manage My Events:** View and manage existing event registrations.
6. **Calendar View:** View, create, and register for work events using the Multi-Select Calendar widget.

### Agent Verification (Workday Chat)
1. In **Workday Tenant Agent Chat**, start a session with your newly registered Work Event agent.
2. Test natural-language event creation (e.g., *"Help me create an Event for the Holiday Party"*).
124 changes: 124 additions & 0 deletions catalog/createAWorkEventWithAgent/agents/create-work-event.agentskill
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
---
name: create-work-event
description: "Guides an employee through creating a new Work Event in the app. Collects all required event details from the employee and submits the event via the app's Work Event REST endpoint."
metadata:
tags:
- work-event
- create
allowed-tools:
- find_staffing_workers
- post_create_awork_event_with_agent_mcwslt_create_work_event_events
- post_create_awork_event_with_agent_mcwslt_work_events
- agent_file_download
tool-wids:
- name: find_staffing_workers
wid: 30aeb92af72e100063e2955a0eff0000
- name: post_create_awork_event_with_agent_mcwslt_create_work_event_events
wid: c31e2903c40655789159a63ebc07eafa
- name: post_create_awork_event_with_agent_mcwslt_work_events
wid: 69fb9612b1fa5196ac2c1aa6791e65d5
- name: agent_file_download
wid: 94fadfecb1bb100031d911f8ed0a0000
---

# Recurring Event Date Calculator

When a user wants to create a **series of recurring Work Events**, use the sandbox to compute
all event dates before collecting any other details.

## Recurrence Detection

Ask the user: *"Is this a one-time event or will it repeat on a schedule (e.g., weekly, monthly)?"*

If the user indicates the event **recurs**, collect:
- **Start Date** — the date of the first occurrence (YYYY-MM-DD)
- **Recurrence Pattern** — one of: `daily`, `weekly`, `biweekly`, `monthly`
- **Number of Occurrences** — how many times the event should repeat (including the first)

## Policy Enforcement — 3-Month Limit

**Company policy requires that no occurrence may be scheduled more than 3 months in the future from today's date.**

Once you have the recurrence parameters, **execute the sandbox script below immediately — do not attempt to evaluate or filter dates yourself.** The script is the sole enforcer of the 3-month rule. Only after the script has run and returned its output should you read the `KEPT`, `DROPPED`, and `MAX_ALLOWED` values and relay the results to the user, e.g.:

> *"Based on company policy, occurrences cannot be scheduled more than 3 months in the future (cutoff: {MAX_ALLOWED}). Your series has been trimmed to {KEPT} occurrences. {DROPPED} occurrence(s) beyond that date were removed."*

Execute the following Python script in the sandbox to calculate all occurrence dates:

```python
from datetime import date, timedelta
from dateutil.relativedelta import relativedelta

start_date = date.fromisoformat("{START_DATE}") # e.g. "2025-09-01"
pattern = "{PATTERN}" # daily | weekly | biweekly | monthly
occurrences = {OCCURRENCES} # integer, e.g. 6

deltas = {
"daily": timedelta(days=1),
"weekly": timedelta(weeks=1),
"biweekly": timedelta(weeks=2),
}

from datetime import date
max_date = date.today() + relativedelta(months=3)

dates = []
dropped = 0
for i in range(occurrences):
if pattern == "monthly":
d = start_date + relativedelta(months=i)
else:
d = start_date + deltas[pattern] * i
if d <= max_date:
dates.append(d.isoformat())
else:
dropped += 1

print(f"KEPT={len(dates)}")
print(f"DROPPED={dropped}")
print(f"MAX_ALLOWED={max_date.isoformat()}")
for d in dates:
print(d)
```

- Replace `{START_DATE}`, `{PATTERN}`, and `{OCCURRENCES}` with the user's values before executing.
- The script prints one ISO date per line — capture the output as the list of event dates.

## Creating the Series

Present the full list of computed dates to the user and ask them to confirm (or remove any dates
they don't want). For each **confirmed date**:

1. Collect any event details that may vary per occurrence (e.g., end date / time), then
repeat **Steps 2–7** from the main flow below once per date, creating a separate Work Event
instance for each occurrence.
2. Notify the user of progress after each creation (e.g., *"Event 2 of 6 created ✓"*) and
provide a final summary listing all created events when the series is complete.

---

# Create Work Event Skill

This skill helps an employee create a new Work Event. Collect all required details
conversationally, confirm with the user, then submit via the Work Event API.

## Steps

1. Greet the user and let them know you'll help them create a new Work Event. Ask if they have an **event flyer** they'd like to upload — if so, prompt them to share the image in chat.
2. If a flyer was provided:
- Use `agent_file_download` to download the image.
- Use your built-in OCR capabilities to read all text visible in the image, then extract as many of the following event details as possible:
- **Name** of the event
- **Description**
- **Location**
- **Start Date** (YYYY-MM-DD)
- **End Date** (YYYY-MM-DD)
- **Event Sponsor**
- **Contact Info / Email**
- **Internal Only?** (yes/no)
- Present the extracted details to the user and ask them to confirm or correct any fields.
3. For any details not found in the flyer (or if no flyer was provided), conversationally collect the missing required fields from the user.
4. Confirm all collected details with the user before submitting.
5. Use `post_create_awork_event_with_agent_mcwslt_work_events` to create the WorkEvent model instance. Capture the `id` (WID) returned in the response.
6. Using the `id` from step 5, call `post_create_awork_event_with_agent_mcwslt_create_work_event_events` to trigger the **CreateWorkEvent** business process for the newly created event instance.
7. Confirm to the user that the event has been created and the business process has been initiated, sharing the event name and any relevant details from the response.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: edit-work-event
description: >
Helps an employee edit an existing Work Event. Loads the current event data,
allows the employee to update fields, and saves the changes via the app's
Work Event REST endpoint.
metadata:
tags:
- work-event
- edit
allowed-tools:
- get_create_awork_event_with_agent_mcwslt_work_events
- patch_create_awork_event_with_agent_mcwslt_work_events
tool-wids:
- name: get_create_awork_event_with_agent_mcwslt_work_events
wid: "2eccfb57d2e55a69843387ddf09e5fb2"
- name: patch_create_awork_event_with_agent_mcwslt_work_events
wid: "b93e2bc6b4dc5a249842536fe9b711b1"
---

# Edit Work Event Skill

This skill helps an employee edit an existing Work Event. The event should already
have been identified (via the find-work-event skill or provided by the user).

## Steps

1. If a `workEventId` has been provided (e.g., passed from a find-work-event flow),
proceed to step 2. Otherwise, ask the user to provide the Work Event ID they want
to edit.
2. Call `get_create_awork_event_with_agent_mcwslt_work_events` with the event ID as
`contextInstanceId` to load the current event details.
3. Conversationally collect any fields the user wants to update:
- **Name** of the event
- **Description**
- **Location**
- **Start Date** (YYYY-MM-DD)
- **End Date** (YYYY-MM-DD)
- **Event Sponsor**
- **Contact Info / Email**
- **Internal Only?** (yes/no)
Present the current values to the user and ask which fields they would like to change.

4. Confirm the changes with the user, then update the event using `patch_create_awork_event_with_agent_mcwslt_work_events`.

## Error Handling

- If the event ID is not found (404), inform the user and suggest using the
find-work-event skill to locate the correct event.
- If the API returns a validation error, relay the message to the user and prompt
them to correct the field.
- If the user declines confirmation, ask if they'd like to adjust their changes or cancel.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: find-work-event
description: >
Helps an employee search for and locate Work Events in the app. Returns a list
of matching events so the employee can identify the one they want to view or edit.
metadata:
tags:
- work-event
- search
- find
allowed-tools:
- get_create_awork_event_with_agent_mcwslt_work_events
tool-wids:
- name: get_create_awork_event_with_agent_mcwslt_work_events
wid: "2eccfb57d2e55a69843387ddf09e5fb2"
---

# Find Work Event Skill

This skill helps an employee search for existing Work Events. The employee can search
by name, date range, or browse available events, and then select one to view or pass
to the edit-work-event skill.

## Steps

1. Ask the user how they would like to find the event. Options include:
- **By name** — ask for the event name or partial name to search
- **Browse all** — list available events
2. Call `get_create_awork_event_with_agent_mcwslt_work_events` to retrieve Work Events.
- If the user provided a search term, pass it as a `search` parameter if supported,
or retrieve a list and filter by name in the response.
- Use `limit` and `offset` to paginate if needed (default limit 20).
3. Present the results to the user as a numbered or bulleted list, showing for each:
- Event Name
- Start Date / End Date
- Location
- Event ID
4. Ask the user which event they are interested in. If no results match, let the user
know and offer to broaden the search or try different keywords.
5. Once the user selects an event, confirm the selection and offer next steps:
- **Edit this event** — hand off the event ID to the edit-work-event skill
- **View details** — hand off the event ID to the view-work-event skill
- **Search again** — restart the search

## Error Handling

- If the API returns no results, inform the user clearly and suggest broadening the
search criteria.
- If the API returns an error, relay the message to the user and suggest retrying.
- If the user wants to navigate to more than 20 results, offer to load the next page.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: view-work-event
description: "Displays the details of a single Work Event to the employee in the agent chat window and allows them to register for that event directly from the conversation."
metadata:
tags:
- work-event
- view
- register
allowed-tools:
- get_create_awork_event_with_agent_mcwslt_work_events
- patch_create_awork_event_with_agent_mcwslt_work_events
- post_create_awork_event_with_agent_mcwslt_registrants
tool-wids:
- name: get_create_awork_event_with_agent_mcwslt_work_events
wid: 2eccfb57d2e55a69843387ddf09e5fb2
- name: patch_create_awork_event_with_agent_mcwslt_work_events
wid: b93e2bc6b4dc5a249842536fe9b711b1
- name: post_create_awork_event_with_agent_mcwslt_registrants
wid: b27ef2bf4ad958c8b006bdcc36da277d
---

# View Work Event Skill

This skill displays the full details of a specific Work Event in the agent chat window and allows the employee to register for it or cancel.

## Steps

1. When the user asks to view a specific Work Event — for example "show me the details for [Event Name]" or after clicking a Register button from the `registerForEventsAui` list page — identify the `workEventId` for the event.
- If the user has not yet specified which event they want to view, ask them to clarify or use the `register-for-events` skill to help them browse upcoming events first.
2. Call `get_create_awork_event_with_agent_mcwslt_work_events` with the `workEventId` to load the event details.
3. Present the following event details to the user conversationally:
- Event name
- Date range (start date — end date)
- Location
- Description
- Sponsor
- Fee
- Contact information
4. Ask the user if they would like to **Register** for the event or if they want to do something else:
- If the user confirms registration, call `post_create_awork_event_with_agent_mcwslt_registrants` to create a Registrant record and confirm success: "You have successfully registered for **[Event Name]**!"
- If the user declines, acknowledge their choice and end the skill gracefully: "No problem! Let me know if there's anything else I can help with."
- If the user is already registered, inform them: "It looks like you're already registered for this event."

## Error Handling

- If the event page fails to load, inform the user and suggest trying again later.
- If registration fails, relay the error and suggest contacting a system administrator.
Loading
Loading