Hello, I have been trying to use a power automate flow with an open ai API key to scan invoices. However, I have come across a problem where sometimes the file is too large, and it will fail with a "BadRequest" after 2 minutes, even though I have set the timeout limit to 10 minutes. I assume this is due to the time taken for the open ai to respond to a large file, so is there any way I can increase this time without going into the settings (I have already done this)
The HTTP Request action in power automate has a limit of 120seconds (2 mins) for outbound synchronous requests. Changing the value in the "Duration" field will only work with outbound asynchronous requests.
I recommend looking at creating async requests using a polling pattern within power automate. If for example the API endpoint sends a 202 response when you first initiate the request you can poll the endpoint until the final response is received. I have included a link below that may help.
If that doesn't work other options would be to split the file into smaller chunks or maybe look at offboarding this to an azure function or something similar.
Thank you,
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.