Issue
When trying to publish a workflow, you may receive this error.
"Error publishing workflow. Unable to cast object of type"... 'System.Double' to type 'System.String', or '[Microsoft.Activities.DynamicValue]' to type '[System.String]'.
This is usually caused by a Set Variable action or a Math Operation where the data types do not match. The System.Double to type System.String may give you a clue where the issue lies within your workflow.
"Error publishing workflow. Unable to cast object of type"... 'System.Double' to type 'System.String', or '[Microsoft.Activities.DynamicValue]' to type '[System.String]'.
This is usually caused by a Set Variable action or a Math Operation where the data types do not match. The System.Double to type System.String may give you a clue where the issue lies within your workflow.
Resolution
Review the workflow in question for any Set Variable actions or Math Operation actions. You will need to verify there are no mismatched data types, i.e. Integer to String, in your actions.