<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Auroradelrio on Medium]]></title>
        <description><![CDATA[Stories by Auroradelrio on Medium]]></description>
        <link>https://medium.com/@auroradelrio?source=rss-ca5cc486ffe9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*lT08S_iVT4rLLHHq</url>
            <title>Stories by Auroradelrio on Medium</title>
            <link>https://medium.com/@auroradelrio?source=rss-ca5cc486ffe9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 00:52:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@auroradelrio/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Managing workflows at Nando’s]]></title>
            <link>https://medium.nandos.dev/managing-workflows-at-nandos-448cb1e65b8d?source=rss-ca5cc486ffe9------2</link>
            <guid isPermaLink="false">https://medium.com/p/448cb1e65b8d</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[microservice-architecture]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Auroradelrio]]></dc:creator>
            <pubDate>Thu, 23 Jan 2025 12:24:03 GMT</pubDate>
            <atom:updated>2025-01-30T09:57:13.748Z</atom:updated>
            <content:encoded><![CDATA[<h4>Managing workflows in a large organisation like Nando’s can be both challenging and crucial. It normally goes beyond standard communication flows, requiring a more sophisticated system to handle approvals, follow-ups, and scheduling.</h4><p>In this article, we will explore how Nando’s is addressing this challenge and how the development of a microservice-based workflow service is helping to streamline complex processes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hI7J27k1vrS1qKOhvjUi8w.png" /><figcaption>Workflow al Nando’s</figcaption></figure><p>The trigger for building a <strong>Workflow Service</strong> was the need to improve our <strong>incident reporting process</strong>. While our Risk and Safety Management (RSM) team was already doing great work, we found an opportunity to enhance the system’s ability to streamline more complex cases.</p><p>Previously, managing these incidents involved multiple manual steps. The process required time-consuming communication between restaurant managers and the RSM team to constantly confirm the status of the situation. This challenge highlighted the necessity for a more <strong>robust workflow service</strong>, one capable of automating reminders, escalating follow-ups, and ensuring that critical actions are taken without delay.</p><p>In order to handle multiple possible scenarios, the new service would need to be fully capable of understanding the underlying logic of each case. It must trigger different workflow paths based on the event type and establish a pipeline to efficiently manage and execute these workflows through various systems, such as task assignments, approval chains, automated updates, or any other processes required by Nando’s. Additionally, it would need to ensure that tasks within the workflows are executed successfully and track their status throughout the process. It should also be able to schedule workflows and their associated tasks to align with specific timelines or events, ensuring coordination and timely execution. Last but certainly not least, the service must be highly scalable to support other systems across the company that may have similar workflow requirements in the future.</p><p>In more technical terms, we needed to build a service with the following capabilities:</p><p>· <strong>Idempotence:</strong> Ensuring that workflows and tasks are processed only once, even if triggered multiple times, to prevent duplicates.</p><p>· <strong>Scalability:</strong> The ability to handle an increasing volume of workflows and new use cases without degrading performance.</p><p>· <strong>Resilience:</strong> Robust error handling and recovery mechanisms to maintain service continuity during unexpected issues.</p><p>· <strong>Observability:</strong> Monitoring and alerting to track the status of workflows and tasks, enabling early detection and resolution of issues.</p><p>· <strong>Extensibility:</strong> A modular design that allows for easy integration with new systems or additional workflow requirements in the future.</p><p>The first step was to think about the architecture. At Nando’s, we work with Google Cloud and realised early on that avoiding a monolithic architecture would allow us to make the most of GCP’s services. This approach ensures our solutions align well with our needs while taking advantage of GCP’s built-in capabilities.</p><p>Before diving into the material, here’s a general overview of the services used to help you follow along with what will be described.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*IKiIUUJ21JjBTk7If47vgQ.png" /><figcaption>GCP Services Flow</figcaption></figure><p>The initial considerations focused on messaging services like <strong>Pub/Sub</strong> and <strong>Cloud Tasks</strong>, which provide features like retry mechanisms and reliable delivery. After a detailed evaluation, we chose <strong>Cloud Tasks</strong> as it better suited the needs of our service.</p><p>Cloud Tasks supports explicit invocation, enabling us to specify the exact endpoint for each task. Cloud Tasks is also stateful, meaning we could easily track retries and store the outcome state on our side. While something similar could be achieved with dead letter queues, it seemed like too much effort for such a simple requirement.</p><p>Most importantly, it prevents duplicate events, unlike Pub/Sub, which ensures at-least-once delivery but can result in duplicates — critical for us, as sending multiple tasks for the same issue is not always acceptable.</p><p>Finally, Cloud Tasks supports scheduling, an essential feature for our service since not all tasks in the workflows need to be sent immediately. These capabilities made it the ideal choice for our architecture.</p><p>Once we had chosen the most appropriate messaging service, we were still missing the core of the system: What GCP service would we use to deploy our solution, and how would scalability and extensibility be handled?</p><p>As we wanted to make this service available to other systems that required workflow service, we needed a solution capable of handling increasing demand quickly and efficiently. The main service had to orchestrate tasks and route them to the appropriate services, while easily adapting to this growing demand. To address this, we chose Cloud Run to deploy our service due to its automatic scaling, full customization, and ease of management and deployment. It can handle traffic from zero to thousands of requests per second!</p><p>Next, we needed the service to be extensible and modular, enabling fast growth, easy deployment, and maintainability. We decided that Cloud Run Functions would be an ideal choice for the granular development of individual tasks. This results in a system composed of small, independently deployable services, each designed for a specific purpose.</p><p><strong>Architecture Overview:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a1L6_WPuL4JwE0sstYjgiQ.png" /><figcaption>Architecture Overview</figcaption></figure><ol><li><strong>Event Collection</strong>: The <strong>Workflow Service</strong> receives events from multiple upstream services. These upstream services contain the core business logic that determines the workflow required based on predefined conditions.</li><li><strong>Task Processing</strong>: Each workflow consists of one or more tasks. The Workflow Service processes these tasks and stores them in <strong>Firestore</strong> for state management and tracking.</li><li><strong>Task Distribution, Orchestration &amp; Monitoring: </strong>Once processed, tasks are routed to the appropriate <strong>Cloud Run Functions (orchestrators)</strong> using <strong>Cloud Tasks</strong>. These orchestrators are responsible for executing specific tasks, such as sending emails or updating other services, ensuring that each task reaches its destination while tracking its current status.<br>Cloud Tasks’ retry mechanisms handle transient errors, while the statuses of both successful and failed tasks are stored in Firestore. This tracking mechanism simplifies monitoring and troubleshooting by providing a clear log of events and their outcomes.</li></ol><p><strong>Key Characteristics:</strong></p><ul><li><strong>Microservices Architecture</strong>: The system follows a microservices design pattern, where independent services (Cloud Run Functions) handle discrete tasks. This separation of concerns helps scalability, maintainability, and fault isolation.</li><li><strong>Event-Driven &amp; Scalability</strong>: The architecture is <strong>event-driven</strong>, enabling asynchronous processing of tasks and taking advantage of the serverless capabilities of Cloud Run and Cloud Run Functions for automatic <strong>scaling</strong>.</li><li><strong>Reliability and Recovery:</strong> Using Cloud Tasks for task management, the system ensures tasks are executed properly, even if there are transient errors, thanks to its built-in retry mechanisms.</li><li><strong>Idempotency &amp; Observability</strong>: The architecture ensures <strong>idempotence</strong> by using Cloud Tasks for task management and Firestore for data storage, preventing duplicate processing. Additionally, it includes logging and monitoring to provide observability into the system’s performance.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=448cb1e65b8d" width="1" height="1" alt=""><hr><p><a href="https://medium.nandos.dev/managing-workflows-at-nandos-448cb1e65b8d">Managing workflows at Nando’s</a> was originally published in <a href="https://medium.nandos.dev/">Nando’s Product and Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>