Gmail Label
Gmail Label manages the labels in your Gmail account, the ones you use to sort your emails: create a new label, look up the ones you have and delete one you no longer use.
It usually goes together with Gmail Message: with this component you prepare the labels and with that one you add them to or remove them from emails.
When to use it
- Every time you sign up a new customer, you want to create a label with their name to sort their emails.
- You need the ID of a label to use it in another step of the flow.
- You want to review which labels exist in an account shared by several people.
- When a project ends, you want to delete the label you used for it.
Configuration
You need a Google Gmail credential, which connects by signing in with your Google account. To create or delete labels, the credential needs the Create, Update, Delete, Read access. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The Google Gmail credential of the account you work with. |
| Operation | What the component does. See Operations. Default: Create Label. |
| Label Name | Only in Create Label. The name of the new label. Required. |
| Label Id | The ID of the label. Required in Delete Label. Optional in Get Label: if you leave it empty, all the account’s labels are returned. |
Operations
| Operation | What it does |
|---|---|
Create Label | Creates a new label, visible in Gmail’s label list. |
Get Label | Returns one label or all the labels in the account. |
Delete Label | Deletes a label. The emails that had it are not deleted: they just lose that label. |
Output
The Data output returns the labels you worked with, with their ID (id), name (name) and type (system for Gmail’s own labels, such as INBOX, and user for yours). With Get Label and no Label Id you get one item per label. Delete Label returns a confirmation.
You can use the ID in another step of the flow or connect the result to an AI agent. The component can also be connected to an Agent as a tool, so the agent creates or looks up labels when it needs to. See Tool Mode.
Example
A law firm wants one label per new customer.
- The customer sign-up reaches the flow with their name.
- Add Gmail Label with the
Create Labeloperation. - In Label Name put the customer’s name.
- From then on you can choose the label in the Labels field of Gmail Message to sort that customer’s emails.
Good practices
- Gmail’s own labels (
INBOX,SENT,STARRED…) cannot be deleted. - If a label with the same name already exists, Gmail does not let you create it again. Look up the labels first with
Get Labelif you are not sure.
Related components
- Gmail Message: add and remove labels on emails.
- Gmail Thread: work with whole conversations.
- Gmail Webhook: start a flow when a label changes.