Skip to content
Tutorials Center
My learning

Topics

Lesson 10 of 38 ยท Flows and Triggers

HTTP Request Triggers, Webhooks and the Response Action

Turn a flow into an API with the When an HTTP request is received trigger: JSON schema, methods, the callback URL, Response action, security options and testing.

The When an HTTP request is received trigger gives your flow a web address. Any system that can send an HTTP request can start the flow and optionally read an answer. It is how you connect Power Automate to code you wrote yourself, to a form on a web page, or to another company's webhook.

This trigger is a premium feature (see Flow types and licensing).

Create the trigger

  1. Create an Instant cloud flow and choose When an HTTP request is received, or add it as the first step of a flow.
  2. In Request Body JSON Schema describe the JSON you expect. Select Use sample payload to generate schema, paste an example, and the designer writes the schema.
  3. Pick the allowed Method (GET, POST, PUT, PATCH, DELETE) or leave it for any.
  4. Save the flow. After saving, the trigger shows an HTTP POST URL, the endpoint address.

A sample payload:

JSON
{
  "orderId": 1042,
  "customer": "Ana",
  "items": [{"sku": "A-1", "qty": 2}]
}

The generated schema makes orderId, customer and items appear as dynamic content in later steps.

The callback URL is a secret

The URL contains a signature (a sig query value). Anyone who has it can start your flow. Treat it like a password: store it in a secret store, never in a public web page or repository, and regenerate it if it leaks (open the trigger menu and choose the option to regenerate the keys).

Security options in the trigger's Settings or the flow's Properties:

  • Who can trigger the flow: anyone, only users in the tenant, or specific IP ranges.
  • Azure AD / Entra ID OAuth: callers must send a bearer token. Better than a bare signed URL for internal systems.

Respond to the caller

By default the caller receives a 202 Accepted and the flow continues in the background. To return data, add the Response action: set a Status Code (200, 400...), Headers such as Content-Type: application/json, and a Body.

JSON
{
  "status": "ok",
  "orderId": @{triggerBody()?['orderId']}
}

The Response action ends the synchronous part of the call. The HTTP caller usually waits for it, and a flow that takes longer than the platform's limit (about two minutes for synchronous responses) times out for the caller even if the flow continues. For long jobs, answer at once with 202 and an id, and let the client ask again later.

Validating the payload

A bad payload should return a 400, not make the flow fail halfway. Add a Condition at the start:

  • empty(triggerBody()?['orderId']) true: Response 400 with a message.
  • Otherwise continue.

Also validate types and ranges: the JSON schema checks structure, not business rules.

A stand-in for the endpoint

This Python stand-in is a function with the same job: accept a payload, validate it and return a status code and body. It is not an HTTP server and does not use a real URL.

Python Stand-in: validate a request and respond

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Reading the trigger body

In expressions use triggerBody()?['orderId'] or triggerOutputs()?['body']. Query-string parameters sit in triggerOutputs()?['queries'], headers in triggerOutputs()?['headers'], and the path in triggerOutputs()?['relativePathParameters'] when you define a relative path such as /orders/{id}.

This stand-in extracts the same pieces from a pretend request object.

Python Stand-in: body, query and header of a request

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

safe plays the role of the ?[...] operator, which returns null instead of an error for a missing field.

Webhooks the other way round

Many services send a webhook to you; the HTTP trigger is a valid target. Some services require a validation handshake (they send a challenge that you must echo back). Use a Condition and the Response action for that, or prefer a built-in connector trigger, which handles registration for you.

Common mistakes

  • Pasting the callback URL into client-side JavaScript on a public site.
  • Forgetting the Content-Type: application/json header in the caller, so the body is not parsed.
  • A schema marked as required fields that callers do not always send. Make optional fields non-required in the schema.
  • Not returning a Response, then wondering why callers get no data.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which license class does the HTTP request trigger need?

    The HTTP trigger and HTTP action are premium features.
  2. 2. Why should the callback URL be kept secret?

    Anyone who has the signed URL can call the flow, so it should be protected or regenerated if leaked.
  3. 3. What does the Response action do?

    It answers the synchronous call so the client receives data instead of a plain 202.
  4. 4. How do you read the 'orderId' field of a JSON body?

    triggerBody() returns the parsed body and the index reads the property safely.

Summary

  • The HTTP request trigger turns a flow into an endpoint that other systems can call.
  • Describe the body with a JSON schema generated from a sample payload.
  • Protect the signed URL, or require Entra ID OAuth.
  • Validate the input and use the Response action to return a clear status and body.

Next: Actions and dynamic content