cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

XIQ Site Engine NBI start workflow from another workflow with passing a value in the variable input

XIQ Site Engine NBI start workflow from another workflow with passing a value in the variable input

Antonio_Opromol
Contributor

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

1 ACCEPTED SOLUTION

Zdeněk_Pala
Extreme Employee

This one works for me:

'''mutation { workflows { startWorkflow(input: {path: "%s", variables: {deviceIP: "%s"}}) {status, message}}}''' %(emc_vars["WorkflowToExecute"],varDevice['ip'])

Regards Zdeněk Pala

View solution in original post

4 REPLIES 4

Zdeněk_Pala
Extreme Employee

This one works for me:

'''mutation { workflows { startWorkflow(input: {path: "%s", variables: {deviceIP: "%s"}}) {status, message}}}''' %(emc_vars["WorkflowToExecute"],varDevice['ip'])

Regards Zdeněk Pala

Robert_Haynes
Extreme Employee

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"} 

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.

 

 

 

Hi Robert, I've already done this try, but doesn't work

GTM-P2G8KFN