web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Workflow failing with error

(0) ShareShare
ReportReport
Posted on by

I have a workflow. It fires on create or as a child, and waits 30 days until the Expiration Date on a custom entity called Contact Subscription. At the 30 day mark, a Task is created for the Accounting team to generate an invoice. When the Task is marked complete, it updates the Expiration Date to a year out and restarts itself.

Here is a screenshot of the workflow. Ihave bleeped out the product name. This is 2011 on premise, R9 I think.

[View:http://social.microsoft.com/Forums/getfile/296504:750:0]

Most of the time, this workflow is working. There are several out there for which this process has worked just fine.

However, there are several workflows where it gets stuck on the Timeout condition (you see the spinning circle in the screenshot). These Workflow records contain the following message:

Workflow paused due to error: Unhandled Exception: System.ArgumentException: An item with the same key has already been added.

  at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)

  at Microsoft.Crm.Workflow.ActivityHostBase.OnWorkflowLoaded(WorkflowApplication activityInstance, ICommonWorkflowContext context)

  at Microsoft.Crm.Workflow.ActivityHost.StartWorkflowExecution(Activity workflow, ICommonWorkflowContext context)

  at Microsoft.Crm.Workflow.ActivityHostBase.StartWorkflow(ICommonWorkflowContext context, Activity preLoadedActivity)

Researching this error yields a lot of issues with custom code and the SDK, but there's nothing custom involved here.

Does anyone know this error? Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Josh Wells - MSFT Profile Picture
    961 on at
    RE: Workflow failing with error

    Hi Bob,

    Thanks for your question.  My name is Josh Wells and I am a support engineer on the Microsoft Dynamics CRM support team.  I have reviewed the issue you are having and I don't have a lot of good information for you.  What I would need to see is a verbose trace while the issue is reproduced.  The stack here really just shows me that when we are trying to load the workflow is when it experiences an issue.  Looking at the code, there is an If/Else section where I think the issue is occurring at but without tracing, I cant determine which path this is taking.  In addition, I can't explain why it would be happening.  

    The only thing I can think of is that the workflow is already being loaded by the async service when it tries to load it again.  Do you happen to have multiple Async services?  If so, can you try disabling one for a test?

    Other than getting verbose tracing and really digging deeper into it, there is not much we can really do.  Let me know if you have any questions.

  • Ulrich Faden Profile Picture
    on at
    RE: Workflow failing with error

    Hi Josh,

    although this thread is already older, i am facing a similar issue with a sync workflow.

    I get this issue 3 of 10 times loading the subworkflow (as 1-to-many-child workflow) in sync mode.

    As complimentary test i Switch the child now back to async mode, maybe it gets better then.

    Can you please give me more advice, how to get this "deeper tracing" to Analyse when/how it happens?
    I only get the stack trace like our colleague above that is not very informative.

    Thanks in advance!

    Best wishes, Ulrich

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans