Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Workflow suspended temporarily due to error: Unhandled Exception: System.Net.WebException: The operation has timed out

Posted on by 25

Hello,

We have a workflow which checks a few conditions and then executes a custom workflow activity plugin. That plugin calls an external API to send out emails. The worklfow is failing with a timeout error. After further research we found out that it is timing out in our end . We added a timeout setting in our code and that did not help. How can we increase the timeout in the CRM server itself? Our organization is On-Prem, 8.2. The error log is the following:

Workflow suspended temporarily due to error: Unhandled Exception: System.Net.WebException: The operation has timed out
  at System.Net.HttpWebRequest.GetResponse()
  at CustomWorkflowActivities.Common.GetEmailAddressID(String key, String secret, String email, IOrganizationService _service, EntityReference contactGuid)
  at CustomWorkflowActivities.Campaign.Execute(CodeActivityContext executionContext)
  at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
  at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

*This post is locked for comments

  • shabrany Profile Picture
    shabrany 5 on at
    RE: Workflow suspended temporarily due to error: Unhandled Exception: System.Net.WebException: The operation has timed out

    @ram_1222

    Hello Guys,

    Thanks for sharing possible solutions. The root cause for my error is that server is blocking the outgoing calls because there were more number of API calls happening at a particular time which excludes the number of api calls limit. We changed server configuration file to increase the limit. Initially it was 2, we changed it 100 and the issue was resolved.

    Thanks

    Ram

    Where did you change the limit for the outgoing calls?

  • Verified answer
    Ram 1222 Profile Picture
    Ram 1222 25 on at
    RE: Workflow suspended temporarily due to error: Unhandled Exception: System.Net.WebException: The operation has timed out

    Hello Guys,

    Thanks for sharing possible solutions. The root cause for my error is that server is blocking the outgoing calls because there were more number of API calls happening at a particular time which excludes the number of api calls limit. We changed server configuration file to increase the limit. Initially it was 2, we changed it 100 and the issue was resolved.

    Thanks

    Ram

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Workflow suspended temporarily due to error: Unhandled Exception: System.Net.WebException: The operation has timed out

    Hi,

    Is there any attachments with email. Once we have faced this error : The operation has timed out. For that we have added api method first in plugin then method that created email.

    Thanks,

    Ridhima

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Workflow suspended temporarily due to error: Unhandled Exception: System.Net.WebException: The operation has timed out

    Can you please share the code how you are calling with external API . Increase the timeout there and also check with integrated system where you may have slowness issue . It would be good that you put some trace log in your plugin and track the time in milliseconds .

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Workflow suspended temporarily due to error: Unhandled Exception: System.Net.WebException: The operation has timed out

    Hi,

    I am pretty sure that the timeout is occurring from your external API. You need to find ways to increase timeout for your external API.

  • Ram 1222 Profile Picture
    Ram 1222 25 on at
    RE: Workflow suspended temporarily due to error: Unhandled Exception: System.Net.WebException: The operation has timed out

    workflow has a process timeout of 2 minutes so the workflow initiated at 12:00 PM and postpone till 12:21 and at 2:24 I received timeout error. Hope this helps @Goutam Das

  • Ram 1222 Profile Picture
    Ram 1222 25 on at
    RE: Workflow suspended temporarily due to error: Unhandled Exception: System.Net.WebException: The operation has timed out

    Hi Arun,

    we are not updating huge number of records, as I mentioned it is just Http call [(HttpWebResponse)httpRequest.GetResponse()]. It is throwing that time out error. I added httprequest.timeout = 300000; in my code but the error is getting even before that. The network is not blocking anything and the API call was sent successfully but we didn't receive any response(even though it is actually getting a response told by third party that they are sending a response). I increased httpruntime execution time in server. Nothing helps till now.

    Note: its not failing for all of the sessions it is failing randomly.

    Thanks

    Ram

  • Ram 1222 Profile Picture
    Ram 1222 25 on at
    RE: Workflow suspended temporarily due to error: Unhandled Exception: System.Net.WebException: The operation has timed out

    Hi Goutam,

    Workflow is running in background and the mode is none(not sandbox) and I gave a process timeout for 2 min. I'm not sure how long it is running. is there a way to check it and increase the time?

    Thanks

    Ram

  • Suggested answer
    Arun Vinoth Profile Picture
    Arun Vinoth 11,613 on at
    RE: Workflow suspended temporarily due to error: Unhandled Exception: System.Net.WebException: The operation has timed out

    Old discussion thread on similar topic: community.dynamics.com/.../165629

  • gdas Profile Picture
    gdas 50,085 on at
    RE: Workflow suspended temporarily due to error: Unhandled Exception: System.Net.WebException: The operation has timed out

    Hello,

    How long time its taking? Is it exceeds 2 minutes ?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans