Cannot write more bytes to the buffer than the configured maximum buffer size

July 15th 2021

Got the dreaded maximum buffer size exceeded error? Yep, it’s a pain that one.

We receive several support calls regarding the following error message that can occur when processing a large file or an extensive collection of files when working with Microsoft Power Automate:

Http request failed as there is an error: 'Cannot write more bytes to the buffer than the configured maximum buffer size: 104857600.'.

BadRequest. Http request failed as there is an error: ‘Cannot write more bytes to the buffer than the configured maximum buffer size: 104857600.’.

Given that the error message is generated on the Encodian Flowr action, it is typical to assume that it is the Encodian Flowr action that has failed, but it hasn’t (sort of)! So let’s explain what is happening.

As documented, the maximum message size (the data sent between actions) in Power Automate is 100MB. To compound this limit, files exchanged in Power Automate are Base64 encoded, adding a 20% to 30% overhead on the file size. Thus the actual maximum file size is around 70MB to 80MB.

To generate the error on the ‘OCR a PDF Document‘, I passed a 70MB PDF Document containing 200 pages and configured the action to perform image clean-up (300 DPI); this will generate a high-resolution PDF where 1 page is roughly 1MB, therefore generating a 200MB file. The Encodian Flowr action has been executed successfully; however, the data stream has been rejected by Power Automate as it exceeds the 100MB message limit.

You may also see similar issues in other actions, for example writing files into an array variable:

VariableSizeLimitExceeded. The variable 'Files' has size of more than '141655122' bytes. This exceeded the maximum size '104857600' allowed.

VariableSizeLimitExceeded. The variable ‘Files’ has size of more than ‘141655122’ bytes. This exceeded the maximum size ‘104857600’ allowed.

Currently, there is no resolution to this limitation… however you may have noticed there is another type of limit in the documentation:

This is a reasonably new capability in Power Automate, and our engineering team is working on adding ‘chunking’ support, therefor connectors/actions which support file chunking can be used with Encodian Flowr to process files up to 1GB (minus the Base 64 overhead).

If you are reading this post because the issue has occurred on a native Microsoft connector, ensure this setting is enabled:

Allow chunking

If you have any further queries, please reach out to our support team via our support portal

Author
Jay Goodison

Managing Director

You might also be interested in...