In this tutorial, you'll build a workflow that helps employees request time off through the AI assistant. The workflow collects the required information, submits the request to your HRIS, and confirms the outcome with the employee.
By the end of this tutorial, you'll know how to:
- Create a workflow
- Configure a user-initiated Start action
- Add and connect workflow actions
- Pass data between actions
- Publish and test a workflow
Before you begin
Before starting this tutorial, make sure you have:
- The Experience Designer or Tenant administrator role.
- Access to the workflow designer.
- A configured HRIS submit leave (or equivalent) tool that you have already tested.
Scenario
An employee asks the assistant to request paid time off. The workflow collects the required dates and leave details, submits the request to your HRIS, and confirms the result.
Complexity
Beginner
This tutorial introduces a user-initiated workflow with one Agent to collect details, one Run Tool to submit, one Agent to confirm, and optional Workflow Steps.
What you'll build
The completed workflow contains three actions.
Employees see the workflow as three simple steps:
- Gather details.
- Submit the request.
- Complete.
Step 1: Create and name the workflow
- Select New workflow.
- Rename the workflow to Request time off.
- Add the following description:
Helps employees submit a time-off request through the assistant.
- Select Change icon, then choose a calendar or leave icon.
Step 2: Configure the Start action
Select the Start action and configure the following fields.
| Field | Value |
| Trigger | User-initiated |
| Tool Title | Request time off |
| Tool Description | Start when the employee wants to request paid time off, vacation, or sick leave. |
| Agent Activity Text | Starting your time off request⦠|
Configure input fields
Keep Start inputs minimal. The first Agent collects dates and leave details; Start only needs the employee identity from context.
| Name | Type | Source | Required |
| employeeId | Text | User context β User ID | Yes |
Configure workflow steps
- Under Workflow Steps, select Use steps.
- Set First step label to Gather details.
Step 3: Add the Time off assistant
- From the Actions palette, add an Agent action and connect it to Start.
- Configure the Agent:
| Field | Value |
| Name | Time off assistant |
| Instructions | Ask the employee to confirm the start date, end date, and leave type. Optionally collect a reason. Summarize the request before proceeding. When confirmed, return structured output containing the dates, reason, and leave type. |
| Tools | Optionally add Knowledge base search if you have leave policy articles. |
| Workflow Step | Continue the first step (Gather details), or leave it on that step if already selected. |
Configure output fields
Under Output fields, add:
| Name | Notes |
| startDate | Required for submit |
| endDate | Required for submit |
| leaveType | Required for most leave tools |
| reason | Optional unless your tool requires it |
These outputs are used by the next action when submitting the request.
Step 4: Add the Run Tool action
- From the Actions palette, add a Run Tool action and connect it to the Agent.
- Select your HRIS submit-leave (or equivalent) tool.
| Typical tool input | Variable |
| startDate (or equivalent) | Outputs β Time off assistant β startDate |
| endDate (or equivalent) | Outputs β Time off assistant β endDate |
| leaveType (or equivalent) | Outputs β Time off assistant β leaveType |
| reason (if required) | Outputs β Time off assistant β reason |
| employeeId | Workflow Inputs β employeeId |
- Under Workflow Step, select Start a new step and set the label to Submit request.
Step 5: Add the confirmation Agent
- From the Actions palette, add another Agent action and connect it to Run Tool.
- Configure Name as Confirm result (or similar).
- Write Instructions that:
- Tell the employee whether the request succeeded.
- Include any confirmation reference returned by the tool.
- In those instructions, use Insert Variable (@) to reference Outputs from the Run Tool, such as a success flag, confirmation ID, or message fields your tool returns.
- Under Workflow Step, select Start a new step and set the label to Complete.
Step 6: Publish the workflow
- Select Publish.
- Resolve any validation errors before publishing.
- Confirm the AI assistant employees use can start this workflow:
- Publishing creates a managed start tool titled Request time off.
- Attach that tool to your assistant if it is not already available, then save the assistant.
Without the start tool on the assistant, the test prompt in the next step won't begin the workflow.
Step 7: Test the workflow
- Open a conversation with the AI assistant and enter:
I'd like to request time off next week.
- Verify that the workflow:
- Starts successfully. You should see activity such as Starting your time off requestβ¦
- Shows the milestones Gather details β Submit request β Complete when steps are enabled.
- Collects the required information.
- Submits the request to your HRIS.
- Confirms the outcome to the employee.
If the workflow doesn't start
If the assistant answers without starting the workflow, check that the Request time off start tool is attached and the assistant is in a mode that can use tools and workflows.