Extract custom Gmail labels from new emails
ProductivityRecipe Tools
What it does
When a new email arrives in Gmail, this automation filters out default labels and collects only the custom label names. It stores those names in a list so someone can see which custom labels are applied to the email.
Who it's for
Operations teams who need to organize Gmail emails by custom labels without manually reviewing each message.
Apps used
- Gmail
- Workato List
- Logger by Workato
How teams use this
Organize emails by custom labels
Extract custom labels from incoming emails so the team can route or categorize messages based on internal naming schemes. Default Gmail labels are filtered out automatically.
Track label usage in reports
Store the custom label names in a job report so the Finance team has a record of how each email was tagged. This helps track labeling patterns over time.
Route emails to other systems
Pass the list of custom label names to downstream platforms so emails tagged with specific labels trigger different workflows. Only custom labels are sent, keeping the data clean.
How it works
- Monitor for new email. A new email arrives in Gmail and the automation starts processing the labels attached to that message.
- Filter out default labels. Loop through each label ID on the email and skip default labels like CATEGORY_PERSONAL, Important, and Inbox so only custom labels remain.
- Get the custom label name. For each label ID that passed the filter, retrieve the label name from Gmail so the automation knows what to store in the list.
- Build a list of label names. Collect each custom label name into a single list and format them as comma-separated values so someone can see all custom labels at once.