Automating business big time: we are creating a digital brain of our own

Natalia Garakhanova
dodoengineering
Published in
8 min readMar 17, 2023

Every business process at Dodo Pizza is controlled by the Dodo IS information platform. It helps us make pizza, keep records of our stock, of vacant and filled shifts, manage the team, and much more. All of the orders go through it. In short, it is the heart of the business, its cornerstone, but at the same time it is merely a tool that responds to what humans tell it.

And humans are not perfect, they tend to make mistakes, whether by accident or purposefully. We encounter errors that grow out of the human factor all the time: this time it is the delivery guys who refuse to take orders from remote locations because they don’t want to bring them there, that time it is the pizza makers messing up the recipe or the order. So we decided to make a system that would be smart enough to control the business instead of the human (as much as that is possible) and to make us more money.

We have long mulled over the idea of such a system, so utterly tireless, that could oversee the beating of Dodo’s digital heart. The idea of a brain that could control every pizza shop process to the benefit of our partners.

And since we decided to automate, we needed to automate big time.

In 2021, we started working on this system, dubbed “The Celestial Logistician,” that would let our partners easily tweak their strategy at the subtlest movement of a hand. Like in a video game: if you want your delivery times to be faster, you pull the slider to the left, if you want to spend less, to the right it goes. The idea is, every strategy will be determined like this, starting with purchase specifics (at which prices and within what time limits the Celestial Logistician will order ingredients), ending with the amount of delivery people in a single shift. From maintaining the delivery area to kitchen table management and balancing orders between pizza shops.

And in case a partner hasn’t chosen their priorities yet, the system can think for them, and suggest ways to make or save more money.

Here’s what the Celestial Logistician will be able to do:

  • collecting orders in a single run and assigning runs to delivery guys (autoassignment);
  • managing the number of delivery guys on shift so that they don’t have to sit around doing nothing, but so that there is not a lack of them either;
  • managing the kitchen so that the order is ready as soon as the delivery person arrives;
  • managing purchases: predicting ingredient purchases by taking last week’s ingredient expenses, supplier stock, the prices, and the delivery time into account;
  • asking nearby pizza shops for help in case a kitchen cannot manage on its own.

When we just started this, we realized we were attempting something massive and complex, so we decided we would split the leviathan into chunks. We began with automating delivery, so that the system could assign delivery people their orders, taking into consideration the distance, the delivery person’s mode of transportation, and the amount of orders in a run.

Development that takes place in a vacuum leads nowhere

We are a mature product development team, and we are no longer seeing the world through rose glasses. We understand very well that when we start developing a product, it exists as an idealized version of itself in a vacuum, and we’ll have to gradually correct it to better reflect the current situation.

Visiting pizza shops, conducting interviews with the managers, the insights gained from analytics will all give us an idea of the work delivery guys do in pizza shops, but we cannot learn everything in advance. Our idealized model sees the couriers carry out their duties diligently, and everything going according to plan on shift. Things might be very different in a real pizza shop. And for us to understand what we are up against and how it will come into play when we do a chain-wide implementation for this product, a field test is absolutely a must.

We have outlined several iterations — each one is a fully sustainable product in and of itself (with some restrictions). As soon as we get one of them, we are choosing a guinea pig pizza shop, gathering the whole tightly knit team, and embarking on a testing trip.

Autoassignment: first storm

In March 2022, we finished developing the first iteration. At this stage we wanted to see if the idea of automatically assigning orders could hold any water in practice. The system was still in a rudimentary state: it determined which order had priority for delivery and assigned it to the first delivery person in the queue.

And after literally thirty minutes of testing, the system crashed. Not very hard, and not for very long, of course — we managed to get it backed up with hotfixes. During the next four hours we saw a few more bugs, but were ultimately able to finish the test.

Despite all of those bugs in the first test, we saw that the Celestial Logistician concept was viable, and we continued iterating. We added features and removed bugs after every test, and then we went and looked at it again.

Long hard road out of hell

Every test brought a bunch of new insights and awareness of situations that happen during a shift, which our system didn’t account for.

For example, we initially thought that the orders that were closest the system would assign to delivery guys on foot. Medium-distance orders would go to delivery people on bikes. And the ones farthest away would be assigned to the ones with cars. A tsunami of furious messages followed on the very first few days of testing. Car-driving delivery guys only managed to deliver a couple of orders in a day, making zero money. And the ones on bikes could not feel their legs under them after struggling to deal with the endless order queue.

As a result, we had to urgently change the rules: couriers on foot continued to get the smallest-distance orders, the ones with bikes got small and medium distances, and the driving delivery guys covered the whole delivery area of the pizza shop. And that distribution finally worked!

What about the metrics?

We wanted to decrease the time a pizza spends on the heating rack. The longer an order spends on the rack, the more flavor qualities it loses. However, we had to abstain from giving out more free pizza coupons for being late than we already were, and we needed to avoid increasing the delivery time for any significant amount.

But during the first short-term tests we had better things to worry about than business metrics: we needed to see if the system was at all viable. It was under intense scrutiny during these tests: someone would monitor the logs, someone else would make database inquiries to check order completion. And a person in the pizza shop would look directly into the delivery guys’ phones. Any defect got reported immediately, on the spot.

At first we were looking at purely technical metrics: the amount of orders the system processed in a unit of time; service heartbeat, meaning, to put it in crude terms, we were waiting for the service to send us a signal. And whenever there was no pulse, we would sound the alarm.

Gradually, we’ve managed to make the system more stable, and these technical metrics have stopped “clicking.” That was when various business problems started coming up. One time, for example, a delivery person accidentally skipped an order he was assigned, and the rest of the guys started, as dictated by the code of honor, refusing to take it so that it could do a lap and come back to the original person. They uphold their friendship, we see an influx of run refusals, and an order spending too long on the heating rack.

Not to mention that you cannot measure everything when you have got a giant business. Oftentimes, undigitizable processes occur, you cannot accurately estimate the value of every influence, and in some cases, if an experiment shows a decrease in the metrics, it doesn’t mean you need to abandon the product and go, “Nope, not doing this!”

Everything needs to follow from common sense. Common sense is our team’s manifest. There are people whose driving force is their vision, others use data for everything. We use common sense.

It feels like we are flying to settle on a new planet, we have a mission and a vision, but we also keep an eye on the air report, we are data-driven as well. And to colonize this planet for the glory of humanity you sometimes need to veer off course a bit, if there is an asteroid in the way, and other times you need to trudge on course, even if one of the engines gave out and you are fixing it as you go. Common sense!

Where are we

At the moment, the Celestial Logistician can group orders into a run, get current traffic data from geoservices, resist the delivery people’s tricks, distinguish delivery orders by type of transport, and arrange the orders in such a way that the delivery guy can deliver a delicious hot pizza on time.

We decided to continue the roll-out, because we saw how we were saving kilometers, and how the pizza was spending less time on the heating rack. Here are a few stats from a pizza shop in Volgograd, Russia:

  • average time spent on the heating rack has decreased by 34%, but what is even more awesome, there is now 31% fewer orders that would spend more than 15 minutes on the rack;
  • long-distance orders that weren’t usually accepted with excitement before, are being delivered to the customers 47% faster.

We still need to go through several more iterations and to check several hypotheses. And there is the list of everything the delivery people were hurting about during the last test. We are currently simultaneously working on smart tracking so that we can group orders before they reach the kitchen.

And on a global scale, a large launch awaits us. In a few pizza shops at first, then in all of Russia, then Eurasia (Kazakhstan, Belarus), then globally. In Africa and Latin America. But that is a whole separate story.

--

--