Delete Gmail Label

Definition

The Delete Gmail Label action allows you to remove an existing label from a user's Gmail account. Labels in Gmail help organize emails, and this action provides an easy way to manage and clean up labels that are no longer needed. By using this action, administrators can automate the deletion of unnecessary or outdated labels without needing manual access to each account.
Key capabilities include deleting labels by either their ID or title, streamlining Gmail account management, and maintaining a tidy and efficient email environment.


Example Use Cases

1. Cleaning Up Old Project Labels

When a project is completed, and related email labels are no longer needed, this action can automatically delete them to keep mailboxes organized.

2. Removing Duplicated or Mistyped Labels

Sometimes users accidentally create duplicate or misspelled labels. This action can quickly remove them without manual intervention.

3. User Offboarding

During an employee offboarding process, you might want to clean up their Gmail account, including deleting personal or irrelevant labels.

4. Bulk Gmail Account Maintenance

For large organizations, scheduled workflows can periodically clean up unused or obsolete labels across multiple users' Gmail accounts.


Inputs

1. Connection

A Google Workspace Administration connection is required to authenticate and perform actions in your organization's Google Workspace environment.

  • Explanation: You need to upload a credential JSON file for a service account with domain-wide delegation to ensure the action is authorized.
  • Best Practices: Always ensure that your service account has the required permissions to perform the delete action on Gmail labels. The guide to create this connection can be found here.

2. User Email

The email address of the user whose Gmail label you want to delete.

  • Explanation: Enter the specific Gmail account's email address from which the label will be removed. This is required to specify the account you want to modify.
  • Best Practices: Make sure the email address is correctly formatted and corresponds to an active user account in your Google Workspace.

3. Label

The ID or Title of the label that you want to delete.

  • Explanation: You need to provide the unique label ID or its title. The ID can be found via Gmail's API or UI, or you can specify the exact label name you want to delete.
  • Best Practices: Double-check the label name or ID to ensure you're deleting the correct one. Incorrectly deleting labels may result in losing critical email organization.

Example Situation:

Scenario:
Imagine a company that is managing a Google Workspace account for its employees. They have a specific label called "Old Projects" that is no longer relevant, and they want to remove it from all users' accounts to maintain a clean and organized inbox. The company wants to automate this task to ensure the label is deleted without manually going through each user's Gmail account.

How to Set It Up:

  1. Connection Setup: The administrator creates a Google Workspace Administration connection using the appropriate credentials (service account with domain-wide delegation). This ensures the flow has the necessary permissions to access all user Gmail accounts.

  2. Input Configuration:

    • User Email: The admin sets the email of the user whose label needs to be deleted, or if multiple users need the action applied, they loop through all users.
    • Label: The admin specifies the label "Old Projects" by its ID or name to delete it.
  3. Execution: The flow is triggered, and the action automatically deletes the specified label "Old Projects" from the Gmail accounts of the users included in the flow.

  4. Result: The label "Old Projects" is successfully removed from all the users' Gmail accounts, keeping the inboxes clean and organized.


This example shows how easy it is for the admin to set up this action to automatically manage Gmail labels for their organization's users.