Power Automate

Setup Connector

Power Automate is a cloud-based service that allows you to create automated workflows between your favourite applications and services. This connector enables integration with Power Automate to manage and execute desktop flows for automated task execution.

Integration

Leena AI integrates with Power Automate using Microsoft 'Dataverse' APIs and Azure Active Directory authentication.

Authentication

Leena AI supports OAuth 2.0 authentication for Power Automate through Azure Active Directory. Follow these steps to set up authentication:

Prerequisites

  • Azure Account with administrative privileges
  • Access to Power Automate Admin Center
  • Appropriate permissions to create and manage applications

Step 1: Azure Application Registration

  1. Register a new application in Azure Portal (standard registration)
  2. Configure 'Dataverse' API permissions for the registered application

Step 2: Power Automate User Configuration

  1. Navigate to Power Automate Admin Center
  2. Select your target environment
  1. Go to Settings > Users & Permissions > Application Users
  2. Click "Add app user"
  1. Select "Add an App" and choose the application created in Azure under step 1
  2. Assign the application to a business unit
  3. Grant "System Administration" role to the application

Step 3: Authentication Details

To authenticate, you'll need the following credentials:

  • Tenant ID (from Azure Portal)
  • Client ID (Application ID from Azure Portal)
  • Client Secret (generated in Azure Portal)
  • Organisation URL (found in Environment overview page)

Important Notes

  • Ensure all required permissions are properly configured in Azure AD
  • Keep authentication credentials secure and never expose them in client-side code
  • Regularly rotate client secrets following security best practices
  • Organization URL format should be: https://organization.crm{number}.dynamics.com

Supported Actions

ActionDescription
Get desktop flowsThis action fetches all the created desktop flows in Power Automate console.
Trigger desktop flowThis action allows triggering a specific desktop flow.
Get desktop flow statusThis action fetches the status of a desktop flow.
Get desktop flow outputThis action allows fetching the output of a triggered desktop flow.
Cancel desktop flowThis action allows cancelling a triggered desktop flow.

Use cases

An employee requests Leena AI virtual assistant to help it reset a password for legacy SAP system. Leena AI leverages Power Automate desktop flow to perform an RPA and reset password for the requester/employee.

Get Desktop Flows

This action allows fetching desktop flows created under Power Automate console. User can pass a specific category to fetch specific flows.

Input Fields

FieldDescriptionExample
Filter byYou can pass a category to fetch desktop flows/workflows specific to that category. This field expects the category id6
SelectThe details associated with the workflow/flow that needs to be returnedname, workflowid
Order byThe response or the list of desktop flows can be ordered based on the name of the flows or idname

Use Cases

An employee reaches out to Leena AI Virtual Assistant regarding troubleshooting. Leena AI Orchestrator can use this action to list all the available desktop flows and stitch a flow to solve the user's query.


Trigger Desktop Flow

Triggers a desktop flow created under Power Automate console.

Input Fields

FieldDescriptionExample
Workflow/Desktop flow IDThe unique ID of the workflow/desktop flow used to trigger it.7fac4006-43cb-462d-9b8f-095bf914f6f4
InputsAll the dynamic keys/details that are required to trigger a desktop flow.
Run ModeThe type of mode to trigger the desktop flow.Unattended / Attended
PrioritySet the priority of the workflow trigger.Normal
Timeout (secs)Configure the desktop flow time-out period.7200

Use Cases

An employee reaches out to Leena AI Virtual Assistant regarding troubleshooting. Leena AI Orchestrator can use this action to list all the available desktop flows and stitch a flow to solve the user's query.

The Orchestrator identifies the desktop flow that can be triggered to reset the password of the legacy application and triggers it.


Get Desktop Flow Status

Each trigger of desktop flow/workflow is called a 'Session'.

This action allows fetching the status of a triggered desktop flow session.

Input Fields

FieldDescriptionExample
Flow session IDThe unique ID of the desktop flow/workflow trigger instance33aa4f29-4e5c-498c-b2eb-d33a5a876d64
SelectAll the required details which are to be fetched for a flow sessionstatus code, state code, started on, completed on

Use Cases

An employee can request Leena AI Virtual Assistant to fetch the status of the troubleshooting requests raised by it. Leena AI Orchestrator/Autonomous Agents can leverage this action to fetch the status of the triggered workflows on behalf of the employee using flow session IDs.


Get Desktop Flow Output

Each trigger of desktop flow/workflow is called a 'Session'.

This action allows fetching the output of a triggered desktop flow session.

Input Fields

FieldDescriptionExample
Flow session IDThe unique ID of the desktop flow/workflow trigger instance33aa4f29-4e5c-498c-b2eb-d33a5a876d64

Use Cases

An employee can request Leena AI Virtual Assistant to fetch the status of the troubleshooting requests raised by it. Leena AI Orchestrator/Autonomous Agents can leverage this action to fetch the output of the completed flow sessions and showcase results to the requester.


Cancel Desktop Flow

Each trigger of desktop flow/workflow is called a 'Session'.

This action allows cancelling a triggered desktop flow session.

Input Fields

FieldDescriptionExample
Flow session IDThe unique ID of the desktop flow/workflow trigger instance33aa4f29-4e5c-498c-b2eb-d33a5a876d64

Use Cases

Leena AI Orchestrator can leverage this action to trigger a cancellation request of a desktop flow session based on the request of the employee or due to a real-time stitched flow execution criteria changes.