MS Teams Notifications & Approvals
Note
This integration replaces Microsoft Teams: Send and Receive Notifications.
Disclaimer
Your use of this download is governed by Stonebranch’s Terms of Use.
Version Information
Template Name | Extension Name | Version | Status |
|---|---|---|---|
| MS Teams Notifications & Approvals | ue-msteams-msg | 1 (Current 1.0.0) | Fixes and new Features are introduced. |
Refer to the Changelog for version history information.
Overview
MS Teams Notifications & Approvals is an integration that utilizes UAC's Approval Tasks to deliver notifications and approval requests to Microsoft Teams channels with the usage of Power Automate Webhooks and Adaptive Cards. The Adaptive Card templates can be modified, allowing the integration to be aligned with any Power Automate flow configuration. Pre-configured Power Automate Cloud Flows are included to facilitate a quick and straightforward configuration process.
Key Features
| Feature | Description |
|---|---|
| Send Notification | Send a Notification to Microsoft Teams. |
| Send Approval Requests | Send a Notification to Microsoft Teams with Approval & Rejection options. |
Requirements
This integration requires a Universal Agent and a Python runtime to execute the Universal Task.
Area | Details |
|---|---|
| Python Version | Requires Python 3.11. Tested with Agent bundled python distribution. |
| Universal Agent Compatibility |
|
| Universal Controller Compatibility | Universal Controller Version >= 7.6.0.0. |
| Network and Connectivity | Network connectivity towards Microsoft Power Automate, as well as inbound connectivity to the Universal Automation Center (UAC) from Microsoft Power Automate, is required. |
| Adaptive Card Version | Tested with Adaptive Cards v1.5 |
Supported Actions
There are three Top-Level actions controlled by the Action Field:
Send Notification
- Send Approval Task Notification
- Send Approval Manual Task Notification (Legacy)
Additional options and post-action capabilities vary depending on the chosen Action.
Send Notification
This action allows users to send a notification to a Microsoft Teams chat or channel through a specified webhook address. Information about the notification can be provided using Microsoft Adaptive Cards, which can be supplied to the Extension Template either as a script or directly in JSON format. A Power Automate flow is also provided, which receives the Adaptive Card payload through the webhook and manages the communication with Microsoft Teams.
Result of the Send Notification action in Microsoft Teams
Send Approval Task Notification
This action allows users to send a notification to a Microsoft Teams chat or channel through a specified webhook address by utilizing Approval Tasks (Introduced in UAC 7.9). Users only need to specify a Webhook Address and a Task Instance ID. A preconfigured Power Automate flow is provided that manages the communication with Microsoft Teams as well as the approval of the Approval Task with UAC.
Result of the Send Approval Task Notification action in Microsoft Teams
Send Approval Manual Task Notification (Legacy)
Allows users to send a notification to a Microsoft Teams chat or channel through a specified webhook address by utilizing Manual Tasks. Information about the notification can be provided using Microsoft Adaptive Cards, which can be supplied to the Extension Template either as a script or directly in JSON format. A Power Automate flow is also provided, which receives the Adaptive Card payload through the webhook and manages the communication with Microsoft Teams.
This action is marked as Legacy and exists so that MS Teams Notifications & Approvals is compatible with UAC versions prior to 7.9. This functionality will be removed in upcoming releases. Users are therefore advised to update their workflows to use Approval Tasks with the Send Approval Task Notification action.
Result of the Send Approval Manual Task Notification action in Microsoft Teams
Action Output
| Output Type | Description | Examples |
|---|---|---|
| EXTENSION |
The Extension Output for this Universal Extension is in JSON format as shown in the example. | |
| STDERR | STDERR provides additional information to the User. The populated content can be changed in future versions of this extension without notice. Backward compatibility is not guaranteed. |
Configuration Examples
Example: Start a Task and send a Notification to MS Teams
Create an MS Teams Notifications & Approvals Task using a custom Adaptive Card provided as a UAC Script.
Example: Send an Approval Request to MS Teams using an Approval Task
Create an MS Teams Notifications & Approvals Task and set a target Approval Task Instance ID in "Approval Required" status. This action requires the installation of the provided PowerAutomate Solution.
Example: Send an Approval Request to MS Teams using a Manual Task (Legacy)
Create an MS Teams Notifications & Approvals Task and set a target Manual Task Instance ID in "Action Required" status. This action requires the installation of the provided PowerAutomate Solution.
Importable Configuration Examples
This integration provides importable configuration examples along with their dependencies, grouped as Use Cases to better describe end to end capabilities.
These examples aid in allowing task authors to get more familiar with the configuration of tasks and related Use Cases. Such tasks should be imported in a Test system and should not be used directly in production.
Initial Preparation Steps
STEP 1: Go to Stonebranch Integration Hub download integration with name "MS Teams Notifications & Approvals" and extract the archive in a local directory.
STEP 2: Locate and import the "MS Teams Notifications & Approvals" integration to the target Universal Controller. For more information refer to the How To section in this document.
STEP 3: Manually create two Universal Event Templates with names "uc2_msteams_msg_expense_request" & "uc3_msteams_msg_expense_request". Both need to have a "payload" attribute and the Unmapped Attributes Policy set to "Include Attributes". This is a necessary step as Universal Event Templates are not importable in the same manner as other UAC entities.
- STEP 4: Inside the directory named "configuration_examples", you will find a list of definition zip files. Upload them one by one respecting the order presented below, by using the "Upload" functionality of Universal Controller:
- STEP 4(a): If you plan on uploading the configuration examples on UAC versions 7.6 to 7.8, upload the following zip files in the following order:
- 1_variables.zip
- 2_scripts.zip
- 3_tasks.zip
- 4_workflows.zip
- 5_triggers.zip
- STEP 4(b): If you plan on uploading the configuration examples on UAC 7.9 onwards, upload the following zip files in the following order:
- 1_variables.zip
- 2_scripts.zip
- 3_tasks_uac_7_9.zip
- 4_workflows_uac_7_9.zip
- 5_triggers_uac_7_9.zip
- STEP 4(a): If you plan on uploading the configuration examples on UAC versions 7.6 to 7.8, upload the following zip files in the following order:
- Make sure to upload the .zip files with respect to the target UAC version.
- The order indicated above ensures that the dependencies of the imported entities are uploaded first.
- All imported entities are prefixed with UC1, UC2, UC3 etc...
- STEP 5: Inside the directory named "3pp" you will find a file named "MSTeamsNotificationsApprovals_<version_number>.zip". This file should be uploaded at the Power Automate platform. For more information refer to the How To section in this document.
- STEP 6: Update the UAC global variables introduced with the "variables.zip" definition file. Their names are prefixed with "ue_msteams_msg". Review the description of the variables as they include information on how should be populated.
How to "Upload" Definition Files to a Universal Controller
The "Upload" functionality of Universal Controller allows Users to import definitions exported with the "Download" functionality.
Login to Universal Controller and:
- STEP 1: Click on "Tasks" → "All Tasks"
- STEP 2: Right click on the top of the column named "Name"
- STEP 3: Click "Upload..."
In the pop-up "Upload..." dialogue:
- STEP 1: Click "Choose File".
- STEP 2: Select the appropriate zip definition file and click "Upload".
- STEP 3: Observe the Console for possible errors.
How to Import Solutions to PowerAutomate
STEP 1: Navigate to the Power Automate Solutions Tab and click Import Solution at the top of the page.
- STEP 2: Select Next and provide information as prompted.
- STEP 3: After a while, the Solution should be imported. Double click the Solution > Navigate to Cloud Flows > Select the desired Flow > Click Edit
- STEP 4: Select the Webhook action and save the generated HTTP URL. If it does not exist, click the Save and Publish buttons (if available) at the top-right of the screen to generate it.
- STEP 5: Select all MS Teams related actions and, from the drop-down menus, set the desired chat/channel to receive notifications & approval requests.
Use Case 1: Emission of Notifications to Microsoft Teams upon Workflow Execution
Description
In this Use Case, a Workflow is executed, and a Notification is sent to Microsoft Teams displaying Task-related information. The contents of the notification are fully customizable.
A default UAC Script is also provided.
The tasks configured demonstrate the following capabilities among others:
- Capability to propagate structured notifications to designated Teams channels and group chats.
- Adaptive Card templates are fully customizable, offering the flexibility to design notifications for virtually any business scenario.
- As a result of the previous bullet point, any custom Power Automate Cloud Flow can be used with this integration - beyond notification purposes - as long as the designed Cloud Flow is triggered by a Webhook with an Adaptive Card as the payload.
The components of the solution are described below:
"UC1: MS Teams Notifications & Approvals - Send Notification To MS Teams" - This is the starting task of the workflow. It sends an Adaptive Card to Power Automate. The Power Automate Flow sends this card to MS Teams.
"UC1: MS Teams Notifications & Approvals - Represents Subsequent Actions" - The Linux Task to be executed on the deployed agent.
Resulting Microsoft Teams Notification:
How to Run
Execution Steps:
- STEP 1: Launch Workflow "UC1: MS Teams Notifications & Approvals - Workflow With Notification".
- STEP 2: Review the outputs of the Task Instances.
- STEP 3: Review the notification that was sent to MS Teams
Expected Results:
The Workflow is executed successfully.
An Adaptive Card is displayed at a Microsoft Teams Chat/Channel with useful information.
Use Case 2: Retrieval of Business Expense Requests from 3rd Party Systems using UAC Webhooks & Approval Tasks
Description
In this Use Case, a Workflow is triggered by an external system that managed expenses and an approval request is sent to Microsoft Teams if the expense amount is equal or exceeds $100.
The tasks configured demonstrate the following capabilities among others:
- Automate business expense request routing and approval processes.
- Transmit notifications and Approval Requests to Microsoft Teams, with the capability to target multiple business-unit–specific channels.
- Enable approval teams to make decisions from their familiar Teams environment without access to the UAC platform.
The components of the solution are described below:
- "UC2: MS Teams Notifications & Approvals - Process Expense Request" - This is the starting task of the workflow. It parses the JSON payload received by the Universal Event via the Webhook and sets the "expense_amount" variable.
- "UC2: MS Teams Notifications & Approvals - Exceeding Threshold Approval Request" - If the ${expense_amount} is above $100 this task is executed and performs the system operation "Run Task Instance Command: Clear Predecessors" with the ID of the MS so that the MS Teams Task can be executed. In the meantime, the Approval Task remains at "Approval Required" status until it is Approved. More Information about setting that System Operation can be found here.
- "UC2: MS Teams Notifications & Approvals - Send Approval Request to MS Teams" - This Task sends the Approval Request to MS Teams using the Task ID of its predecessor.
- "UC2: MS Teams Notifications & Approvals - Represents Subsequent Actions After Approval" - This Linux Task represents any action that should be performed after the expense is approved.
- "UC2: MS Teams Notifications & Approvals - Represents Subsequent Actions After Rejection" - This Linux Task represents any action that should be performed after the expense is rejected.
Resulting Microsoft Teams Notification:
How to Run
Execution Steps:
- STEP 1: Enable the "UC2: MS Teams Notifications & Approvals - Trigger Webhook Workflow" Universal Monitor Trigger.
- STEP 2: Open the RESTful Web Services API by clicking the exclamation icon at the top right in the UAC dashboard > Search for the
/resources/universalevent/push/endpoint > Select "Try it out" > Fill in the eventName value with "uc2_msteams_msg_expense_request" (ttl can be left empty) > Place the following JSON in the request body > Click Execute and fill the Authentication information when prompted:
{
"amount":100,
"date":"25/11/2025",
"merchant":"Sample Hotel S.A.",
"category":"travel",
"description":"Hotel reservation",
"employee":"Stonebranch Employee",
"id":"e90159e7-573a-4aa4-8834-371adc92bab6"
}
- STEP 3: Verify that the Workflow "UC2: MS Teams Notifications & Approvals - Receive an Expense Request from an External System via Webhook" has been launched.
- STEP 4: Review the notification that was sent to Microsoft Teams.
- STEP 5: Approve/Reject the approval request through Microsoft Teams.
Expected Results:
The Workflow is executed successfully.
An Adaptive Card is displayed at a Microsoft Teams Chat/Channel with the Approve/Reject actions.
When one of the Approve/Reject actions is clicked in Microsoft Teams, the Approval Task should change to the corresponding status.
Use Case 3: Retrieval of Business Expense Requests from 3rd Party Systems using UAC Webhooks & Manual Tasks
Description
In this Use Case, a Workflow is triggered by an external system that manages expenses, and an approval request is sent to Microsoft Teams if the expense amount is greater than or equal to $100. This is the same as Use Case 2, except that this case uses Manual Tasks for compatibility with UAC versions 7.6 through 7.8.
The tasks configured demonstrate the following capabilities among others:
- Automate business expense request routing and approval processes.
- Transmit notifications and Approval Requests to Microsoft Teams, with the capability to target multiple business-unit–specific channels.
- Enable approval teams to make decisions from their familiar Teams environment without access to the UAC platform.
The components of the solution are described below:
- "UC3: MS Teams Notifications & Approvals - Process Expense Request" - This is the starting task of the workflow. It parses the JSON payload received by the Universal Event via the Webhook and sets the "expense_amount" variable.
- "UC3: MS Teams Notifications & Approvals - Exceeding Threshold Manual Task Approval Request" - If the
${expense_amount}is above $100, this task is executed and performs the system operation "Run Task Instance Command: Clear Predecessors" with the ID of the MS so that the MS Teams Task can be executed. In the meantime, the Manual Task remains at "Action Required" status until it is Approved. More Information about setting that System Operation can be found here. - "UC3: MS Teams Notifications & Approvals - Send Approval Request to MS Teams" - This Task sends the Approval Request to MS Teams using the Task ID of its predecessor.
- "UC3: MS Teams Notifications & Approvals - Represents Subsequent Actions After Approval" - This Linux Task represents any action that should be performed after the expense is approved.
Resulting Microsoft Teams Notification:
How to Run
Execution Steps:
- STEP 1: Enable the "UC3: MS Teams Notifications & Approvals - Trigger Webhook Workflow" Universal Monitor Trigger.
- STEP 2: Configure and run the following curl command.
curl --location 'https://UAC_HOSTNAME/resources/universalevent/push/uc3_msteams_msg_expense_request' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic ****' \
--data '{
"amount":100,
"date":"25/11/2025",
"merchant":"Sample Hotel S.A.",
"category":"travel",
"description":"Hotel reservation",
"employee":"Stonebranch Employee",
"id":"e90159e7-573a-4aa4-8834-371adc92bab6"
}'
- STEP 3: Verify that the Workflow "UC3: MS Teams Notifications & Approvals - Receive an Expense Request from an External System via Webhook - Using A Manual Task for Approval" has been launched.
- STEP 4: Review the notification that was sent to MS Teams
- STEP 5: Approve the approval request through MS Teams.
Expected Results:
The Workflow is executed successfully.
An Adaptive Card is being displayed at a Microsoft Teams Chat/Channel with the Approve action.
When the Approve action is clicked in MS Teams, the Manual Task should change to Success status.
Using the "Run Task Instance Command: Clear Predecessors"
The Approval and Manual UAC Tasks are Tasks that, by design, remain in a non-terminal state for extended periods of time. These types of Tasks require extra care when inserted into a Workflow, as Workflows expect the previous Task to finish with a terminal status Success/Failure/Cancel before resolving the subsequent Connectors, so that subsequent Tasks can be released (executed). To circumvent this problem, there are two ways to pair the MS Teams Notifications & Approvals integration with Approval and Manual Tasks inside a Workflow. One option is using the "Launch Task" system operation, and the other is the "Run Task Instance Command: Clear Predecessors" operation.
The latter is recommended approach, as that way the successor Task can inherit the Set Variables from its predecessor. To set it up properly, in the Approval (or Manual Task if it is going to be used in place of an Approval Task), go to Actions > System Operations > Click the "+" button > Select what Task status should launch this operation (Approval/Action Required) > Select the Run Task Instance Command System Operation > Set the Clear Predecessors Command and, finally, use the ${_siblingid('<descendant_task_name_that_should_be_released_before_parent_tak_completion>')} UAC Function.
It is also recommended to remove the System Notification, to avoid false positive Warnings.
The following image showcases how to set this option:
Input Fields
| Field | Type | Description | Version Information |
|---|---|---|---|
| Action | Choice | The action to be executed. The following options are available.
| Introduced in 1.0.0 |
| Approval Task Instance ID | Text | This field is visible when "Send Approval Task Notification" or "Send Manual Task Notification" are selected. Set to specify the target Approval or Manual Task to receive the Approval/Rejection request. | Introduced in 1.0.0 |
| MS Teams Webhook URL | Large Text | The Webhook URL that is found in the "When a Teams webhook request is received" Power Automate action. | Introduced in 1.0.0 |
| Provide Adaptive Card | Choice | Visible when action Send Notification is selected. Offers the following choices:
| Introduced in 1.0.0 |
| Adaptive Card | Script | Visible when selecting Adaptive Card Type Script Provide the Adaptive Card as a UAC Script. | Introduced in 1.0.0 |
| Adaptive Card | Large Text (JSON) | Visible when selecting Adaptive Card Type JSON Provide the Adaptive Card as JSON. The default value of this field is also usable out-of-the-box. | Introduced in 1.0.0 |
| Approval Job Name | Text | This field is visible when the "Send Manual Task Notification (Legacy)" Action is selected. Set an Approval Job Name for the Adaptive Card that will be sent to Power Automate. | Introduced in 1.0.0 |
| Approval Description | Large Text | This field is visible when the "Send Manual Task Notification (Legacy)" Action is selected. Set an Approval Description for the Adaptive Card that will be sent to Power Automate. | Introduced in 1.0.0 |
| Executed By | Text | This field is visible when the "Send Manual Task Notification (Legacy)" Action is selected. Set the Executed By information for the Adaptive Card that will be sent to Power Automate. | Introduced in 1.0.0 |
Environment Variables
Environment Variables can be set from the Environment Variables task definition table.
| Environment Variable Name | Description | Version Information |
|---|---|---|
| UE_HTTP_TIMEOUT | This environment variable defines the global timeout value for all requests. It affects both connection and read timeouts, preventing requests from hanging. Accepted values: Positive integer (in seconds). If the environment variable is not set, or is set to an invalid value, the timeout will default to 60 seconds. | Introduced in 1.0.0 |
Exit Codes
Exit Code | Status | Status Description | Meaning |
|---|---|---|---|
| 0 | Success | “Task executed successfully.“ | Successful Execution. |
| 1 | Failure | “Execution Failed: <<Error Description>>” | Generic Error. Raised in case of failure and in case no other failure exit code is applicable. |
| 20 | Failure | “Data Validation Error: <<Error Description>>“ | Input fields validation error. |
STDOUT and STDERR
STDOUT is used for displaying Job information. It is controlled by the STDOUT Options field.
STDERR provides additional information to the user. The level of detail is tuned by Log Level Task Definition field.
Backwards compatibility is not guaranteed for the content of STDOUT/STDERR and can be changed in future versions without notice.
How To
Import Universal Template
To use the Universal Template, you first must perform the following steps.
This Universal Task requires the Resolvable Credentials feature. Check that the Resolvable Credentials Permitted system property has been set to true.
Import the Universal Template into your Controller:
Extract the zip file, you downloaded from the Integration Hub.
In the Controller UI, select Services > Import Integration Template option.
Browse to the “export” folder under the extracted files for the ZIP file (Name of the file will be unv_tmplt_*.zip) and click Import.
When the file is imported successfully, refresh the Universal Templates list; the Universal Template will appear on the list.
Modifications of this integration, applied by users or customers, before or after import, might affect the supportability of this integration. For more information refer to Integration Modifications.
Configure Universal Task
For a new Universal Task, create a new task, and enter the required input fields.
Integration Modifications
Modifications applied by users or customers, before or after import, might affect the supportability of this integration. The following modifications are discouraged to retain the support level as applied for this integration.
Python code modifications should not be done.
Template Modifications
General Section
"Name", "Extension", "Variable Prefix", and "Icon" should not be changed.
Universal Template Details Section
"Template Type", "Agent Type", "Send Extension Variables", and "Always Cancel on Force Finish" should not be changed.
Result Processing Defaults Section
Success and Failure Exit codes should not be changed.
Success and Failure Output processing should not be changed.
Fields Restriction Section
The setup of the template does not impose any restrictions, However with respect to the "Exit Code Processing Fields" section.Success/Failure exit codes need to be respected.
In principle, as STDERR and STDOUT outputs can change in follow-up releases of this integration, they should not be considered as a reliable source for determining the success or failure of a task.
Users and customers are encouraged to report defects, or feature requests at Stonebranch Support Desk.
Document References
This document references the following links:
| Document Link | Description |
|---|---|
| Universal Templates | User documentation for creating, working with, and understanding Universal Templates and Integrations. |
| Universal Tasks | User documentation for creating Universal Tasks in the Universal Controller user interface. |
| Power Automate | The Microsoft Power Automate Platform |
| Adaptive Cards Designer | Inspect & Design Adaptive Cards |
Changelog
ue-msteams-msg-1.0.0 (2025-12-04)
Initial Release


