# Connect Power Automate

> Start a Power Automate flow when a domain is expiring, a monitor goes down or a certificate is about to lapse — to open a ticket, add a row to a SharePoint…

Source: https://infranest.io/docs/connect-power-automate
Last updated: 2026-10-08

---

Connect Power Automate to start flows from InfraNest events, and let flows control InfraNest in return — for anyone who wants alerts to trigger tickets, SharePoint updates, runbooks or other automated work.

## Overview
- Start a Power Automate flow when a domain is expiring, a monitor goes down or a certificate is about to lapse.
- Let a flow act on InfraNest in return: open a maintenance window, pause a monitor or resolve an incident.
- Which trigger you use in Power Automate depends on your Microsoft licence.

## Before you start
Decide which trigger your flow starts with:

- **When a Teams webhook request is received** — included with Microsoft 365, but needs a **Parse JSON** step after it.
- **When an HTTP request is received** — needs Power Automate Premium, but needs nothing extra since the schema goes straight into the trigger.

> [!TIP]
> If you're not sure which licence you have, use the Teams trigger. Despite its name, it accepts any event we send, not only Teams messages.

## Send InfraNest events to a flow
1. In InfraNest, go to **Integrations → Power Automate** and select **Add endpoint**. Leave this page open — it lists these same steps beside the form, and you'll need its **Payload schema** in step 4.
2. In Power Automate, create an **Instant cloud flow** and choose your trigger.
3. In the trigger, set **Who can trigger the flow** to **Anyone**. We cannot sign in to your Microsoft tenant, so any other setting refuses our deliveries.
4. In InfraNest, select **Copy** on **Payload schema**, then:
   - **Teams trigger:** add a **Parse JSON** step. Click in its **Content** box, type `/`, choose **Insert dynamic content** and pick **Body** under **When a Teams webhook request is received**. If you prefer the mouse, select the lightning-bolt icon beside the box and pick **Body** there. You can also choose **Insert expression** and enter `triggerBody()` — it does the same. Don't type text straight into **Content**. Then paste the schema into **Schema**.
   - **HTTP trigger (Premium):** paste the schema into the trigger's **Request Body JSON Schema** box.

   If this flow only handles one kind of event, select **Show the schema** and pick that event under **Events this flow will receive** before you copy — the flow then only offers that event's fields.
5. If you used the Teams trigger from a template, delete the **Post card** step unless you also want a message in a channel.
6. Select **Save** on the flow. The trigger now shows its URL — copy it.
7. Back in InfraNest, paste the URL, leave **Send every event here** ticked so every event is sent from the start, and select **Create**.
8. Select **Send test event** and check the flow's run history.
9. Choose what gets sent: the endpoint page lists the **Send everything to …** automation it started. Open it to narrow it to the events you care about — or, if you unticked the box, pick a starting point under **Start an automation that posts to Power Automate** or build your own rule.

<!-- screenshot: connect-power-automate -->

<!-- docs-screenshots:start:connect-power-automate -->

![Connect Power Automate](/media/ad4b32e1-c5c1-464d-bb96-aeee9500f88e)

<!-- docs-screenshots:end:connect-power-automate -->

<!-- screenshot: power-automate-schema -->

<!-- docs-screenshots:start:power-automate-schema -->

![Connect Power Automate](/media/6df45f16-177c-4087-9b0c-e01a88251e2a)

<!-- docs-screenshots:end:power-automate-schema -->

## Let a flow trigger InfraNest
This direction needs the **HTTP** action, which is part of Power Automate Premium.

1. Go to **Integrations → Custom webhook → URLs we give you** and select **Add incoming URL**.
2. Give it a name you'll recognise later — you pick it by name when writing the rule.
3. Optionally set a shared secret, so a leaked URL on its own isn't enough to trigger anything.

<!-- screenshot: incoming-url-new -->

<!-- docs-screenshots:start:incoming-url-new -->

![Connect Power Automate](/media/74456a6e-6ea2-4cc3-a4fe-7f343327aad6)

<!-- docs-screenshots:end:incoming-url-new -->

4. In your flow, add an **HTTP** action with method **POST** and **Your URL** as the URI. If you set a secret, add a header `X-InfraNest-Secret` with it.
5. Back in InfraNest, use **Start an automation Power Automate can trigger** and add what should happen — open a maintenance window, pause a monitor, resolve an incident.

<!-- screenshot: incoming-urls -->

<!-- docs-screenshots:start:incoming-urls -->

![Connect Power Automate](/media/5bcf4305-0ba4-4987-b985-6e72b84510ae)

<!-- docs-screenshots:end:incoming-urls -->

## Good to know
- **The flow's URL is its key.** Anyone holding it can start your flow, so treat it like a password. If it leaks, delete the trigger in Power Automate to get a new URL and update the endpoint in InfraNest.
- Every event carries the same three parts: `event` (what happened, like `domain.expiring`), `created_at`, and `data` with that event's details.
- Every field in `data` can be empty, and each event only sends its own fields. In a flow that handles several events, check a field has a value before you use it.
- Each delivery is also signed with a secret we show once, but Power Automate cannot check that signature — the URL is what protects the flow.
- The delivery log on the endpoint's page shows every delivery and what Power Automate answered.

> [!WARNING]
> Treat the flow's trigger URL like a password. Anyone who has it can start your flow or send it fake events.

## Troubleshooting
**Deliveries fail with 401 or 403.** The flow is not letting us in, and the endpoint's page says so at the top and on the failed delivery. The trigger's **Who can trigger the flow** is not set to **Anyone** — change it and save the flow. If it already is, the URL in InfraNest no longer matches the one the trigger shows: copy it again and update the endpoint. Then select **Retry** on the failed delivery, or **Send test event**.

**Deliveries fail with 404.** Power Automate has no flow at that URL any more — it was deleted, or re-created with a new URL. Copy the URL from the flow's trigger and update the endpoint.

**The flow runs but shows no InfraNest fields.** The schema is missing. Paste the **Payload schema** into the Parse JSON step (or the HTTP trigger). In the Parse JSON **Content** box, pick the trigger's **Body**: type `/`, choose **Insert dynamic content** and select **Body**.

**Parse JSON fails with "Unexpected character encountered while parsing value".** The event reached your flow — the delivery log in InfraNest shows it as **Delivered** — but the Parse JSON **Content** box holds typed text instead of the trigger's **Body**. The character right after *parsing value:* in the error is the first letter of that text — a **P** is usually the word *Payload*, from the heading above the schema on the InfraNest page. Open the Parse JSON step, clear **Content**, type `/`, choose **Insert dynamic content** and pick **Body** under **When a Teams webhook request is received**. Save the flow, then select **Send test event** in InfraNest.

If the error says *Error parsing boolean value* instead, **Content** most likely holds `triggerBody()` typed in as words. An expression only works when you add it through **Insert expression**, so clear **Content** and fix it the same way.

**Parse JSON fails on a real event.** The schema was generated from a sample rather than copied from InfraNest. A generated schema marks every field as required, so the first event without one of them fails. Replace it with the schema from the endpoint's page.

**The HTTP trigger is greyed out or asks you to upgrade.** It needs Power Automate Premium. Use the Teams trigger with a Parse JSON step instead.
