Hi everyone,
I've found what appears to be a bug in AI Builder Prompt Builder and wanted to share in case others are hitting the same issue.
Summary
When a custom AI Builder prompt contains both a Power Fx input and an Image/Document input, it fails with an Internal Server Error. Each input type works perfectly on its own. This is 100% reproducible - I tried in different envs and browsers.
How to reproduce
- Create a custom prompt with two inputs: a Power Fx input (e.g.
Len("hello")) and an Image or document input
- Upload any small image and click Test
- → Internal Server Error
Error from browser console
{
"error": {
"code": "0x80048d0a",
"message": "{\"operationStatus\":\"Error\",\"error\":{\"type\":\"Error\",\"code\":\"Unknown\",\"message\":\"Unhandled exception: System.ArgumentException\"},\"predictionId\":null}"
}
}
Key finding
- Power Fx input alone → ✅ works (see Screenshot 3)
- File input alone → ✅ works (see Screenshot 2)
- Text input + File input → ✅ works
- Power Fx input + File input → ❌ fails, any formula, any file (see Screenshot 1)
This is not limited to the Prompt Builder Test button — I originally hit this in a production Power Automate flow using "AI Builder - Run a prompt'. The generic "Internal server error" message is very misleading and was initially mistaken for credit exhaustion.
Workaround
Replace the Power Fx input with a Text input and pass dynamic values from the flow instead (e.g. utcNow() for dates).
Screenshots attached
- Power Fx + File → Error
- File only → Works
- Power Fx only → Works