Any script in a watch can add variables to the context. For example something like this can be added to a script condition:
ctx.vars.my_var=5; return ctx.vars.my_var <= 5;
Once a context variable has been defined it is accessible in all places of a Watch that supports scripting. So in the above example the
ctx.vars.my_var can also be checked in a script transform elsewhere in the Watch.
Context variables are scoped to the watch execution to are defined in. Context variables aren't stored in the watch history. However when using the execute watch api to test/debug a watch, the context vars can be included in the response if the
debug option is specified.