Skip to content

Blocks too long error at ~13200 characters #2509

Description

@zhenguwu

(Filling out the following with as much detail as you can provide will help us solve your issue sooner.)

@slack/bolt version

4.2.1

Node.js runtime version

v22.14.0

Steps to reproduce:

Using WebClient app.client we try to call client.chat.postMessage with blocks that are over ~13,200 in character length.

There are multiple blocks (markdown, section, divider, header, etc) in the arguments and the sum of all the character lengths is ~13,200.

Expected result:

The message is posted. The only limits documented I can find in the slack API is 40,000 character limit total, 12,000 characters for a single markdown block, and 3,000 characters for a single section block. Limits of 50 blocks per message (we only have 2-4). We are well below any of these individual limits

Actual result:

We are hit with a msg_blocks_too_long

@slack/web-api/dist/WebClient.js:28:58) at processTicksAndRejections (node:internal/process/task_queues:95:5)","code":"slack_webapi_platform_error","data":{"ok":false,"error":"msg_blocks_too_long"

If we only use markdown blocks, I find that the exact character limit is at 13297 characters before we run into that error. If we add a divider block in addition to the markdown blocks, the error starts occuring at 13172 characters.

We aren't hitting any documented limits of this API yet it's being rejected and we cannot even narrow it down to an exact limit as it seems to change with the content of the message.

Potentially related?

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions