Problem passing arguments to invoked workflow

Hi,

Newbie question maybe, but I’m unable to pass arguments into another workflow and cannot find any specific
answer as to why this shouldn’t work. I tried to create this workflow, exactly as instructed in:

The first workflow only passes an argument named “InputArgument” to the invoked workflow (Direction “In”). An argument named “InputArgument” is also declared in the second workflow as instructed. The SecondWorkflow only
has a messagebox that quotes the InputArgument variable. So, everything should be in order.

But I always get the same error:

Main has thrown an exception

Message: The values provided for the root activity’s arguments did not satisfy the root activity’s requirements:
‘SecondWorkflow’: The following keys from the input dictionary do not map to arguments and must be removed: InputArgument. Please note that argument names are case sensitive.
Parameter name: rootArgumentValues

Source: Invoke workflow file: UiPath.Core.Activities

Exception Type: ArgumentException

System.ArgumentException: The values provided for the root activity’s arguments did not satisfy the root activity’s requirements:
‘SecondWorkflow’: The following keys from the input dictionary do not map to arguments and must be removed: InputArgument. Please note that argument names are case sensitive.
Parameter name: rootArgumentValues
at UiPath.Core.Activities.InvokeWorkflowFile.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Can somebody tell me what I’m doing wrong?
I cannot see any clear errors in these workflows.

Hi @RPA_tester,
ChildWorkFlow.xaml (5.6 KB)
parentWorkFlow.xaml (5.7 KB)

please refer my example.
It runs correctly.

Regards,
Hoang Anh.

1 Like

Hi,

Your example runs correctly, but when I try to create the same from scratch, it doesn’t work. The reasons are the following (and I’m rather surprised about this, by the way):
I cannot even create the same kind of workflow as you did, since your ChildWorkFlow does not define the variable InputString, but I cannot create a childworkflow like this, as it demands that you declare a variable. But if I declare the variable, I just get the same error as before.

I’m kind of mystified, as according to the knowledgebase and all the online guides, this should work.
I’ve done this:

And it just gives me the same error. Here are my test files:

InvokedWorkflow.xaml (4.4 KB)
FirstWorkflow.xaml (4.5 KB)

I’m kind of annoyed that problems with this simple step are making it harder to build bigger automation processes :frowning:

1 Like

Hi,

Change the parameter from a variable to an in argument. The arguments tab is just right to the variables tab. Click save - go back to the FirstWorkflow - click import arguments on the invoke activity and type in whatever string you please inn the parameter argument.

2 Likes

That works. Thanks!

Hi,

Passing datatable from one work flow to another work flow is not working throwing the error given below,
Invoke workflow file: UiPath.Core.Activities : The values provided for the root activity’s arguments did not satisfy the root activity’s requirements:
‘Argument1’: The following keys from the input dictionary do not map to arguments and must be removed: Extractdt. Please note that argument names are case sensitive.
Parameter name: rootArgumentValues

Check if the direction of argumenty and naming is matching.

Thanks

@rahulsharma,

In EnterTransaction.xaml workflow, you created variables but we have to create Arguments and pass values from Main.xaml file. I changed your workflow. Please find the same.

UiDemo.zip (40.8 KB)

@rahulsharma
When I have that type of error, I look to where the variable is first stored a value. You can verify that is has data with a message box or write line, and output the actual data or simply using (variable isNot Nothing).ToString is enough.

If you find that the variable has data after the first step that assigns a value to it, then find out at what point is it empty (like at the start of an invoked workflow for example). Then, you know if it’s an argument problem. This is a common issue, and is typically solved by ensuring that you have the argument as an IN or IN/OUT so the data can be passed into the workflow. EDIT: or OUT if the variable needs to be passed back to the Main or the workflow that invoked it.

Regards.

@rahulsharma,

I modified your workflow. Please find the same. Let me know if you have any doubts.

UiDemo.zip (41.5 KB)

5 Likes

@rahulsharma,

After adding the workflow, you have to pass arguments to that workflow but you didn’t pass. And also you did one more mistake. In Enter Transaction workflow, we have to create arguments but you created variables.

We will use variables to interact within the workflow and If you want to interact with other workflows then we have to create arguments.

If above workflow works for you then mark it as solution and close this thread.

3 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.