(or read directly on - https://blogs.perficient.com/2025/07/16/python-meets-power-automate-trigger-via-url/ ) A compact, developer-friendly reference and working Python client for triggering Microsoft Power Automate flows via HTTP. It includes:
- Step-by-step setup for an HTTP-triggered flow
- A reusable Python script to POST/GET to your flow
- Sample payloads, environment config, and quick usage
- Security tips and common use cases
- A Power Automate environment and access to create flows
- A generated HTTP trigger URL (POST is typical)
- Python 3.9+ on your machine This is what your flow would look like
- Open Power Automate (https://make.powerautomate.com).
- Create an Instant cloud flow and choose "When an HTTP request is received".
- Define the JSON schema for the request body if you plan to pass data (example in
examples/payload.json). - Add one or more actions (e.g., send an email, update a SharePoint list).
- Save the flow and copy the generated HTTP URL from the trigger card.
This repo provides src/trigger_flow.py to send HTTP requests to your flow with:
- JSON payload from file or inline
- Optional headers (Authorization Bearer, shared secret)
--dry-runmode to preview without sending
Important: Replace placeholder URLs with your own flow URL. The examples use <your-flow-url> or demo endpoints; you must paste the actual HTTP trigger URL from your Power Automate flow.
python -m pip install -r requirements.txt
python src/trigger_flow.py --url "<your-flow-url>" --payload examples/payload.json
Or use the simple example script in examples/trigger_simple.py. Make sure to replace the url value in that file with your actual flow URL before running:
python examples/trigger_simple.py
python src/trigger_flow.py --url "<your-flow-url>" --data '{"username":"Mark.Holland","action":"start"}'
python src/trigger_flow.py --url "<your-flow-url>" --payload examples/payload.json --secret "my-shared-secret"
python src/trigger_flow.py --url "<your-flow-url>" --payload examples/payload.json --bearer "<token>"
python src/trigger_flow.py --url "<your-flow-url>" --payload examples/payload.json --header "X-Custom:Value" --header "Another:123"
- Triggering workflows from external apps or scripts
- Webhooks and third-party integrations
- IoT devices sending events to Power Platform
- Custom buttons on internal web pages
- Treat the flow URL as a secret; avoid public exposure.
- Use Azure API Management or Custom Connectors for governance.
- Validate a shared secret or token in your flow logic.
- Log and monitor flow invocations and failures.
