# Power Automate in Python

Trigger Power Automate flows, read what they return, turn flows on and off, and read, cancel and resubmit their runs, all from Python services.

## Get started

Start here if this is your first Power Automate connection - create it and trigger a flow from a service, reading back the flow's response.

[Tutorial](https://zato.io/docs/dev/examples/cloud/power-automate/tutorial.html)

service.py

```
# Trigger a flow ..
conn = self.microsoft.power_platform['Zato Power Automate']
result = conn.trigger(flow_id, {
    'customer_id': 'CUST-001',
    'order_total': 1250.50})

# .. and read what it returned.
result['discount_percent']
10
```

[Tutorial Create the connection and trigger a flow from a Python service, reading back what the flow returns.](https://zato.io/docs/dev/examples/cloud/power-automate/tutorial.html) [Triggering flows Trigger a flow by its ID or by its callback URL and read what the flow returns.](https://zato.io/docs/dev/examples/cloud/power-automate/triggering-flows.html) [Managing flows List the flows of an environment, read one flow's details and turn flows on and off.](https://zato.io/docs/dev/examples/cloud/power-automate/managing-flows.html) [Monitoring runs Read a flow's run history, read one run, cancel a run that is still going and resubmit one that failed.](https://zato.io/docs/dev/examples/cloud/power-automate/monitoring-runs.html)

## API reference

[Flows list\_flows, get\_flow, enable\_flow, disable\_flow, get\_trigger\_url, trigger and trigger\_url, with every parameter.](https://zato.io/docs/dev/examples/cloud/power-automate/api/flows.html) [Runs list\_runs, get\_run, cancel\_run and resubmit\_run, with every parameter, and the run statuses.](https://zato.io/docs/dev/examples/cloud/power-automate/api/runs.html) [Connection The Dashboard fields, how tokens are obtained and refreshed, invoke for endpoints without a method of their own, and ping.](https://zato.io/docs/dev/examples/cloud/power-automate/api/connection.html)
