A simple flow that saves up to 15% of Google Workspace costs

IT Use Cases , zenphi Use Cases

Google has recently significantly increased its prices, impacting the IT budgets across businesses of all sizes. This simple flow would allow you to save up to 15% on Google users licenses — one of the largest cost centers for organizations using Google Workspace. Let’s dive in!

Table of Contents

Why do you need to automate user deletion and archiving

For every company using Google Workspace, efficient license management is crucial for cost control. According to our survey, conducted in 2023, 8 out of 10 companies overspend on user licenses due to inactive accounts that linger unmonitored. It happens when a company doesn’t have a system to automate the archiving and deletion of inactive users. On the other hand, companies where Google admins use relevant tools to that fully automate this process in a way that is not intrusive and aligns with their existing business practices, can achieve outstanding results on saving time and money for the IT department.

For instance, one of our customers at Zenphi managed to hit a 15% reduction in expenditures associated with acquiring new user licenses simply by implementing an automation flow for handling inactive accounts. Do you want to learn in details how exactly they managed to do it? Read further!

But first, we quickly cover tools that can be used to build necessary cost-saving automations.

Tools that can be used to optimise Google Workspace costs


Admin console

There’re several automated user management features that can be utilized directly from Google Admin console.  You can configure settings to automatically suspend or delete user accounts after a specified period of inactivity.

The upside: easily accessible, already there

The downside: in most cases, Google admins are not the core decision makers on the users status. It’s the line managers who pull strings in this. If you automate user deletion using Admin console you can’t avoid the manual step: consulting with the line manager what has to be done with this user. Again, managers tend to ignore many IT department requests, thus decreasing the ROI on automation.

APIs for Custom Automation

Google Workspace provides APIs that can be used to develop custom scripts or applications to automate the management of user accounts, including the suspension or removal of inactive accounts.

The upside: high level of customisation

The downside: scripting the workflow from scratch is a lengthy and resource consuming process. Also, you’d probably have to update the script after each Google Apps update, as some functions can become broken.



Zenphi is a great Google admin tool that allows you to automate Google admin tasks fast without using additional resources, and requires zero maintenance effort. Once the flow is build, you don’t have to do anything: we’ll make sure it runs smoothly as long as you want it to run. As a result, you’ll be able to optimize Google Workspace (G Suite) costs, including Google Cloud costs. 

Automating Google Workspace Inactive Users Licenses Revokes

To build this flow, we recommend splitting it into two parts: first, we want to generate a report on inactive users that would be sent to the IT team once in 2 weeks, once a month or however often you need it to be created and sent. Second, we would build a flow that would assign a task to a relevant line manager to make a decision regarding inactive user associated with this manager, and actually delete, archive or do nothing with the user in question.

Step 1: Automate inactive users reporting

Let’s say we want to build an automated flow that every 2 weeks would run a search on our Google directory and find users who have not logged in for, say, 60 days. Obviously, this number can be customised based on your company’s business practice.

Search for users

Basic setup allows you to run a search for max 500 users. If you have more than that you’d just have to loop the process and repeat it as many tines as needed until the search is done across all users.

It’s simple: loop by adding an If condition: if there are no more users left to list, then end the loop.

Add filtering

However, you don’t want to see all the users. You want to filter out those who haven’t logged in for 60 days or more. For this we just add a filter before the loop begins by adding a Current data and time variable and subtracting 60 days from it (in your case, it can be 30 or 90 days, or any number of days).

Query the collection

Within the looping process you’d also want to Query the collection of users that have been inactive for the amount of days you specified before.

Create a Spreadsheet

Next step — we want this collection to be placed in the Spreadsheet that we also created automatically (let’s call it IncativeUsersReport_date)

In the spreadsheet you can configure data you want to save: for example, user email, user login, how long they have not logged in, was the user archived or suspended, and maybe the line manager’s email address if you want the line manager to be notified about a user that is still listed in the directory but have not logged in for a while and ask them to take action. 

If you’re using this step, don’t forget to add a Lookup Manager step from the Google directory actions collection so that Zenphi automatically checks the relevant manager and add it to your spreadsheet.

Send an email to IT

After you run the loop, query the collection, add rows to the new Google Sheet, you’d need an email to be sent to you with the newly formed inactive users report.

Simply add Send email action and specify relevant fields (whom to send it to, what to include, subject and the body).

Test the flow and see if you’ve got the email with the report. 

Step 2: Automate users deletion and archiving

Now, the next step. After the report is created you’d want to automatically request an action from a line manager: Do nothing with the user, Delete, Suspend, or Archive it. The final goal, let me remind you, is to revoke licenses from inactive users and thus, optimise Google Workspace costs that company has to carry.

Read Rows

For this automation we have to add a new action: Read rows. We don’t want to send the same email that you’ve just received, to all managers. We need to request an action from a relevant manager that is associated with every inactive users. Hence, the Read rows step. We need to read the spreadsheet rows and extract data that we’d use in the nest step.

Assign a task — ForEach

The next action we have to add is ForEach or like in this case, Parallel For each, that would allow you to run several flows in parallel. For each line manager we would want to assign a task of taking action. The action is that the manager should review an inactive user and decide what has to be done with their account.

In Zenphi you can set up the task actions, as well as the task expiration date and reminders you’d want to send.

This is an example of an email that a manager would receive. No need to say, that email templates can be adjusted to your brand colours. 

Act On the Decision

Final step is to act on the decision made by the manager. For this, you can use Switch by value action.

Test run the flow and launch.

If you set up the starting date for the Current date, the flow will be run automatically from now on every 2 weeks (or however you set it, maybe once a month, or once in 3 months) thus saving you up to 15% of funds every company overspends on Google Workspace user licenses.

Watch a full video tutorial that covers the whole process of building the workflow.

Talk to us

Using a more refined procedure to manage your Google Workspace licenses? Let us help you to build the automated flow to support it!