Challenge description
Some time ago, a customer requested the solution for frequent SAP backups of crucial transactions data as an additional security measure. Idea was simple – once in every couple hours, bot should run some transactions in SAP, export data to given format and store it on secured SharePoint location where the files would be versioned and be a part of further backups processing using dedicated tool.
Answer
At first glance, process is straightforward as shown in simplified BPMN diagram below:

Of course, each of activities above can fail, and these exceptions should be handled. So, let’s add exception handling:

Voila! Now, in case something happens during execution, our bot will grab details, take screenshots and close SAP before reporting exception to parent flow. Before reaching ecstatic state and implementing our solution with enthusiasm, let’s take a deep breath and go back to beginning. What is the goal of this process? That goal is creating data backups. And what would happen if any of the given transactions processing fails? The remaining ones would be abandoned until next execution, because each error in group processing switches processing to exception handling block which handles safe exit. We can imagine scenario, where one of the transactions produce too much data under given configuration and fails constantly, effectively stopping other transactions for being backed up. So how can we address this issue?
Firstly, it is crucial that all transactions are backed up – in case it is impossible, bot should skip faulty ones and proceed with remaining ones. Secondly, when exception happens, response team should be informed which backups failed to be created. Taking above conditions into account, we can add additional exception handling block, which would work inside group processing, stopping only failed backup processing:

This way, bot handles each processing item individually without interrupting entire flow. On the other hand, exceptions which are critical – like the ones during logging to SAP and it’s restarting – are handled by “external” handling block, which stops further flow processing.

