You can execute javascript using Execution Evaluator in Process Inspector if you have a PC connected Process Server.
For offline Process Server you can use REST APIs to execute javascript, the javascript execution is disabled by default it needs to be enabled first