09-02-2022 06:43 AM - edited 09-02-2022 06:44 AM
Hi,
I'm trying to run a workflow from another workflow with the NBI mutation call:
mutation {
workflows{
startWorkflow(input: {
id: "idnumber"
variables: "[....]"
} {
status
message }}
but I want to set a variable value in the list of variables of the workflow that i want to run in manner that this use the value that I pass to it.
How to do this?
I'm able to run the second workload with the id alone input field, but I don't know how to pass also a variable value in the NBI mutation call.
Is there and example on how to do this?
Thanks
Solved! Go to Solution.
09-04-2022 11:55 PM
This one works for me:
'''mutation { workflows { startWorkflow(input: {path: "%s", variables: {deviceIP: "%s"}}) {status, message}}}''' %(emc_vars["WorkflowToExecute"],varDevice['ip'])
09-04-2022 11:55 PM
This one works for me:
'''mutation { workflows { startWorkflow(input: {path: "%s", variables: {deviceIP: "%s"}}) {status, message}}}''' %(emc_vars["WorkflowToExecute"],varDevice['ip'])
09-02-2022 09:14 AM
You should be able to accomplish this by sending "variables" which is JSON formatted data. I am not clear on if custom variables defined within the workflow can be referenced here - but try that...
input StartWorkflowInput { #DEPRECATED - Replaced by operationId. NBI responses will not return this value anymore. clientMutationId: String id: Long #Unique identifier optionally passed into input object of any query/mutation call, returned in the corresponding response output. operationId: String path: String variables: Json }
For example:
variables: {deviceIP: "192.168.1.1"}
09-03-2022 05:41 AM
Hi Robert,
I've found my problem and was that in value of my variable there were a /n character and removing this in effect the format
variables: {deviceIP: "value"}
works well.
The problem I need now to solve is that in my value string to set as variable can be present control characters in the middle or double quotes, and using a string with these chatacters the mutation executon fails and no variable value is set.
09-02-2022 09:56 AM
Hi Robert, I've already done this try, but doesn't work