Optional feeder-creating scenario as precondition

Hi all,

I need your advice. I have a test scenario which requires ~10000 already registered and logged in users. To do this, I use 2 simulations. The first one performs registration + login and saves the user data into .csv file. The second one (a main simulation) retrieves the data and executes a number of steps for each user.
I cannot combine these simulations for 2 reasons:
i) registration + login are the most expensive operations, and the server cannot withstand > 20 active users per sec (while the main scenario requires ~500 active users per sec), so it takes a lot of time to process the whole bunch of users.
ii) we do not want to clutter our DB with 10000 new users each time we run the test.
Thus, these simulations have to remain totally separate.

The problem is that certain events (for example, the server went down) can render the saved data useless: authentication keys become invalid, and all users must be logged in again, otherwise the main simulation will fail. I would like to write a script which does the following:

  1. Take the first user from .csv file and try to send any request which requires authentication.
    1.1. If it succeeds, the main simulation starts right away.
    1.2. If it fails, the preparation scenario starts and rewrites a .csv file with the new data.

Is it possible to do so only via Gatling, or do I have to write a shell script which analyzes the result of step (1) and launches (1.1) or (1.2) with (1.1) afterwards?