Written By William Bowen
Last updated 15 days ago
Intro
This AI agent automates PTO requests for HR by extracting dates and times directly from employee SMS messages, ensuring details are complete by proactively asking follow-up questions if needed.
For example, if an employee texts, "I'd like PTO next Friday," the AI clarifies the exact date (e.g., "Do you mean Friday, March 14th?"), records it to the contact database and your source of truth, and replies, "Thanks! Your PTO request has been noted; we'll confirm shortly."
Use cases
Vacation Request: Employee requests vacation time over SMS.
Example: "Can I take vacation from May 5-10?" β AI confirms dates and logs the request.Sick Leave Reporting: Employee reports sick leave via text.
Example: "Iβm feeling ill today, need a sick day." β AI logs today's date and acknowledges the request.Partial Day PTO: Employee requests partial-day time off.
Example: "I need PTO from 2 pm to 5 pm tomorrow." β AI confirms specifics and updates records.PTO Cancellation: Employee wants to cancel a previously submitted PTO.
Example: "Cancel my PTO request for April 3rd." β AI confirms cancellation and updates system.PTO Balance Inquiry: Employee checks available PTO balance via SMS.
Example: "How many PTO days do I have left?" β AI retrieves and responds with accurate balance.Remote Work Notification: Employee notifies HR of planned remote work.
Example: "I'll be working remotely next Wednesday." β AI logs the remote day and sends acknowledgment.Parental Leave Request: Employee initiates parental leave process through SMS.
Example: "I want to start parental leave from August 1st." β AI confirms dates, notes request, and escalates to HR.Emergency Time-Off: Employee urgently requests emergency leave.
Example: "Family emergency, I need today off immediately." β AI flags urgency, confirms request, and alerts HR.Extended PTO Request: Employee requests extended PTO beyond usual durations.
Example: "I'd like PTO from June 1 to July 15." β AI verifies extended period and escalates for approval.Holiday Clarification: Employee inquires if a certain date is a company holiday.
Example: "Is July 4th a company holiday?" β AI responds with confirmation and updates records if employee plans additional PTO around the holiday.
Screenshots



Template
Example{
"$schema": "https://web-api.clerk.chat/pipeline-schema",
"name": "HR - PTO agent",
"nodes": [
{
"type": "tool_runner",
"name": "Update contact card with times",
"triggeredBy": [
"unreadMessage.fromAny"
],
"responseType": "json",
"nodeConfig": {
"type": "contact_tools",
"config": {},
"enabledTools": [
"set_attribute"
],
"tools": {
"set_attribute": {
"paramValues": {
"attributeName": {
"type": "fixed",
"value": "Times"
},
"attributeValue": {
"path": "times",
"type": "pipeline-variable"
}
}
}
}
}
},
{
"type": "ai_bot",
"name": "Converse / conclude",
"triggeredBy": [
"unreadMessage.fromAny"
],
"responseType": "user_message",
"nodeConfig": {
"modelProvider": "openai",
"modelVersion": null,
"maxTokens": null,
"temperature": null,
"variables": {},
"prompt": "Your job is to converse with the employee and conclude the conversation. \n\nIf we know both the dates and times the employee wants to take off for PTO, then conclude the conversation. \n\nIf we know dates and times, they will be below: \nDates: {{dates}} \nTimes: {{times}} \n\nIf we know both, you shouldn't ask for them again. \n\nYou should conclude the conversation by restating the dates and times they want off. And say these have been noted, you will confirm this over SMS. \n\nIf we don't know either the dates or the times, you should ask the employee for them. \n\nYour output should me maximum 40 words.",
"promptSections": [],
"sectionTemplates": {},
"responseSchema": {
"type": "object",
"required": [],
"properties": {}
},
"opts": {
"sendStructuredConvo": true
}
}
},
{
"type": "tool_runner",
"name": "Update contact card with dates",
"triggeredBy": [
"unreadMessage.fromAny"
],
"responseType": "json",
"nodeConfig": {
"type": "contact_tools",
"config": {},
"enabledTools": [
"set_attribute"
],
"tools": {
"set_attribute": {
"paramValues": {
"attributeName": {
"type": "fixed",
"value": "Dates"
},
"attributeValue": {
"path": "dates",
"type": "pipeline-variable"
}
}
}
}
}
},
{
"type": "ai_bot",
"name": "Extract date + times",
"triggeredBy": [
"unreadMessage.fromAny"
],
"responseType": "json",
"nodeConfig": {
"modelProvider": "openai",
"modelVersion": null,
"maxTokens": null,
"temperature": null,
"variables": {},
"prompt": "Your job is to extract the dates + times the employee wants to take PTO for. \n\nToday is :{{dateTimeIso}} \n\nOutput dates under \"dates\". \nOutput times under \"times\". If they are taking the whole day off, output \"whole day\" under times.",
"promptSections": [],
"sectionTemplates": {},
"responseSchema": {
"type": "object",
"required": [
"dates",
"times"
],
"properties": {
"dates": {
"type": "string"
},
"times": {
"type": "string"
}
}
},
"opts": {
"sendStructuredConvo": true
}
}
},
{
"type": "trigger",
"name": "Start",
"triggeredBy": [
"userMessage"
],
"responseType": "json"
}
],
"edges": [
{
"name": null,
"sourceNode": "Update contact card with times",
"destinationNode": "Converse / conclude",
"sourceVariables": null,
"filters": []
},
{
"name": null,
"sourceNode": "Update contact card with dates",
"destinationNode": "Update contact card with times",
"sourceVariables": null,
"filters": []
},
{
"name": null,
"sourceNode": "Extract date + times",
"destinationNode": "Update contact card with dates",
"sourceVariables": null,
"filters": []
},
{
"name": null,
"sourceNode": "Start",
"destinationNode": "Extract date + times",
"sourceVariables": null,
"filters": []
}
]
}