Skip to main content
Nintex Community Menu Bar

sent emails in a foreach doesn´t work

  • December 7, 2017
  • 7 replies
  • 11 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

Forum|alt.badge.img+12
  • Apprentice
  • December 7, 2017

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?


Forum|alt.badge.img+8
  • December 7, 2017

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.


  • Author
  • December 9, 2017

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


  • Author
  • December 9, 2017

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?


Forum|alt.badge.img+8
  • December 11, 2017

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.


Forum|alt.badge.img+12
  • Apprentice
  • December 11, 2017

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.


Forum|alt.badge.img+8
  • December 11, 2017

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