Skip to content

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.

FieldWhat it does
Credential (required)The Google Gmail credential of the account you work with.
OperationWhat the component does. See Operations. Default: Create Label.
Label NameOnly in Create Label. The name of the new label. Required.
Label IdThe 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

OperationWhat it does
Create LabelCreates a new label, visible in Gmail’s label list.
Get LabelReturns one label or all the labels in the account.
Delete LabelDeletes 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.

  1. The customer sign-up reaches the flow with their name.
  2. Add Gmail Label with the Create Label operation.
  3. In Label Name put the customer’s name.
  4. 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 Label if you are not sure.