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)

Error in Sync Workflow

(0) ShareShare
ReportReport
Posted on by

On update of a service activity a sync workflow is triggered and updates the same SA.
This update triggers a second sync workflow where a custom workflow step is added. During the call of this custom step

an error is thrown and process breaks. The error is thrown before it hits any code in the custom step, and all bling bling is stripped out of it (no params etc)
But still the error is thrown.

Sync workflow failed with error message - Unhandled Exception: Microsoft.Crm.Workflow.Services.InvalidCustomActivityExecutionException: Unexpected exception from plug-in (Execute): MyCustomStep: System.AggregateException: One or more errors occurred.
at System.Activities.WorkflowApplication.Invoke(Activity activity, IDictionary`2 inputs, WorkflowInstanceExtensionManager extensions, TimeSpan timeout)
at System.Activities.WorkflowInvoker.Invoke(Activity workflow, IDictionary`2 inputs, TimeSpan timeout, WorkflowInstanceExtensionManager extensions)
at Microsoft.Crm.Workflow.SynchronousRuntime.SynchronousWorkflowActivityHost.ExecuteWorkflowUsingInvoker(Activity workflow, ICommonWorkflowContext context)
at Microsoft.Crm.Workflow.SynchronousRuntime.SynchronousWorkflowActivityHost.StartWorkflow(WorkflowActivationData activationData, ICommonWorkflowContext context)
, error code - -2147220891

Does anybody know where this error is coming from? (in the error I only replace the real step name with 'MyCustomStep')

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at
    RE: Error in Sync Workflow

    Thanks for all the replies, but the problem was caused by dll version.

    The solution was build with nuget package

    <package id="Microsoft.CrmSdk.CoreAssemblies" version="8.2.0.2" targetFramework="net452" />

     <package id="Microsoft.CrmSdk.Workflow" version="8.2.0.2" targetFramework="net452" />

    But the dll version was 8.0. After forcing the solution to compile with 8.2 dll's problem is solved

  • Suggested answer
    Josh Auton Profile Picture
    on at
    RE: Error in Sync Workflow

    I have seen the same error when the workflow activity (plugin) isn't setup properly.  I would agree with saadzag that you need to make sure you are not in an infinite loop, but if you are not ever even hitting the code in your workflow activity then the issue comes before the loop could start.  I would check the following things.

    1.  If your input parameters are set to "RequiredArgument" make sure that they are getting set.

    2. Make sure it follows the proper setup as shown below (there are various ways this could look but here is what I use with or without the "RequiredArgument" attribute)

    public class SomeCustomAction : CodeActivity

       {

           [RequiredArgument]

           [Input("Input Data")]

           public InArgument<string> InputData { get; set; }

           [Output("Output Data")]

           public OutArgument<string> OutputData { get; set; }

           protected override void Execute(CodeActivityContext executionContext)

           {

           }

       }

    3. If all is still good create a new workflow that just calls the workflow activity and on the first line of the Execute method throw an InvalidPluginExecutionException with a message to let you know it at least is calling your workflow activity.

    If none of that works you can look into the dll and make sure you have all ILMerged in all dependent resources I use jetbrains dotPeek to look into mine but there are lots of tools out there,  If you are still stuck we can look into other options.

    Good luck.

  • Suggested answer
    Alagunellaikumar Profile Picture
    6,212 on at
    RE: Error in Sync Workflow

    HI

    In your second work flow and custom workflow code check is there any update on the same entity

  • Suggested answer
    saadzag Profile Picture
    1,145 on at
    RE: Error in Sync Workflow

    Hello,

    Verify that there is not a loop in execution.

    because you have a sync workflow triggered on update, and as you said, it updates the same record.

    Saad

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

#2
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans