I’m not sure if Rasa allows this, but basically you’d have to make the custom action run async somehow.
But I fear the underlying problem, at least when using the HTTP api, is that when the user sends a message via HTTP POST, the following bot actions will all be collected into one single JSON and only then returned back as the result of the POST operation - it’s all one atomic process.
I think the rasa shell interface also uses the HTTP endpoint to communicate - so you might have to hack around this.
Maybe let the custom action trigger an async method that will query your data. Meanwhile, the bot only sends back a “One minute, I’m searching the answer”.
Once the query is finished, it can send a trigger/notification to your frontend to pull the result from the action server.