The runScript the command allows you to call a JavaScript file from within your flow.

Take a look at our JavaScript docs for guidance on how to use this feature.


To run another flow configured in Moropo

- runScript:
    file: javascript.js   # name of the javascript file in Moropo + .js

Use within your script

- launchApp
- runScript:
    file: javascript.js

Passing environment variables

- runScript:
    file: javascript.js
      SOME_KEY: "my value"


The results of a runScript can returned and accessed later in a flow.

Consider a javascript file which returns two unique strings of text

// javascript.js
output.result1 = 'foo'
output.result2 = 'bar'

These could then be accessed later in the flow

- runScript:
    file: javascript.js
- inputText: ${output.result1}
- tapOn:
    text: ${output.result2}

Last updated