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
@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?
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
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
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 .
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.
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
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
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
Old discussion thread on similar topic: community.dynamics.com/.../165629
Hello,
How long time its taking? Is it exceeds 2 minutes ?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156