#Do limits on a trigger payloads include other metadata besides the payload itself?

1 messages · Page 1 of 1 (latest)

tulip vine
#

Trying to get fancy with counting bytes here - I could be calculating incorrectly, but it seems like I need to add a safety buffer of quite a few KB to not get a "Request body too large" error

brisk lotusBOT
#

Hi @tulip vine. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

The limits on a trigger payload (such as the 3MB single trigger payload limit) apply specifically to the payload itself, not to additional metadata you might attach via the metadata option. However, metadata has its own separate size limit—by default, 256KB, which can be increased if you are self-hosting by setting the TASK_RUN_METADATA_MAXIMUM_SIZE environment variable Docs: Run metadata - Size limit.

That said, when sending a trigger request, the total HTTP request body will include both the payload and any metadata, so if you are very close to the payload limit, the combined size of everything in the request (including metadata and any other fields) could push you over the edge and result in a "Request body too large" error. This is especially relevant if you are self-hosting and have customized limits, or if you are using features that add extra data to the request.

To avoid hitting the limit, it is wise to leave a safety buffer below the documented payload limit, especially if you are including metadata or other options in the trigger call. The documentation does not specify the exact overhead, so your approach of adding a buffer is prudent Docs: Limits Docs: Run metadata.

In summary:

  • The payload and metadata have separate limits.
  • The HTTP request body includes both, so the real-world limit may be slightly less than the documented payload limit.
  • Adding a safety buffer is recommended to avoid "Request body too large" errors.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@tulip vine Kapa.ai is still learning and improving, please let me know how I did by reacting below.