As software grows and usage scales up, offline workflow orchestration becomes a crucial piece of infrastructure. At Bit Complete, we recently turned to Google Cloud Tasks to help one of our clients improve two key areas of their consumer app: aggregating user notifications and streamlining our content import process. In this blog post, we'll explore how Cloud Tasks has enabled us to enhance these workflows and create a more efficient, user-friendly experience.

1. Aggregating User Notifications

Our client’s mobile app allows users to engage in various activities, such as following other users, publishing text and video, and bookmarking content. Different activities may trigger notifications for different audiences based on the nature of the activity. We needed a solution that allowed us to manage and deliver these notifications effectively.

To avoid bombarding users with too many notifications, we implemented Cloud Tasks to aggregate similar types of activities within a defined time window and send a single notification for the group. For example, if a user gains three new followers within 10 minutes, Cloud Tasks helps us aggregate these activities and send one notification to the user, informing them of their three new followers.

Aggregating user notifications diagram

This method not only reduces the number of notifications we need to send, but also ensures that our app remains user-friendly and engaging. This technique also allows us to dis-aggregate activity, e.g. when a user follows but then immediately unfollows another user, ensuring notifications remain relevant.

2. Streamlining Content Import Workflow

Our previous content import process was both time-consuming and labor-intensive, involving running several manual scripts in sequence. These scripts included reading a spreadsheet, uploading assets to GCP for storage, moving video assets from GCP to Mux, extracting textual data from raw payloads to into an intermediate format, and finally extracting the semantically interesting content that can be served to users.

To simplify and expedite this process, we turned to Cloud Tasks for a hybrid automated solution. We retained the initial manual step, which involves downloading the spreadsheet and assets locally and uploading them to a Cloud Storage bucket. However, all subsequent steps have been moved to the cloud using Cloud Tasks.

After completing the first manual step, one Cloud Task per piece of content is created to translate to our intermediate format. The task body contains information that the handler needs to retrieve the intermediate rows from the database. The task handler then performs the rest of the steps, including moving the video assets from GCP to Mux, extracting the textual data, and publishing the final content. This new workflow significantly improves the efficiency and ease of the data import process.

New content import workflow

By implementing the hybrid workflow with Cloud Tasks, we not only save time but also reduce the mental burden on developers by streamlining the process.

Summing Up

In summary, Google Cloud Tasks played a big role in enhancing our app's user experience and streamlining our content import workflow. By aggregating user notifications and automating parts of our manual content import process, we've created a more efficient and user-friendly experience for both our users and developers. Cloud Tasks has become an important tool in our toolkit as Bit Complete tackles more and bigger projects.