I was asked to look into an error message being received on a failing Workflow and thought the resolution may benefit others, so here we go… Some information has been sanitised to protect the environment these examples were taken from.
Microsoft.Workflow.Client.ActivityValidationException: Workflow XAML failed validation due to the following errors:
Activity 'DynamicActivity' has 58 arguments, which exceeds the maximum number of arguments per activity (50).
HTTP headers received from the server - ActivityId: 25ff28c7-68c7-4eb3-bf23-f296e767eab3. NodeId: WORKFLOWSERVER. Scope: /SharePoint/default/b8b4b9c5-0faa-4b75-aa7f-0bc7f57f39a7/6001f4da-fd3c-4a4d-b880-889fe124fc74. Client ActivityId : fc4ca99c-9031-b096-5c2a-22cdd10ef69d.
From the message, it’s quite obvious to see that the current maximum number of arguments is expected to be 50 (default) yet 58 have been defined in the SharePoint Workflow. There are two options; reduce the number of arguments on the Workflow or increase the maximum number or arguments Workflow Manager will allow. The former is rather obvious and if you’ve already done it you wouldn’t be here. So the latter is what this post is all about; updating the maximum number of arguments. Needless to say that before you proceed, you should concern yourself with the impact of such changes on your environment and that any change should be planned and adequately documented too. Assuming you are happy to increase it, here’s how you do it.
- Let’s quickly verify that we the right number of maximum arguments configured in the Workflow Manager farm. From an elevated Workflow Management Shell session, execute the following cmdlet:
Get-WFServiceConfiguration -ServiceUri https://WORKFLOWSERVER.FQDN:12290 -Name WorkflowServiceMaxArgumentsPerActivity
- Once you have confirmed the WorkflowServiceMaxArgumentsPerActivity property value is as expected (in this instance 50), you can increase the value (let’s say 70) by executing the following cmdlet:
Set-WFServiceConfiguration -ServiceUri https://WORKFLOWSERVER.FQDN:12290 -Name WorkflowServiceMaxArgumentsPerActivity -Value 70
- Once completed, perform a graceful restart of the Workflow Manager services and retry the Workflow… That’s it!
Another method for viewing the value of the WorkflowServiceMaxArgumentsPerActivity property is to go direct to the Workflow Manager Resource Management database. Of course, it goes without saying that you do this at your own risk. For reference, the WorkflowServiceMaxArgumentsPerActivity property is stored in the “WorkflowServiceConfig” table:
- From SQL Server Management Studio, execute the following SQL Query, replacing the database name accordingly:
SELECT * FROM [WorkflowManager_ResourceManagementDB].[dbo].[WorkflowServiceConfig] WHERE [ConfigName] = 'WorkflowServiceMaxArgumentsPerActivity'
- Now scroll down the results until you find the “WorkflowServiceMaxArgumentsPerActivity” row:
Full details about changing Workflow Manager server configuration can be found on the following MSDN article: