{"slug": "slack-bolt-without-aws-lambda-http-mode-on-a-host-that-scales-to-zero-inside-s-3", "title": "Slack Bolt without AWS Lambda: HTTP mode on a host that scales to zero, inside Slack's 3 seconds", "summary": "A developer built a Slack Bolt app in HTTP mode on Gregale, a hosting platform that scales to zero, and showed it can meet Slack's three-second Events API and slash-command deadlines by acknowledging first and doing slow work afterward. In the vendor's test, the app woke from a parked snapshot in under 300 ms and a 4-second outbound call started after the acknowledgement completed in 4.3 seconds, unlike AWS Lambda where a handler can be stopped once it responds.", "body_md": "*Originally published on [gregale.dev](https://gregale.dev/articles/slack-bolt-http-mode-scale-to-zero). I build Gregale, so read this as a vendor's page. Competitor details come from each vendor's own docs, linked in the post. This post was written with AI assistance.*\n\n**A Slack app built with Bolt can run in HTTP mode on a host that scales to zero, as long as the first request after an idle period is answered within Slack's 3 seconds.** Slack expects a `2xx` for an Events API request within three seconds and an acknowledgement of a slash command within 3,000 milliseconds. On Gregale, the Bolt app on this page wakes from a parked snapshot in under 300 ms, acknowledges first, and keeps running whatever work comes after the acknowledgement.\n\nBolt receives requests from Slack one of two ways:\n\n`/slack/events`.\nHTTP mode is what lets the app scale to zero, and the deadlines are what to plan around:\n\n| Request from Slack | Deadline | If you miss it | \n|---|---|---|\n| Events API event | `2xx` within three seconds | Retried three times: nearly immediately, after 1 minute and after 5 minutes | \n| Slash command | Acknowledged within 3,000 milliseconds | The user sees an `operation_timeout` error | \n\nA retried event carries `x-slack-retry-num` (1, 2 or 3) and `x-slack-retry-reason`, which is `http_timeout` when your app was too slow.\n\n`package.json`:\n\n```\n{\n  \"name\": \"slack-bolt-http\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"scripts\": { \"start\": \"node app.js\" },\n  \"dependencies\": { \"@slack/bolt\": \"^5.1.0\" },\n  \"engines\": { \"node\": \">=22\" }\n}\n```\n\n`app.js`:\n\n``` js\nimport { App } from '@slack/bolt';\n\nconst app = new App({\n  token: process.env.SLACK_BOT_TOKEN,\n  signingSecret: process.env.SLACK_SIGNING_SECRET,\n  customRoutes: [\n    {\n      path: '/healthz',\n      method: ['GET'],\n      handler: (req, res) => {\n        res.writeHead(200);\n        res.end('ok');\n      },\n    },\n  ],\n});\n\napp.command('/ping', async ({ ack }) => {\n  await ack('pong');\n});\n\napp.event('app_mention', async ({ event, say }) => {\n  await say(`Hi <@${event.user}>`);\n});\n\nawait app.start(Number(process.env.PORT ?? 3000));\napp.logger.info('Bolt app is running');\n```\n\nBolt checks Slack's request signature with the signing secret before any listener runs, and answers Slack's URL verification for you. The `customRoutes` entry adds a cheap `/healthz` path for Gregale's health check. Without it, Bolt logs every health and warm-up request as unhandled.\n\nMake the app public in `gregale.yaml`, because Slack cannot send a Gregale API key, and name the health path:\n\n```\naccess: public\nhosting:\n  health: /healthz\n```\n\nPut the bot token and signing secret from your Slack app's settings in a secrets file, and deploy:\n\n```\nprintf 'SLACK_BOT_TOKEN=xoxb-…\\nSLACK_SIGNING_SECRET=…\\n' > ../slack.secrets\ngregale deploy --name my-slack-app --secrets-file ../slack.secrets\n```\n\nIn the Slack app settings, set the Request URL for events, slash commands and interactivity to `https://my-slack-app.gregale.app/slack/events`.\n\nBolt checks the bot token with Slack when it starts. With a wrong or revoked `SLACK_BOT_TOKEN`, the process exits with `invalid_auth`, and `gregale logs my-slack-app` shows it.\n\nCall `ack()` before anything slow, such as a database query or an LLM call, and send the result afterwards with `say()` or the command's `respond()`. That is Bolt's default in HTTP mode, and on Gregale it works as written: the instance keeps running while the listener works after the acknowledgement, and the reply to a call your app made resumes a paused instance. In our test, a 4-second outbound call started after the response finished in 4.3 seconds, without waiting for another request.\n\nThat differs from AWS Lambda, where a handler can be stopped once it has responded. Bolt's Lambda guide uses `AwsLambdaReceiver`, and with other receivers it requires `processBeforeResponse: true`, which defers the acknowledgement until after your handler has run. The handler's work then counts against Slack's 3 seconds.\n\nWhatever the host, make event listeners safe to run twice. A retry can deliver an event your app already handled, if the first attempt was slow rather than lost.\n\nWe deployed this app on Gregale on 2026-11-27 and sent it requests signed with a test signing secret, after letting it park. For the test only, Bolt's token check was turned off, because the token was not a real one.\n\n`/ping` was acknowledged with `pong`.` 401`.\nAbout a second after each request, with nothing in flight, Gregale pauses the instance, and paused seconds are not billed.\n\n| Platform | Idle app | First request after idle | \n|---|---|---|\n| **Gregale** | Paused, then parked to a snapshot; neither billed | 270 ms to first byte in our test; work after `ack()` keeps running | \n| AWS Lambda | Bolt uses `AwsLambdaReceiver` | With `processBeforeResponse: true` , acknowledged after the handler runs | \n| Render (Free web service) | Spins down after 15 minutes without inbound traffic | About one minute to spin up, past Slack's 3 seconds | \n| Heroku (Eco dyno) | Sleeps after 30 minutes without web traffic | Wakes \"after a short delay\" | \n\nSources, checked 2026-11-27: [Slack: Events API](https://docs.slack.dev/apis/events-api/), [Slack: slash commands](https://docs.slack.dev/interactivity/implementing-slash-commands/), [Slack: verifying requests](https://docs.slack.dev/authentication/verifying-requests-from-slack/), [Bolt: custom routes](https://docs.slack.dev/tools/bolt-js/concepts/custom-routes/), [Bolt: deploying to AWS Lambda](https://docs.slack.dev/tools/bolt-js/deployments/aws-lambda/), [Render free instances](https://render.com/docs/free), [Heroku Eco dyno hours](https://devcenter.heroku.com/articles/eco-dyno-hours).\n\nA Bolt app in HTTP mode fits the Free plan: one app, 256 MB, and 20 included GB-RAM-hours a month, billed only while it handles requests. See [Gregale pricing](https://gregale.dev/pricing) and [How scaling to zero works](https://gregale.dev/docs/scale-to-zero).\n\n**Should my Slack app use Socket Mode or HTTP mode?**\n\nSocket Mode keeps a WebSocket open, so the app has to run all the time. HTTP mode gives Slack a Request URL, Bolt’s /slack/events, and nothing has to run between requests, which lets the app scale to zero.\n\n**What happens if my Slack app answers too slowly?**\n\nSlack retries an Events API request three times: nearly immediately, after 1 minute and after 5 minutes, with x-slack-retry-reason set to http_timeout. A slash command not acknowledged within 3,000 milliseconds shows the user an operation_timeout error.\n\n**Does work after ack() keep running on Gregale?**\n\nYes. The instance keeps running while the listener works after the acknowledgement, and the reply to a call your app made resumes a paused instance. On AWS Lambda, Bolt needs processBeforeResponse: true instead, which defers the acknowledgement.\n\n**Does a Bolt app fit the Free plan?**\n\nIn our test it used 89 MB, inside the Free plan’s 256 MB, and it is billed only while it handles requests: about a second after each one, with nothing in flight, Gregale pauses it.", "url": "https://wpnews.pro/news/slack-bolt-without-aws-lambda-http-mode-on-a-host-that-scales-to-zero-inside-s-3", "canonical_source": "https://dev.to/hpoyrazk/slack-bolt-without-aws-lambda-http-mode-on-a-host-that-scales-to-zero-inside-slacks-3-seconds-1ggb", "published_at": "2026-11-28 21:00:00+00:00", "updated_at": "2026-11-28 21:15:19.552627+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents"], "entities": ["Slack", "Bolt", "Gregale", "AWS Lambda", "Node.js"], "also_reported_by": [], "takeaway": "In Bolt HTTP mode, call ack() before slow work like database queries or LLM calls; on Gregale the instance keeps running after the acknowledgement, and a 4-second outbound call started post-response finished in 4.3 seconds.", "recommendation": {"advice": "Acknowledge Slack events and slash commands before any slow work, then send results with say() or respond(), since the instance keeps running after the response.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/slack-bolt-without-aws-lambda-http-mode-on-a-host-that-scales-to-zero-inside-s-3", "markdown": "https://wpnews.pro/news/slack-bolt-without-aws-lambda-http-mode-on-a-host-that-scales-to-zero-inside-s-3.md", "text": "https://wpnews.pro/news/slack-bolt-without-aws-lambda-http-mode-on-a-host-that-scales-to-zero-inside-s-3.txt", "jsonld": "https://wpnews.pro/news/slack-bolt-without-aws-lambda-http-mode-on-a-host-that-scales-to-zero-inside-s-3.jsonld"}}