Script nodes in Process App (beta version)

How to use and work with script nodes in process apps(beta version) as when I tried to implement it, it wasn’t working for me and also I was not able to access those variables defined in script node outside of it.

The general documentation that is available is very generic, can you provide any specific documentation on how to work with script nodes in process apps , defining variables and business logic and accessing them outside ?