Power Automate allows users to automate workflows by integrating various services. However, sometimes actions within a flow may fail and return the following error:
“Action returned an error – The action executed, but returned an error from the service.”
This error means that Power Automate successfully sent the request to the external service (e.g., SharePoint, SQL Server, API), but the service returned an error instead of a successful response.
2. Causes of “Action Returned an Error”
Several reasons can lead to this issue:
- Invalid Request Data – The action sent incorrect or incomplete data to the service.
- Permission Issues – The service denied access due to insufficient permissions.
- Service Outage or API Unavailability – The target service is temporarily down.
- Rate Limits and Throttling – The service rejected the request due to too many API calls.
- Incorrect Authentication – The service rejected the request due to invalid authentication.
- Incorrect Endpoint or Configuration – The action is pointing to an incorrect API or data source.
- JSON Schema Mismatch – If working with APIs, the request structure might be incorrect.
- Timeout Issues – The service took too long to respond, leading to a timeout error.
- Data Format Mismatch – The action is expecting data in a certain format but received something else.
- Internal Server Error (500 Error) – The target service encountered an internal issue.
3. Step-by-Step Troubleshooting Guide
Step 1: Identify the Failing Action
- Open Power Automate (https://flow.microsoft.com).
- Navigate to My Flows and select the affected flow.
- Click Run History and locate the failed run.
- Expand the failed action and check the error message details.
Solution:
- Look for specific error messages returned by the service, such as 401 (Unauthorized), 403 (Forbidden), 404 (Not Found), 500 (Internal Server Error), or 429 (Too Many Requests).
Step 2: Verify Data and Parameters Sent to the Action
An action may fail if required fields are missing or contain incorrect data.
Solution:
- Open the failed action and check the Inputs section.
- Compare the input values with the expected values.
- Ensure that all required parameters are correctly provided.
Example:
- If calling a REST API, ensure the JSON request body is correctly formatted.
- If using a SharePoint action, verify that required fields (e.g., “Title” in “Create Item”) are included.
Step 3: Check User Permissions
Some services may return an error if the user does not have sufficient permissions.
Solution:
- Verify that the user or service account used in the connection has the required permissions.
- Check role assignments in the external service (e.g., SharePoint, SQL Server, Dataverse).
- If using an API key or OAuth token, ensure it has the correct scopes.
Example:
- If a SharePoint action fails, ensure the user has Contribute or Full Control access.
- If connecting to Dataverse, check the user’s security role in Power Platform Admin Center.
Step 4: Check for Service Availability and Outages
If the external service is down, it may return an error.
Solution:
- Check Microsoft Service Health: https://status.office365.com
- If connecting to a third-party API, check its status page.
- Try executing the same action outside Power Automate (e.g., manually calling an API in Postman).
Example:
- If SQL Server is unavailable, database-related actions will fail.
Step 5: Fix Authentication Issues (401 Unauthorized or 403 Forbidden)
Authentication failures cause services to reject requests.
Solution:
- Open Power Automate > Connections.
- Check if the connection shows an expired token warning.
- Re-authenticate the connection and test the flow again.
- Ensure the API key, OAuth token, or credentials are valid.
Example:
- If a SharePoint action returns a 403 error, the user’s permissions might be restricted.
Step 6: Handle API Rate Limits and Throttling (429 Too Many Requests)
If a service enforces rate limits, excessive requests may be blocked.
Solution:
- Add a “Delay” action between repeated requests.
- Implement Retry Policies in the action settings.
- Reduce the frequency of API calls.
Example:
- Microsoft Graph API has a 4,000 requests per hour limit per tenant.
Step 7: Fix Incorrect API Endpoints or Configurations (404 Not Found)
If calling an API, ensure the URL, headers, and parameters are correct.
Solution:
- Verify the API endpoint and correct it if necessary.
- Ensure that the required query parameters are included.
Example:
- If connecting to a REST API, ensure the endpoint matches the documentation.
Step 8: Ensure the Data Format Matches Expectations
If an action expects specific data (e.g., JSON, XML, or a number) but receives the wrong format, it may fail.
Solution:
- Check the expected data format in the action’s documentation.
- Use Power Automate expressions to convert data if necessary.
Example:
- If a flow expects a date field in ISO format (YYYY-MM-DD) but receives MM/DD/YYYY, it may fail.
Step 9: Handle Internal Server Errors (500 Error)
If the service returns a 500 error, the issue is with the external service.
Solution:
- Retry after a few minutes.
- Contact the service provider’s support team.
- If possible, test the request outside of Power Automate to confirm the issue.
Example:
- If a Dataverse API call fails with a 500 error, check the Microsoft Dataverse status page.
Step 10: Implement Retry Logic and Error Handling
To improve reliability, configure retry policies.
Solution:
- Open the failing action in Power Automate.
- Click Settings > Retry Policy.
- Select Exponential Interval for automatic retries.
- Use the “Configure Run After” option to handle failures gracefully.
Example:
- If an HTTP action occasionally fails, Power Automate can retry automatically.