Microsoft Power Automate is a cloud-based, low-code/no-code platform that makes it easy to
automate repetitive tasks and streamline business processes across various applications and services.
CData API Server extends the capabilities of Power Automate by enabling
access to data from multiple sources and applications—whether on-premises or in the cloud. With the
RabbitMQ Connector in the API Server (or any of the hundreds of available connectors),
you can natively create actions and complex workflows and trigger them in Power Automate using industry-standard data access
protocols like OData and Swagger.
In this article, we'll set up Power Automate and CData API Server to create a simple trigger that sends an email or
notification whenever a lead in a RabbitMQ table matches specific criteria.
Let's begin!
Prerequisites
-
CData API Server: Download a
free trial here.
-
Microsoft Power Automate: Signup for a
free trial from here.
-
An active RabbitMQ account with access to your data.
Overview
Here's a quick overview of the steps we'll follow:
-
Install CData API Server, configure a connection to RabbitMQ, and generate
OData API endpoints for RabbitMQ data within the API Server.
-
Use these endpoints in Power Automate to build a flow that automatically sends an email
based on triggers from your RabbitMQ table when specific criteria are met.
Step 1: Install the API Server and Add a Connection to RabbitMQ
1.1 Install the API Server
If you haven't already, download an installer for your operating system from the CData API Server page.
Follow the installation wizard to complete the setup on your machine.
Once installed, you can start the server in the following ways:
-
Windows: CData API Server runs as a service by default. Ensure the service is
running, then open http://localhost:8080/ in your browser to access the API Server admin console.
-
Linux/Mac: You can run the server manually or as a service. To start it manually, navigate to
the installation directory and run java -jar apiserver.jar.
-
Alternatively, run service.sh with root privileges to set up API Server as a Linux system service.
1.2 Enable CORS
When Microsoft Power Automate and the CData API Server are hosted on different domains, CORS (Cross-Origin Resource Sharing) must be
enabled to allow seamless cross-domain communication. To enable CORS in the API Server:
- Go to Settings and click the icon to edit CORS settings.
- Enable Cross-Origin Resource Sharing (CORS).
- Enable Allow all domains without '*' to accept any origin.
- In Access-Control-Allow-Origin, enter your RabbitMQ origin domain,
or use * to allow all domains (suitable for public APIs).
- Enable Access-Control-Allow-Credentials to allow cookies and auth headers.
- In Access-Control-Allow-Methods, enter GET, PUT, POST, OPTIONS.
- In Access-Control-Allow-Headers, enter Authorization, Content-Type.
- Set Access-Control-Max-Age (default: 3600 seconds) to cache preflight requests.
- Click Save.
👁 Enabling CORS Settings in the CData API Server
1.3 Add a RabbitMQ Connection in the API Server
-
Go to Settings and click
Add Connection in the top-right.
-
Select RabbitMQ. If it's not visible, toggle off
Only Installed to view all connectors.
-
Click Install Connector to auto-install.
For a manual setup, choose Manual Install and upload the downloaded ZIP file.
-
Once installed, click RabbitMQ again to open its connection settings and
configure using the details below.
About RabbitMQ Management HTTP API
RabbitMQ is an open-source message broker that supports multiple messaging protocols. The RabbitMQ Management HTTP API provides HTTP-based access to management and monitoring data for a RabbitMQ server. The API exposes information about virtual hosts, exchanges, queues, bindings, connections, channels, consumers, users, permissions, policies, and cluster-wide statistics.
The Management plugin must be enabled on the RabbitMQ server for the HTTP API to be available. By default, the management interface listens on port 15672.
Using Basic Authentication
RabbitMQ Management HTTP API uses HTTP Basic authentication. You must supply the username and password of a RabbitMQ management user.
To enable access to the management API:
- Ensure the RabbitMQ Management plugin is enabled on your server (rabbitmq-plugins enable rabbitmq_management).
- Use an existing management user or create one with the appropriate management tag (management, policymaker, monitoring, or administrator).
- Note the full base URL of your RabbitMQ Management HTTP API (e.g., http://localhost:15672).
After configuring your RabbitMQ server, set the following connection properties to connect:
- AuthScheme: Set this to Basic.
- URL: Set this to the base URL of your RabbitMQ Management HTTP API (e.g., http://localhost:15672).
- User: Set this to your RabbitMQ management username (e.g., guest).
- Password: Set this to your RabbitMQ management password.
Example connection string:
Profile=C:\profiles\RabbitMQ.apip;AuthScheme=Basic;URL=http://localhost:15672;User=guest;Password=guest;
Available Tables
The RabbitMQ profile provides access to the following tables:
- Overview - Cluster-wide statistics and information about the RabbitMQ node
- Nodes - Information about individual nodes in the RabbitMQ cluster
- NodeMemory - Detailed memory usage breakdown for a specific cluster node
- Connections - List of all open AMQP connections to the broker
- Channels - List of all open AMQP channels across all connections
- Consumers - List of all consumers registered across all queues
- Exchanges - List of exchanges declared across all virtual hosts
- Queues - List of queues declared across all virtual hosts
- Bindings - List of all bindings between exchanges and queues
- VirtualHosts - List of virtual hosts configured on the broker
- VhostPermissions - User permissions within a specific virtual host
- Users - List of all RabbitMQ users
- Permissions - Permission records for all users across all virtual hosts
- TopicPermissions - Topic-level permission records for all users
- Policies - List of policies applied to queues and exchanges in virtual hosts
- OperatorPolicies - List of operator policies applied to queues in virtual hosts
- Parameters - List of component parameters (e.g., federation, shovel) per virtual host
- GlobalParameters - List of global parameters that apply across all virtual hosts
- VhostLimits - Resource limits configured for specific virtual hosts
- UserLimits - Resource limits configured for specific users
- FeatureFlags - List of feature flags and their enabled/disabled state on the node
- DeprecatedFeatures - List of deprecated features and their usage state
- AuthAttempts - Authentication attempt statistics for the node
- ClusterName - The name of the RabbitMQ cluster
- WhoAmI - Information about the currently authenticated management user
- ExchangeBindingsSource - Bindings for which a specific exchange is the source
- ExchangeBindingsDestination - Bindings for which a specific exchange is the destination
- QueueBindings - Bindings for a specific queue within a virtual host
- Click Save & Test to validate and complete the connection setup.
👁 Adding a Connection in the CData API Server (Salesforce is Shown)
1.4 Add and Configure Users
To allow secure access to the created OData endpoints, create and configure Users in the CData API Server.
Each user has authentication credentials and role-based access control, ensuring that only authorized users
with appropriate roles can query the connected data.
-
Go to Users from the navigation pane, then click
Add User in the top-right corner.
- Enter a Username and set a secure Password for the user.
- Select a Role:
- Admin: Full access to all features, including settings and connections.
- Query: Limited to data access via API endpoints (suitable for Power Automate use).
- (Optional) Configure rate limits:
- Requests Per Hour: Number of allowed API calls per hour (default: 1000).
- Max Concurrent Requests: Number of parallel API requests allowed (default: 10).
- Define Privileges for the user:
- GET: Allows data retrieval.
- POST: Allows creation of new records.
- PUT, MERGE, PATCH: Allows updates to existing records.
- DELETE: Allows deletion of records.
- Click Add User to save and activate the user account.
👁 Adding a User in the CData API Server
Once a user is added, an Authtoken is automatically generated. This token can be
used in API requests as a secure authentication method instead of a password.
You can also refresh the Authtoken, disable it, or set expiration rules (e.g., number of days until expiry)
by enabling the Token Expiration option in the user settings.
👁 'Authtoken' Settings for the Added User in CData API Server
1.5 Add Tables for the Endpoint
To make data from RabbitMQ available in Power Automate via OData, you need to expose your desired tables through the API Server. Here's how:
-
In the CData API Server, go to API from the left navigation, then click
Add Table at the top-right.
-
Select the RabbitMQ connection you configured earlier, then click Next.
-
Browse available entities and schema by expanding the Tables section.
Select individual tables, or click the TABLE NAME checkbox
at the top to select all. Then click Confirm.
👁 Adding Tables for API Endpoint in CData API Server
1.6 Access the Endpoints in Power Automate
Now that your API is configured, Power Automate can connect to the OData endpoints to automate tasks.
Below are the URL formats for OData endpoints that you can use:
| Endpoint |
|
URL |
| Entity List |
http://address:port/api.rsc/ |
| Table Metadata (e.g., albums) |
http://address:port/api.rsc/albums/$metadata?@json |
| Table Data (e.g., albums) |
http://address:port/api.rsc/albums |
These OData endpoints are now ready to be directly consumed in Power Automate using the URL.
Since Power Automate supports OData, you can easily automate workflows, trigger actions, and integrate live
data from RabbitMQ into your automated processes.
The CData API Server supports full OData filtering capabilities. For custom queries and
filtered visualizations, you can append standard OData query parameters like
$select, $filter, $orderby, $top, and $skip to your requests.
Step 2: Automate an Email Triggers in Power Automate
You've got the CData API Server up and running now with consumable OData endpoints from your
RabbitMQ data. Now let's build a Power Automate flow to automate an email trigger based on a criteria.
In this example, we'll build a flow that reads lead and opportunity data from the Opportunity table in
RabbitMQ. The flow will identify the lead with the highest value in the ExpectedRevenue
column and automatically send an email containing the details of that lead.
We'll use Power Automate Desktop along with the Outlook app on Windows 11. If you don't have Outlook installed on
your Windows machine, you can download it from the
Microsoft 365 official site or install it via the Microsoft Store.
2.1 Filter the API OData Endpoint
With full support for OData URL filters (OData ABNF) in CData API Server, you can filter your
tables (resources) directly in the URL to limit and sort the results before they are even pulled
into your flow. This reduces load time and improves efficiency.
Check out the complete list of supported filter
options here.
For our example, the filtered URL looks like this:
http://localhost:8080/api.rsc/public_Opportunity?$top=1&$orderby=ExpectedRevenue desc
You can build your own endpoint URL like this. Here's what each part means:
| URL Part |
Description |
| http://localhost:8080 |
Base URL including hostname and port where your CData API Server is hosted |
| /api.rsc/ |
The default endpoint path prefix used by CData to expose API resources |
| public_Opportunity |
The table name (resource) you want to query—in this case, the public_Opportunity table |
| ? |
Marks the beginning of query string parameters used for filtering, sorting, etc. |
| $top=1 |
Returns only the first record from the filtered result set |
| $orderby=ExpectedRevenue desc |
Sorts the results by the ExpectedRevenue column in descending order |
2.2 Build the Flow in Power Automate Desktop
-
Launch Power Automate Desktop and click on New
on top-left to add a new flow.
-
Give your flow a name (e.g., Email-Trigger) and click Create.
👁 Creating New Flow in Power Automate Desktop
-
In the flow designer dashboard, search for Region under the Actions pane and double-click to add it.
Give it a descriptive name and click Save.
-
Search for Invoke Web Service, double-click to add it, and configure the following:
- URL: Enter the filtered OData URL created earlier.
- Method: GET
- Accept: application/json
- Content-Type: application/json
- Save response: Get text into variable (for web pages)
- Click Save.
👁 'Invoke web services' action in Power Automate Desktop
-
Search for Convert JSON to Custom Object and double-click to add it.
-
Click the blue {x} icon and select the variable %WebServiceResponse%.
- Click Save.
👁 'JSON to custom object' action in Power Automate Desktop
-
Search for Outlook and select Launch Outlook. Double-click to add it to the
flow, then click Save.
-
Search for Outlook and select Send email message through Outlook. Double-click to add it, then configure the following:
👁 'Sending Outlook Email' Action in Power Automate Desktop
-
Search for Outlook and select Close Outlook. Double-click to add it to the
flow, then click Save.
-
Search for End region and double-click to add it to the flow.
-
Your final flow should look like this:
👁 Final Flow in Power Automate Desktop
-
Click Run on top to start the flow.
The process will automatically open Outlook and send an email to the recipient as specified in the flow.
Your email should look like this:
👁 Executing Flow in Power Automate Desktop
2.3 Schedule and Refine the Flow
Your flow now sends an email when a new lead with the highest ExpectedRevenue is found. Since
Power Automate Desktop doesn't support built-in scheduling, you'll need to use Windows Task Scheduler
or Power Automate (cloud) to run it continuously at set intervals.
To avoid duplicate emails, use the Write text to file action in Power Automate to save the
Id field to a file (e.g., lastLead.txt). On each run, use the Read text
from file action to compare it with the current Id. If they match, skip the
email—ensuring alerts are only sent for new leads.
This flow is just the beginning. You can extend it to update CRM records, log high-value
leads to Excel, or send real-time Slack alerts—automating even more steps in your lead
management process.
Try CData API Server Free for 30 Days
Build OData REST APIs with low-code/no-code platform and unlock seamless integration with your live data.
Try CData API Server free for 30 days and experience how easily you can automate tasks using live data from
RabbitMQ (or any of the hundreds of available connectors)
in Power Automate.
Start your free trial here.