Context
I can successfully call Actions using ExecuteWorkflowRequest where the called action has no parameters:
var request = new ExecuteWorkflowRequest
{
EntityId = myEntityId,
WorkflowId = myWorkFlowId,
};
service.Execute(request);
where action is a simple workflow, with Category "Action". However I can not call Actions with parameters.
What I've tried so far:
string myParameter = "Hello";
var inputArgumentCollection = new InputArgumentCollection();
inputArgumentCollection.Arguments.Add("MyParameterName", myParameter);
var request = new ExecuteWorkflowRequest
{
EntityId = myEntityId,
WorkflowId = myWorkFlowId,
InputArguments = inputArgumentCollection
};
service.Execute(request);
The called Workflow is a Category: Action with an optional string type input parameter called "MyParameterName"
This call causes an exception saying:
This workflow cannot run because arguments provided by parent workflow does not match with the specified parameters in linked child workflow.
I've also tried... Some places recommend (with no proof) for older CRM versions using the Parameters collection of the request itself... although it seems ugly and/or wrong, I gave it a shoot, with no success:
request.Parameters.Add("MyParameter", myParameter);
returns with
Unrecognized request parameter: MyParameter
Question
How can I call my parametrized Action providing parameters via API using ExecuteWorkflowRequest?