Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

workflow.inputs vs workflow.variables

garyminnick
Tera Contributor

For workflow input variables I am confused on the correct option.  If I drop an activity on my workflow and open it up and then drag my wf inputs from the Data tab into the activity input fields I get the format workflow.inputs.[variablename]

However the ServiceNow documents say to use workflow.variables.[variablename]

 

https://docs.servicenow.com/bundle/madrid-servicenow-platform/page/administer/using-workflows/concep...

 

Does it depend on use?  If I want to access using a Run Script (Javascript) is it better to use one over the other?  In my testing I was able to write out to a scratchpad variable using both workflow.inputs and workflow.variables.

Is there a best practice?

 

 

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

workflow.inputs is used I believe when you call subflow and pass values

workflow.variables are external values that are passed into and referenced by a workflow during its execution.

https://docs.servicenow.com/bundle/madrid-servicenow-platform/page/administer/using-workflows/concep...

https://docs.servicenow.com/bundle/helsinki-servicenow-platform/page/administer/using-workflows/task...

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader