sent emails in a foreach doesn´t work

  • 7 December 2017
  • 7 replies
  • 8 views

I have a nintex workflow that read a collection and sent one email for each item. For each element in this collection, have to read a item in other list where obtains the recipients of this emails.

In the 4th iteracction the workflow is suspended and show the following error:

 

System.Net.WebException: Exception encountered while processing the HTTP request. Exception details: 'HttpClient.SendAsync task was canceled. TraceActivityId=cc9dc52b-1b8e-dafa-bcf0-0097770175f0'.
at Microsoft.Workflow.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
at Microsoft.Activities.Hosting.HostedHttpExtension.HttpRequestWorkItem.HttpRequestWorkItemAsyncResult.End(IAsyncResult result, Int32& responseCode)
at Microsoft.Activities.Hosting.HostedHttpExtension.HttpRequestWorkItem.OnEndComplete(ScheduledWorkItemContext context, IAsyncResult result)


7 replies

Userlevel 3
Badge +12

Hi,

Is it happening with 4th iteration every time?

Please try logging the item value before send email action and see what it is retrieving?

Badge +8

Are the email addresses coming from a collection? If so I would put the email value out to the wf history to check the value.

No. The addresses are stored in different variables because I get them from other lists

Almost always in the fourth. I get a list of values of a field of the item. Each value is the title of an item from another list. From there I get the emails. I have changed this list of values and I still have the same problem.

It can be a problem of times when reading data from the other list?

Badge +8

Have you tried using the same email address for every time you send it? Maybe there is an issue with the email address in the 4th one.

Userlevel 3
Badge +12

Hi, Please try to log all variable into history, and examine the values including email, and see if the fourth item values are as expected or something wrong.

Badge +8

Yes! This is the best way I've found to troubleshoot workflows.

Reply