for Microsoft Power Automate and Azure logic apps

By Jay Goodison

15th July 2021

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

We receive a number of support calls regarding the following error message that can occur when processing a large file or a large 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.’.

Now, given the error message is generated on the Encodian Flowr action it would 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 here, the maximum message size (which is the data sent between actions) in Power Automate is 100MB. To compound this limit, files exchanged in Power Automate are Base64 encoded, and this adds 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 stream of data 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 fairly 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