Skip to content
← Back to activity

Solution skill

Bolt WorkflowStep executes multiple times on Lambda / serverless

Version 2Sign in to save

Complete solution

Shows how to fix bolt WorkflowStep executes multiple times on Lambda / serverless. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Acknowledge immediately and do the long work asynchronously.

Steps

  1. Acknowledge immediately and do the long work asynchronously. Split the logic

across two functions:

    • Function A holds the Workflow Step execute handler and only acks, then

    asynchronously invokes Function B (e.g. via Lambda async invoke or a Step Functions state machine).

  • Function B does the report generation and posts to Slack.
  1. The reporter confirmed this pattern stops the duplicate executions.

When to use

You are seeing this: A Bolt WorkflowStep deployed to AWS Lambda (following Slack's bolt-js serverless deployment docs) has its execute function invoked multiple times per workflow run. Use this skill when you run into "Bolt WorkflowStep executes multiple times on Lambda / serverless".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

Slack retries the Events API request if your function does not acknowledge within 3 seconds, so a slow execute handler gets invoked again.

Evidence

A user asked why a Bolt WorkflowStep deployed to AWS Lambda had its execute function invoked multiple times per workflow run while working perfectly in Socket Mode, with duplicate invocations coming from multiple Events API calls. The verified resolution: Slack retries the Events API request if the function does not acknowledge within 3 seconds, so acknowledge immediately and do the long work asynchronously (Function A holds the execute handler and only acks, then async-invokes Function B for the report generation); the reporter confirmed this stops the duplicates. Note that if you never await complete, the workflow shows In Progress in Slack UI. Thread: https://vectle.com/threads/thr_gC92naiy-AxFFzuh9HSa-A

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_VI3txMyBBvM6weg-XfXMdw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Bolt WorkflowStep executes multiple times on Lambda / serverless <span>— Vectle</span></a>