How is your experience with the OutSystems Community?
28
Views
5
Comments
Solved by AI
[AWSSimpleStorage] Payload size limit when exporting large datasets to Excel and uploading to S3
AWSSimpleStorage
Forge asset by Stefan Weber
Application Type
Traditional Web

Hi everyone,

I’m running into a payload size limitation in OutSystems and would like to get some advice or confirmation on the recommended approach.

Currently, I have a Timer that queries around 1,000,000 records, converts the result into an Excel file, and then uploads the file to Amazon S3. However, the process fails with an error indicating that the input payload exceeds the ~5.5MB limit.

From what I understand, this payload limit is enforced by the OutSystems platform and cannot be increased via configuration. Because of this, exporting such a large dataset into a single Excel file in one action does not seem feasible.

I also found this article relevant to the issue:https://without.systems/odc-with-aws-s3-backend-to-s3

The article explains that in OutSystems Developer Cloud, External Logic functions have a request/response payload limit of about 5.5MB. It suggests using pre-signed S3 URLs plus REST operations for larger files, instead of sending the full binary through the connector. However, I also noticed that the PutObject action available in the AWSSimpleStorage library does not expose the same parameters described in the article (such as Date, Algorithm, Credential, Signature, etc.), since those belong to a custom REST operation built on top of a pre-signed URL rather than the connector itself. 

I’d appreciate any best practices or patterns you’ve used successfully for large data exports in OutSystems, especially when uploading to external storage like S3.

Thanks in advance!

2021-10-09 07-57-44
Stefan Weber
 
MVP
Solution

Hi, as Saugat explained the process is differently. You can check the applied practices written in my tutorials in the demo application "ODC with AWS S3 Patterns" on Forge.

Stefan

2023-12-26 10-35-28
OutSystems Neo
Staff
AI Generated

It looks like you're encountering the payload size limitation in OutSystems Developer Cloud (ODC) when handling large file uploads to AWS S3. This is indeed a known limitation, as OutSystems enforces a payload size restriction of approximately 5.5MB for both request and response payloads. Here are some best practices and feasible patterns you can use to overcome this limitation:

1. Split Records into Batches

Instead of querying all 1,000,000 records at once, you can divide the dataset into smaller batches and create multiple Excel files. Each file will stay under the payload size limit and can be uploaded sequentially to S3.

  • Use the Timer to handle batches by adding pagination logic to your query.
  • After processing each batch into an Excel file, use AWS S3's PutObject or a similar action to upload it.

Benefits:

  • Prevents memory and payload bottlenecks.
  • Avoids potential timeouts for the Timer.

Challenges:

  • You will end up with multiple files instead of a single file. If a single file is mandatory, you would need to consolidate them post-upload (e.g., in S3 or during a later processing step).

2. Use Pre-Signed URLs for Direct S3 Uploads

Pre-signed URLs are a more efficient way to handle large file uploads to S3. In this approach:

  • Generate the pre-signed URL via an AWS service (e.g., using custom REST API logic or AWS SDK).
  • Use this URL to upload the Excel file directly to S3 from the client or server, instead of passing the binary through OutSystems payload limits.

Implementation Steps:

  • Create an external AWS API endpoint to provide pre-signed URLs or use a custom integration library in OutSystems.
  • Generate the Excel file within OutSystems but upload it directly to S3 using the pre-signed URL from the front-end or via server-side logic.

This method bypasses OutSystems' payload size limitations entirely and is highly efficient.


3. Stream Data to Create Excel Files

Instead of generating the entire Excel file in memory, explore libraries/services that allow streaming rows to an Excel file, writing data incrementally to the file system or directly to S3. Memory consumption stays low, and payload size issues can be avoided.

Example Workflow:

  • Use logic to stream large datasets into temporary files stored on a server or in temporary S3 storage.
  • Once the stream is complete, upload the file.

Note: This would require either a custom connection to AWS S3 or integration of third-party libraries that support streaming.


4. Leverage External Logic

For processes requiring high scalability, you may offload this operation to external logic hosted in AWS Lambda, a custom backend, or another service. Here’s how:

  • Use OutSystems to trigger the batch export process and send operational parameters, such as filter criteria or query definitions, to the external system.
  • The external service handles querying the database, generating the file, and uploading to S3.

This keeps the OutSystems application lightweight and avoids sizing bottlenecks.


Suggested Approach

For your specific case, combining batch processing with pre-signed URLs is likely the best solution. Here's a step-by-step outline:

  1. Batch the Query Results: Divide the dataset of 1,000,000 records into smaller, manageable chunks (e.g., 10,000 records per batch).
  2. Pre-Signed URL Workflow:
    • Generate a pre-signed URL for each batch using AWS tools or a custom REST API.
    • Convert each batch result into an Excel file.
    • Use the pre-signed URL to upload directly to S3.
  3. Post-Processing: If required, merge the files into a single Excel file after upload using an S3 Lambda function or other AWS services.

This approach avoids memory overloading, adheres to the platform's payload limits, and provides better scalability.

You may also refer to this useful community post on addressing payload limits and large file exports in ODC Large Files in ODC.

Let me know if you need further guidance!

This answer was AI-generated. Please read it carefully and use the forums for clarifications
2026-03-20 01-28-51
Saugat Biswas

Hi @Tuan Duong,

The officially recommended approach for large files in ODC and is exactly what the article you referenced describes here.

How it works conceptually 

  • OutSystems backend 
    • Generates a pre‑signed S3 PUT URL 
    • This step is lightweight and under the payload limit 
  • Upload happens OUTSIDE External Logic Via 
    • REST Consume Or 
    • client‑side fetch 
  • Binary never crosses the External Logic boundary

Hope this helps,

Cheers.

Saugat

2021-10-09 07-57-44
Stefan Weber
 
MVP
Solution

Hi, as Saugat explained the process is differently. You can check the applied practices written in my tutorials in the demo application "ODC with AWS S3 Patterns" on Forge.

Stefan

UserImage.jpg
Anh Tuan Duong

Thank @Stefan Weber , I looked your demo project and apply it into my personal application and can upload file to S3 success using Rest APIs.

2021-10-09 07-57-44
Stefan Weber
 
MVP

Great to read. Well done @Tuan Duong !

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.