Hello,
I am experiencing an issue with the "Run script" action in Power Automate.
The problem started suddenly on 21 July 2026. The flow had been working correctly before, and no relevant changes were made.
Environment
Excel Online (Business)
OneDrive for Business
Excel workbook (.xlsx)
Office Scripts
Problem
Every "Run script" action fails with the following error:
502 BadGateway x-ms-datasourceerror: True logs: null
Request ID:
[Moderator note: Personally Identifiable Information removed] Date: 21 July 2026
However, the same Office Script runs successfully when executed directly in Excel Online.
What I have already tested
To rule out configuration issues, I performed the following tests:
Created a completely new Excel workbook.
Created a new Office Script containing only:
function main(workbook: ExcelScript.Workbook) { workbook.getActiveWorksheet().getRange("A1").setValue("Hello"); }
Created a brand-new Power Automate flow containing only:
Manual trigger
Run script
Result:
The new flow also fails with the same 502 BadGateway error.
Additional troubleshooting
I have also:
Created a new Excel Online (Business) connection.
Deleted the old connection.
Confirmed that the same Microsoft 365 account is used in both Excel Online and Power Automate.
Verified that the workbook is not open anywhere.
Tested with multiple different workbooks and Office Scripts.
Confirmed that every script works correctly when executed directly from Excel Online.
Why this is critical
My production flow generates PDF documents from an Excel template.
The Office Script is used to force Excel to recalculate formulas before the PDF conversion.
Without the script, the generated PDF sometimes contains outdated data or empty calculated fields, although the Excel workbook itself already contains the correct values.
Therefore, the flow cannot be used reliably without the "Run script" action.
Other users are currently reporting the same behavior.
The symptoms are identical:
Office Scripts work correctly in Excel Online.
The "Run script" action in Power Automate returns 502 BadGateway.
The issue affects newly created flows, newly created workbooks, and newly created Office Scripts.
This suggests that the issue may not be isolated to my tenant.
Question
Is there currently a known issue affecting the Excel Online (Business) "Run script" action in Power Automate?
Are there any tenant settings, service incidents, or additional diagnostics that should be checked?
Any help from Microsoft would be greatly appreciated.
Thank you.Hello,
I am experiencing an issue with the "Run script" action in Power Automate.
The problem started suddenly on 21 July 2026. The flow had been working correctly before, and no relevant changes were made.
Environment
Power Automate
Excel Online (Business)
OneDrive for Business
Excel workbook (.xlsx)
Office Scripts
Problem
Every "Run script" action fails with the following error:
502 BadGateway
x-ms-datasourceerror: True
logs: null
Request ID:
[Moderator note: Personally Identifiable Information removed]
Date: 21 July 2026
However, the same Office Script runs successfully when executed directly in Excel Online.
What I have already tested
To rule out configuration issues, I performed the following tests:
Created a completely new Excel workbook.
Created a new Office Script containing only:
function main(workbook: ExcelScript.Workbook) {
workbook.getActiveWorksheet().getRange("A1").setValue("Hello");
}
Created a brand-new Power Automate flow containing only:
Manual trigger
Run script
```Result:
The new flow also fails with the same 502 BadGateway error.
## Additional troubleshooting
I have also:
Created a new Excel Online (Business) connection.
Deleted the old connection.
Confirmed that the same Microsoft 365 account is used in both Excel Online and Power Automate.
Verified that the workbook is not open anywhere.
Tested with multiple different workbooks and Office Scripts.
Confirmed that every script works correctly when executed directly from Excel Online.
## Why this is critical
My production flow generates PDF documents from an Excel template.
The Office Script is used to force Excel to recalculate formulas before the PDF conversion.
Without the script, the generated PDF sometimes contains outdated data or empty calculated fields, although the Excel workbook itself already contains the correct values.
Therefore, the flow cannot be used reliably without the "Run script" action.
## Additional information
Other users are currently reporting the same behavior.
The symptoms are identical:
Office Scripts work correctly in Excel Online.
The "Run script" action in Power Automate returns 502 BadGateway.
The issue affects newly created flows, newly created workbooks, and newly created Office Scripts.
This suggests that the issue may not be isolated to my tenant.
## Question
Is there currently a known issue affecting the Excel Online (Business) "Run script" action in Power Automate?
Are there any tenant settings, service incidents, or additional diagnostics that should be checked?
Any help from Microsoft would be greatly appreciated.
Thank you.
**Additional information**
I have found another recent Microsoft Learn question describing the same `502 BadGateway` behavior when running Office Scripts from Power Automate. This suggests that the issue may not be isolated to my tenant.
Can anyone from Microsoft confirm whether there is an ongoing service issue or regression affecting the **Run Script** action?