https://discord.gg/botpress logo
How to extend action timeout? (Slow Tool Issue)
# 🤝help
p
I have an action that needs to wait server availability and sometimes the waiting time is bigger than 15 seconds. How to avoid to get slow tool issue? {"code":"SLOW_TOOL_ISSUE","data":{"message":{"raw":"A tool took too long to execute. Tools are meant to be fast and should not take more than a few seconds to execute.: Error: slow tool"},"type":{"raw":"tool_slow"},"tool_name":{"raw":"factaFgtsConsult"},"started_at":{"raw":"1755989787101"},"input":{"raw":"{\"cpf\":\"60972726934\"}"},"object":{"raw":"megatest1304Facta"},"duration":{"raw":"15000"}},"groupBy":[],"description":"A tool took too long to execute. Tools are meant to be fast and should not take more than a few seconds to execute.: Error: slow tool","title":"Slow Tool Issue","category":"other","traceId":"ef5d0079fa534a86be544356e2a44f4d"}
c
The "SLOW_TOOL_ISSUE" occurs because Botpress actions/tools are meant to return results quickly. Since your action waits for a slow server, it's flagged as too slow. To fix this: 1. Make the action asynchronous 2. Use a separate microservice 3. Optimize the external call
p
but the real problem is: how to return data to conversation after the external function work?
c
Don’t wait inside the Botpress action—return immediately to avoid the slow tool error. Then, when the external server responds, send the result to the user with`bp.events.replyToEvent()`. You can also show a “please wait” message first. For very long calls, use a separate service to handle it and push the result later.
p
so.. which data need I to send from action to my external server and what do I send back?
can you give me an example @colossal-scientist-24455 or maybe @User