---
agent_capabilities:
- Ambient Agent
availability: GUIDE
description: Enables employees to receive instant notifications when their PTO requests are approved, rejected, or cancelled/corrected, without chasing manager approvals or checking HR systems. It improves visibility, trust, and transparency across the entire leave process.
name: Notify on PTO Decision
purple_chat_link: https://marketplace.moveworks.com/purple-chat?conversation=%7B%22messages%22%3A%5B%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp%3E%3Cstrong%3EDecision+Taken%3A+PTO+Rejected%3C%2Fstrong%3E%3C%2Fp%3E%3Cp%3EYour+Vacation+for+Feb+12%2C+2026+%E2%80%93+Feb+13%2C+2026+has+been+%3Cstrong%3ERejected%3C%2Fstrong%3E+by+Alex+Hall.%3C%2Fp%3E%3Cul%3E%3Cli%3E%3Cp%3E%3Cstrong%3ERequest+Dates%3A%3C%2Fstrong%3E+Feb+12%2C+2026+%E2%80%93+Feb+13%2C+2026%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3ELeave+type%3A%3C%2Fstrong%3E+Vacation%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EDecision+maker%3A%3C%2Fstrong%3E+Alex+Hall++%28alex.hall%40example.com%29%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3ETitle+and+Department%3A%3C%2Fstrong%3E+HR+Project+Manager%2C+Human+Resources%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EComments%3A%3C%2Fstrong%3E+Team+planning+meeting+is+scheduled+for+13+Feb+2026%2C+will+approve+if+you+can+move+the+leave+to+next+week%3C%2Fp%3E%3C%2Fli%3E%3C%2Ful%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp%3E%3Cstrong%3EDecision+Taken%3A+PTO+Approved%3C%2Fstrong%3E%3C%2Fp%3E%3Cp%3EYour+Vacation+for+Mar+05%2C+2026+%E2%80%93+Mar+07%2C+2026+has+been+%3Cstrong%3EApproved+%3C%2Fstrong%3Eby+Alex+Hall.%3C%2Fp%3E%3Cul%3E%3Cli%3E%3Cp%3E%3Cstrong%3ERequest+Dates%3A%3C%2Fstrong%3E+Mar+05%2C+2026+%E2%80%93+Mar+07%2C+2026%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3ELeave+type%3A%3C%2Fstrong%3E+Sick+leave%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EDecision+maker%3A%3C%2Fstrong%3E+Alex+Hall+%28alex.hall%40example.com%29%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3ETitle+and+Department%3A%3C%2Fstrong%3E+HR+Project+Manager%2C+Human+Resources%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EComments%3A%3C%2Fstrong%3E+no+concerns%3C%2Fp%3E%3C%2Fli%3E%3C%2Ful%3E%22%7D%5D%7D%5D%7D
solution_tags:
- HR - Other
- HR - Time & Absence
systems:
- sap-success-factors
---

# Description

The **“Notify on PTO Decision”** plugin delivers instant updates when PTO requests are approved, rejected, or cancelled — eliminating manager follow-ups and HR system checks while improving visibility and trust across the leave process.

# User Experience Preview

Please refer to the following [**Purple Chat**](https://marketplace.moveworks.com/purple-chat?conversation=%7B%22messages%22%3A%5B%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp%3E%3Cstrong%3EDecision+Taken%3A+PTO+Rejected%3C%2Fstrong%3E%3C%2Fp%3E%3Cp%3EYour+Vacation+for+Feb+12%2C+2026+%E2%80%93+Feb+13%2C+2026+has+been+%3Cstrong%3ERejected%3C%2Fstrong%3E+by+Alex+Hall.%3C%2Fp%3E%3Cul%3E%3Cli%3E%3Cp%3E%3Cstrong%3ERequest+Dates%3A%3C%2Fstrong%3E+Feb+12%2C+2026+%E2%80%93+Feb+13%2C+2026%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3ELeave+type%3A%3C%2Fstrong%3E+Vacation%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EDecision+maker%3A%3C%2Fstrong%3E+Alex+Hall++%28alex.hall%40example.com%29%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3ETitle+and+Department%3A%3C%2Fstrong%3E+HR+Project+Manager%2C+Human+Resources%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EComments%3A%3C%2Fstrong%3E+Team+planning+meeting+is+scheduled+for+13+Feb+2026%2C+will+approve+if+you+can+move+the+leave+to+next+week%3C%2Fp%3E%3C%2Fli%3E%3C%2Ful%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp%3E%3Cstrong%3EDecision+Taken%3A+PTO+Approved%3C%2Fstrong%3E%3C%2Fp%3E%3Cp%3EYour+Vacation+for+Mar+05%2C+2026+%E2%80%93+Mar+07%2C+2026+has+been+%3Cstrong%3EApproved+%3C%2Fstrong%3Eby+Alex+Hall.%3C%2Fp%3E%3Cul%3E%3Cli%3E%3Cp%3E%3Cstrong%3ERequest+Dates%3A%3C%2Fstrong%3E+Mar+05%2C+2026+%E2%80%93+Mar+07%2C+2026%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3ELeave+type%3A%3C%2Fstrong%3E+Sick+leave%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EDecision+maker%3A%3C%2Fstrong%3E+Alex+Hall+%28alex.hall%40example.com%29%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3ETitle+and+Department%3A%3C%2Fstrong%3E+HR+Project+Manager%2C+Human+Resources%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EComments%3A%3C%2Fstrong%3E+no+concerns%3C%2Fp%3E%3C%2Fli%3E%3C%2Ful%3E%22%7D%5D%7D%5D%7D) for a sample conversational experience between a user and the AI Assistant for this plugin.

# Pre-requisites

### 1. SAP SuccessFactors Connector:

To get started, complete the steps outlined in the **“SuccessFactors Integration Centre Webhook Documentation”** section of the [**SAP SuccessFactors Connector Guide](https://marketplace.moveworks.com/connectors/sap-success-factors#client-credentials)** available in the Moveworks Marketplace to get started.

The connector must be fully set up and before using this plugin.

### 2. SAP SuccessFactors System Requirements:

Before configuring this capability, ensure the required PTO workflows and permissions (approval, rejection, and cancellation) are enabled in your HRIS. Role-based actions, such as manager approvals or cancellations, are configuration-dependent and may not be enabled by default.

# **Implementation details**

## Visual Representation of How the Plugin Works

![SAPSF_Notify_on_PTO_Decision.png](SAP_SuccessFactors_Notify_on_PTO_Decision_Guide%20-%20/SAPSF_Notify_on_PTO_Decision.png)

## Setup in Moveworks

Follow the steps below to configure the plugin in your Moveworks environment. Please ensure all components adhere to the specified naming conventions.

1. **Create HTTP Action: SAP_SF_Get_Approver_Details**
    
    This is used to query the workflow steps and get approval comments details from SAP SF for a PTO
    
    ```json
    curl -X GET "https://<tenantURL>/odata/v2/WfRequest({{requestId}})?$expand:wfRequestCommentsNav&$select:wfRequestId,lastModifiedDateTime,lastModifiedBy,createdDateTime,lastModifiedOn,createdBy,status,wfRequestCommentsNav" \
      -H "Content-Type: application/json"
    ```
    

**Query Parameters:**

- `$SELECT` *(string):*  Static value “wfRequestId,status,wfRequestCommentsNav”. This will fetch Workflow Request Id, Approval Status and Approval comments attributes from the API response.
- `$EXPAND` *(string):* Static value “wfRequestCommentsNav”. This expands the Approval Comments attribute and retrieves value for each approval step of the PTO process. However, only the final approver’s comment is parsed and displayed in the notification sent to the requester, which is done by the compound action.

**Input Arguments:**

`{{requestId}}`- This will be fetched from the inbound payload coming from SAP SF to Moveworks Listener. Request Id is the unique Id of PTO used to fetch Employee Time details in SAP SF.

1. **Create Compound Action : SAP_SF_notify_PTO_decision_CA**

This compound action fetches the PTO requester’s user details and uses them to notify the requester of the approval, rejection or cancellation decision. 
Input Args to be created like below.

![image.png](SAP_SuccessFactors_Notify_on_PTO_Decision_Guide%20-%20/image.png)

Compound action code is below.

```json
steps:
  # 1. Batch fetch both users in one go (Network Optimization) 
  - action:
      action_name: mw.get_user_by_email
      output_key: user_data
      input_args:
        user_email: data.payload.RequestorEmail
          
  - action:
      action_name: SAP_SF_Get_Approver_Details
      output_key: wf_response
      input_args:
        requestId: data.payload.WorkflowRequestID

  # 2. Filter Logic
  - switch:
      cases:
        - condition: data.payload.ApprovalStatus IN ["APPROVED", "REJECTED", "CANCELLED"]
          steps:
            - notify:
                # Extract Requestor Record ID from the batch list using DSL Filter
                recipient_id: data.user_data.user.record_id
                output_key: notification_result
                message:
                  RENDER():
                    template: |
                      *Decision Taken: PTO {{status_text}}*
                      
                      Your {{leave_type}} for {{start}} – {{end}} has been *{{status_text}}* by {{last_modified_name}}.
                      
                      *Request Dates:* {{start}} – {{end}}
                      *Leave type:* {{leave_type}}
                      *Decision maker:* {{approver_info}}
                      *Title and Department:* {{title}}, {{department}}{{comments_section}}
                    args:
                      leave_type: data.payload.TimeOffType
                      id: data.payload.PTO_externalCode
                      title: data.payload.LastModifiedByUserTitle
                      department: data.payload.LastModifiedByUserDepartment
                      last_modified_name: data.payload.LastModifiedName
                      
                      
                      # Extract Approver Name from the batch list
                      approver_info: >
                        $CONCAT([data.payload.LastModifiedName, " (", data.payload.LastModifiedByEmail, ")"])

                      # Date Formatting
                      start: data.payload.StartDate.$PARSE_TIME().$FORMAT_TIME("%b %d, %Y")
                      end: data.payload.EndDate.$PARSE_TIME().$FORMAT_TIME("%b %d, %Y")
                      
                      # DSL Optimization: Convert "APPROVED" -> "Approved" automatically
                      status_text: data.payload.ApprovalStatus.$TITLECASE()

                      comments_section:
                        CONDITIONAL():
                          condition: >
                            $LENGTH(data.wf_response.d.wfRequestCommentsNav.results) > 0
                            AND
                            data.payload.ApprovalStatus IN ["APPROVED", "REJECTED"]
                            AND
                            data.wf_response.d.wfRequestCommentsNav.results[-1].actionType != "INITIATE"
                            AND
                            data.wf_response.d.wfRequestCommentsNav.results[-1].comments != null
                            AND
                            data.wf_response.d.wfRequestCommentsNav.results[-1].comments != ""
                          on_pass: 
                             RENDER():
                              template: "\n*Comments:* {{text}}"
                              args:
                                text: data.wf_response.d.wfRequestCommentsNav.results[-1].comments
                          on_fail: '""'
                      
```

1. Navigate to Agent studio and create a new plugin. Choose the trigger condition as system and trigger type as webhook. Please select the webhook created as a part of Pre-Req #1. 
2. In the body, select the type as system body and Action as compound action created in Step #2 with input mapping as below and save the plugin.

```bash
payload: parsed_body
```

# **What Is In Scope for This Plugin?**

This plugin supports the following capabilities:

- Notifying PTO decisions for approval, rejection and cancellation of PTO request.
- **Cancellation notifications** are sent when a PTO request is cancelled either by the employee themselves or by another authorized user (for example, a manager).
    - Note : Manager’s ability to Cancel a PTO Request for an Employee is dependent on org’s HRIS configuration. It is not a by-default setup, and hence, customers should enable this workflow/ setting in their HRIS at the time of installation of this plugin.
- Supports notifications for **all leave types** supported by SAP SF.
- Supports single and multi level approvals. However, for multi level approvals, notification will be triggered on final approval status change of PTO.

# **What Is Out of Scope for This Plugin?**

This plugin does **not** support the following:

- Filtering of PTO decision notifications to **limited leave types only**
- Retrieval of PTO Balances are handled by a separate plugin.
- Approving, rejecting, editing, or cancelling PTO are handled by separate plugins.
- For multi level approvals, notification of intermediate approval level decisions:
    - Submitted
    - Pending approval
    - Waiting for next approver / Partially approved
    - Returned for clarification
    - Needs more information - Send Back to Employee (business process action, not a status change)