Gmail Thread
Gmail Thread works with Gmail conversations, which Gmail calls threads: the original email and all its replies together. With it you can list the conversations in a label, move a conversation to the trash or take it out again, and delete it.
Use it when the unit of work is the whole conversation and not a single email. To send, read or reply to individual emails, use Gmail Message.
When to use it
- You want the list of recent conversations in a label to review or count them.
- After handling an enquiry, you want to move the whole conversation to the trash.
- An AI agent moved a conversation to the trash by mistake and you want to restore it.
- You want to permanently delete the conversations of a campaign that has ended.
Configuration
You need a Google Gmail credential, which connects by signing in with your Google account. To move or delete conversations, 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: Get Thread, Trash Thread or Delete Thread. See Operations. |
| Thread Id | The ID of the conversation. Required in Trash Thread and Delete Thread. Optional in Get Thread: if you fill it in, only that conversation is returned. |
| Labels | Only in Get Thread. The label to read conversations from, for example INBOX. The list loads with your account’s labels when you choose the credential. |
| Select Action | Only in Trash Thread. Trash moves the conversation to the trash and Untrash takes it out. Default: Trash. |
Operations
| Operation | What it does |
|---|---|
Get Thread | Returns the most recent conversations in a label, or just one if you give its Thread Id. |
Trash Thread | Moves a conversation to the trash or restores it, depending on Select Action. |
Delete Thread | Deletes a conversation permanently, without going through the trash. |
Advanced options
Only in Get Thread:
| Field | What it does |
|---|---|
| Query | Filters conversations with the same search you would use in Gmail, for example from:customer@company.com or subject:quote. |
| Number of Emails to read | How many conversations to read, starting with the most recent. Default: 10. |
Output
The Data output depends on the operation:
- In
Get Thread, one item per conversation, with its ID (id) and a short summary of its content (snippet). Use that ID in Thread Id to trash or delete it. - In
Trash Thread, the details of the email that starts the conversation after the change. - In
Delete Thread, a confirmation.
You can connect the result to an AI agent or to another component in the flow. The component can also be connected to an Agent as a tool, so the agent decides when to look up or archive conversations. See Tool Mode.
Example
A support team wants to clean up the conversations in a Resolved label every Friday.
- Schedule the flow to run on Fridays. See Scheduler.
- Add Gmail Thread with the
Get Threadoperation and chooseResolvedin Labels. - Connect the output to an Agent that has another Gmail Thread with the
Trash Threadoperation as a tool, and ask it in its instructions to move every conversation in the list to the trash. - Check the Gmail trash the first time to make sure the right conversations were moved.
Good practices
Delete Threadcannot be undone and deletes every email in the conversation. If in doubt, useTrash Thread: Gmail keeps the trash for a while and you can restore it withUntrash.- In
Get Thread, Thread Id only finds the conversation if it is among the ones read with Number of Emails to read, Labels and Query.
Related components
- Gmail Message: send, read and reply to emails.
- Gmail Label: create and delete labels.
- Gmail Webhook: start a flow when an email arrives.