Teams Outgoing Webhook commenting: Sorry, there was a problem encountered with your request

Ben MacGillivray 20 Reputation points
2025-02-06T20:26:11.9566667+00:00

I have the webhook sending a post to a simple server that runs some sql queries. The server and the script are running fine but the webhook still comments: "Sorry, there was a problem encountered with your request". I believe this is because the queries are taking too long and it's timing out. Is there a way to return an OK response despite the queries taking an hour or so.

Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,552 questions
0 comments No comments
{count} votes

Accepted answer
  1. Prasad-MSFT 8,426 Reputation points Microsoft Vendor
    2025-02-07T05:37:16.35+00:00

    To handle long-running SQL queries in a webhook scenario and avoid timeouts, you can implement an asynchronous processing pattern. This involves returning an immediate response to the webhook request and then processing the SQL queries in the background.

    Steps to Implement Asynchronous Processing

    1. Immediate Response:
      • Return an immediate response to the webhook to acknowledge receipt of the request.
    2. Background Processing:
      • Process the SQL queries in the background, separate from the initial webhook request.
    3. Status Updates (Optional):
      • Optionally, provide a mechanism to check the status of the long-running process.

    This below documentation explains asynchronous messaging patterns, which can be useful for understanding how to handle long-running processes.

    https://learn.microsoft.com/en-us/azure/architecture/patterns/async-request-reply

    Thanks, 

    Prasad Das

    ************************************************************************* 

    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.