Outputs
Though entirely optional, normally one would run a JavaScript code in order to produce a result to be used with other commands.
output
The whole flow shares a single global output
JavaScript object that can be modified to include results of a flow:
Where it can later be accessed either in the flow itself or in other scripts:
Note that in the example above, result
is just an arbitrary name. It could be anything.
Output Namespaces
Since output
field is global, several scripts might clash with each other. Consider this example:
The following flow will then print Bye World
, overriding Hello World
result from myScript.js
To avoid such conflicts, consider using namespaces for your outputs:
Where a flow can then be explicit about which output it wants to use:
Note that you have full control over how to structure the outputs and are free to keep them as sophisticated or simple as you want. By the end of the day, output
is just a JavaScript object.
Last updated