Hello, I am using for mail each activity , i cant seem to understand this error : The activity ‘For Each Email’ with ID 5 threw or propagated an exception while being canceled
This happens once published to orchestrator and triggered by time or a connector365 but when i run it manually using assistant it does not throw that error
please assist
Welcome to the Community @Bellian.
It’s actually hard to recreate this issue but in past one user reported this issue. According to that it was in Finally section of the Try Catch.
In your code, try to set logs and identify exact activity that is failing. Something is not being intialized could be the reason here.
Hi @Bellian
Use the try catch or check and increase job timeout, ensure stable mail connection, add error handling around the For Each Email activity, and add logging to identify where it fails.
@Bellian please try the below steps
- Check timeout/kill settings in the trigger — it might be auto-terminating the job.
- Add Try-Catch around the For Each Email loop to handle graceful cancellation.
- Check unattended robot permissions for Outlook or 365 connection.
- Add logs before and after the loop to trace the cancel point.
Are you able to find out exactly activity which is causing this issue?
When running either in debug mode or using assistant, there’s no error only when triggered from orchestrator that’s where it occurs
Can you please elaborate the error, what is the issue you are getting with screenshot,that may help us to debug
@Bellian is it occurring right on the For Each Email activity ?
Hi @Bellian
I see you have for each email defined under try block. Could you please confirm if your exception is being caught by catch block?
Yes
The activity ‘For Each Email’ with ID 6 threw or propagated an exception while being canceled.
at UiPath.Executor.BaseRunner.EndExecute(IAsyncResult result)
at UiPath.Executor.InProcessRunner.EndExecute(IAsyncResult result)
at UiPath.Core.Activities.ExecutorInvokeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
Can you try recreating/replacing the workflow or activity. There seems something misconfigured or broken.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.