Slack Bolt Python Async: AsyncApp Tested With 20 Commands
We fired 20 slash commands at once at the same Bolt for Python handler written three ways: AsyncApp, the sync App, and AsyncApp with one blocking call. Only the first answered all 20.
On this page
To write an async Slack app in Python, import AsyncApp from slack_bolt.async_app, make every listener an async def, and await every call: await ack(), await respond(), await client.chat_postMessage(). AsyncApp runs on asyncio and serves HTTP with aiohttp, so one process can answer many requests at once, as long as nothing in a listener blocks the event loop.
We timed it on 28 November 2026 with slack_bolt 1.30.0, slack_sdk 3.48.0 and aiohttp 3.14.5. One throwaway app in a Free test workspace ran in HTTP mode behind a Cloudflare quick tunnel. A second member of the workspace fired the slash command /sg-async 20 times in parallel through the chat.command API, and we recorded how long Slack took to get each acknowledgement. Each handler acked, then waited 2 seconds to stand in for a slow API call, then posted a result with respond().
The results: 20 commands at once, three ways
| Version | Answered | operation_timeout | dispatch_failed | Median time to ack |
|---|---|---|---|---|
AsyncApp with await asyncio.sleep(2) | 20 of 20 | 0 | 0 | 0.77 s |
Sync App, built-in app.start() server | 6 of 20 | 5 | 9 | 0.62 s |
AsyncApp with a blocking time.sleep(2) | 1 of 20 | 19 | 0 | 3.40 s |
AsyncApp acked all 20 within 0.64 to 1.43 seconds, and all 20 results came back 2 seconds later. The blocking version is the one to look at. Its log shows the event loop handling one request at a time, exactly 2 seconds apart, because each time.sleep(2) froze everything:
12.504s ack job-02
14.524s ack job-04
16.526s ack job-10
18.534s ack job-05
20.538s ack job-03
Slack gives a slash command 3 seconds. Every command after the first missed it, so chat.command returned operation_timeout 19 times. In the client the member saw no "Working on" reply for those commands at all, only the late respond() results that arrived much later:
The sync row needs a caveat. App.start() runs Bolt's built-in development server, a single-threaded http.server. It handled requests one by one, so 9 of the 20 never got through (dispatch_failed) and 5 arrived too late. Behind a real WSGI server such as gunicorn with several workers, the sync App is fine. The point is that AsyncApp gets the same concurrency from one process without any of that.
The code we ran
One file, three modes. The async and sync listeners are the same apart from async, await and the sleep:
import os, time, asyncio, logging
MODE = os.environ["MODE"] # async | async_blocking | sync
logging.basicConfig(level=logging.WARNING)
T0 = time.monotonic()
def stamp(msg):
print(f"{time.monotonic() - T0:7.3f}s {msg}", flush=True)
if MODE.startswith("async"):
from slack_bolt.async_app import AsyncApp
app = AsyncApp(token=os.environ["SLACK_BOT_TOKEN"],
signing_secret=os.environ["SLACK_SIGNING_SECRET"])
@app.command("/sg-async")
async def report(ack, respond, command):
await ack(f"Working on {command['text']}")
stamp(f"ack {command['text']}")
if MODE == "async_blocking":
time.sleep(2) # blocking call: freezes the event loop
else:
await asyncio.sleep(2) # stands in for an awaited API call
await respond(f"Done: {command['text']}")
stamp(f"done {command['text']}")
if __name__ == "__main__":
stamp(f"mode={MODE} on :3031")
app.start(port=3031) # aiohttp web server
else:
from slack_bolt import App
app = App(token=os.environ["SLACK_BOT_TOKEN"],
signing_secret=os.environ["SLACK_SIGNING_SECRET"])
@app.command("/sg-async")
def report(ack, respond, command):
ack(f"Working on {command['text']}")
stamp(f"ack {command['text']}")
time.sleep(2)
respond(f"Done: {command['text']}")
stamp(f"done {command['text']}")
if __name__ == "__main__":
stamp(f"mode={MODE} on :3031")
app.start(port=3031) # built-in dev server
Run it with MODE=async python app.py. AsyncApp.start() prints Running on http://0.0.0.0:3031, which is aiohttp's own server; you do not need to install anything beyond pip install slack_bolt aiohttp. If you already run FastAPI, use Bolt's AsyncSlackRequestHandler adapter instead, as in our Bolt with FastAPI guide.
Never appear "away" on Slack again
Cloud-based. No downloads. Works 24/7 even when your laptop is off.
Two mistakes AsyncApp catches, and one it does not
A plain def listener. Copying a listener from a sync app into AsyncApp fails at import time, which is good:
BoltError: The listener function (report) is not a coroutine function.
A missing await on the client. In an async listener, client is an AsyncWebClient. Call a method without await and nothing is sent. Python prints only a warning, and only if warnings are on:
RuntimeWarning: coroutine 'AsyncWebClient.auth_test' was never awaited
A blocking call. Nothing warns you about time.sleep(), requests.get(), a sync database driver, or the sync slack_sdk.WebClient inside an async listener. They work in testing with one user and then fail with operation_timeout under load, as the third row of the table shows. Use the async version of each library (aiohttp or httpx.AsyncClient, asyncpg, AsyncWebClient), or push the blocking call to a thread with await asyncio.to_thread(fn).
Socket Mode with AsyncApp
For Socket Mode, swap the server for AsyncSocketModeHandler, which needs an app-level token (xapp-) with connections:write:
from slack_bolt.adapter.socket_mode.async_handler import AsyncSocketModeHandler
async def main():
await AsyncSocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start_async()
asyncio.run(main())
The listeners stay the same. We ran our timing test over HTTP, so the numbers above are for HTTP mode. If your slow work takes longer than 3 seconds even when it is async, ack first and let the work continue after, or use a lazy listener on a function host.
FAQ
Is AsyncApp faster than App?
Not per request: one command took about the same time either way. It handles more requests at once in one process, as long as the listeners never block. In our test that was 20 of 20 answered against 6 of 20 for the sync dev server.
Can I mix sync and async listeners?
No. AsyncApp refuses a plain def listener with a BoltError, and the sync App cannot run async def listeners. Pick one per app. Our Bolt for Python example is the sync version of the same kind of app.
Stop Jiggling Your Mouse.
Join hundreds of remote workers who never worry about their Slack status. Set it up once, stay green forever.
Related Articles
Slack MSI Installer: Gone After 4.48.102, Use MSIX
Slack's last MSI is 4.48.102 from March 2026; every later version 404s. We read both old MSIs and the current MSIX package to show what each installs and how to move a deployment to MSIX.
Slack LaTeX and Math: What Renders, What Doesn't, What Works
Slack shows LaTeX as raw text in messages and canvases, even though its web client ships KaTeX. We tested every route and give the two that work: Unicode math and a formula rendered to an image with 15 lines of Python.
Slack Canvas Images: Add, Size and Insert Them by API
We inserted a PNG, an animated GIF and a 6000 px image into a Slack canvas with canvases.edit. Slack files rendered; an outside image URL became a link card even though the API said ok.