You can have multiple scenarios in one application.
How to create a scenario
Open your application, select Scenarios on the left menu, and click on the plus icon and give your scenario a name:
This opens a new tab in the online IDE on the right. This is where you write your code. If needed, you can rename the scenario or change the source code later.
You can upload changes automatically via management API.
You can share a scenario between different applications. To do this, move a scenario you want to share to the Shared folder on top of the scenarios list:
Calling functions from other scenarios
You can use functions from two scenarios in the same application. To do that, you need to add two scenarios to the same routing rule. After that both scenarios execute in the same space, and you can call functions and access variables from both scenarios without the need to import anything.
Execute a scenario
To execute a scenario, you need to create a routing rule and launch it.
There are several ways to launch a routing rule:
A management API request
An incoming call into the application
Manual routing rule launch via the control panel
Read more about routing rules in the next article.