> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jelou.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Gmail

> Send emails, search messages, and manage Gmail labels, drafts, and signatures from your Brain Studio flows.

**Gmail** is the formal communication channel that complements the immediacy of WhatsApp or Slack. While other integrations solve real-time coordination, Gmail allows your flows to send follow-ups, confirmations, proposals, and formal escalations from the connected account.

In **Brain Studio**, this integration connects your inbox so flows and agents can send, search, and organize emails directly from the conversation, without anyone opening Gmail separately.

## What Gmail enables

When you connect **Gmail**, you can:

* **Close the sales loop from chat** — send proposals, follow-ups, or confirmations by email after a WhatsApp or web chat conversation
* **Search and read existing emails** to provide context before the agent replies: previous threads, attachments, or communication status
* **Organize inbox operations from the flow** — create labels, label messages, archive, or move to trash based on business rules
* **Prepare drafts for human review** before sending sensitive emails
* **Manage signatures and aliases** to keep brand consistency in automated communications

***

## Installation

### Prerequisites

1. A **Google account** with access to **Gmail**.

### How to connect it

The most direct way is using [**Jelou Agent**](/en/guides/getting-started/jelou-agent): describe what you need and the agent connects **Gmail** automatically inside the flow.

If you prefer manual installation, follow these steps in **Marketplace**. The connection uses **Google OAuth**; you do not need to copy credentials.

<Steps>
  <Step title="Open Marketplace">
    In Brain Studio, open **Marketplace** from the side menu.
  </Step>

  <Step title="Search Gmail">
    Find **Gmail** in the catalog and click **Connect**.
  </Step>

  <Step title="Authorize access with Google">
    A secure Google authorization window will open. Sign in if needed and accept the requested permissions.
  </Step>

  <Step title="Confirm installation">
    Back in Brain Studio, complete the wizard until the integration appears as **connected**.

    <Check>
      In **Marketplace**, Gmail should appear as connected. From **Canvas** you can add its node, and in **AI Agent** → **Tools** you can enable it.
    </Check>
  </Step>
</Steps>

***

## Available tools

At a high level, actions are grouped as:

* **Query** — search emails, list labels, threads, and aliases.
* **Create or modify** — send email, create drafts and labels, add or remove labels, update signatures.
* **Flow operations** — approve workflow and download attachments.
* **Delete** — send messages to trash and archive emails.

This integration exposes 16 tools in Brain Studio; below is each tool with purpose, inputs, and example.

<Info>
  If parameter names in the tool form do not match this page, **prioritize the labels shown in Brain Studio** when configuring the node.
</Info>

## Features

<AccordionGroup>
  <Accordion title="Add label to email">
    Adds one or more labels to an existing message using the Gmail message modify API.

    **Inputs:**

    * **messageId** (string) — Message ID.
    * **addLabelIds** (array of string) — Label IDs to add (e.g. `STARRED`, `IMPORTANT`, or a custom label ID).

    **Example:**

    ```json theme={null}
    {
      "messageId": "188c9a0f12abcde3",
      "addLabelIds": ["Label_123", "STARRED"]
    }
    ```

    [Google documentation: `users.messages.modify`](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/modify)
  </Accordion>

  <Accordion title="Approve workflow">
    Suspends flow execution until approval is completed via the email approval mechanism configured in the platform. Use when a human must validate before the flow continues.

    **Inputs:**

    * Depends on your flow configuration (approval identifiers, message, recipients, etc.). Check the fields in Brain Studio.

    <Note>
      Exact parameters are defined by your flow and the tool in the builder.
    </Note>

    [Documentation: suspend and resume flows](https://pipedream.com/docs/code/nodejs/rerun#flowsuspend)
  </Accordion>

  <Accordion title="Archive email">
    Archives a message (typically by removing the `INBOX` label or equivalent).

    **Inputs:**

    * **messageId** (string) — Message ID to archive.

    **Example:**

    ```json theme={null}
    {
      "messageId": "188c9a0f12abcde3"
    }
    ```

    [Google documentation: `users.messages.modify`](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/modify)
  </Accordion>

  <Accordion title="Create draft">
    Creates a message draft in the connected account.

    **Inputs:**

    * **to** (optional, array of string) — Recipients.
    * **subject** (optional, string) — Subject.
    * **body** / **htmlBody** (optional, string) — Plain text or HTML body.
    * **threadId** (optional, string) — To reply in an existing thread.

    **Example:**

    ```json theme={null}
    {
      "to": ["client@example.com"],
      "subject": "Proposal (draft)",
      "body": "Hi, here is the proposal for review."
    }
    ```

    [Google documentation: `users.drafts.create`](https://developers.google.com/gmail/api/reference/rest/v1/users.drafts/create)
  </Accordion>

  <Accordion title="Create label">
    Creates a new label in the Gmail account.

    **Inputs:**

    * **name** (string) — Visible label name.
    * **messageListVisibility** / **labelListVisibility** (optional, string) — Visibility per Gmail API.

    **Example:**

    ```json theme={null}
    {
      "name": "Client / Priority",
      "messageListVisibility": "show",
      "labelListVisibility": "labelShow"
    }
    ```

    [Google documentation: `users.labels.create`](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.labels/create)
  </Accordion>

  <Accordion title="Delete email">
    Moves the message to **Trash** (not necessarily permanent deletion unless the tool states otherwise).

    **Inputs:**

    * **messageId** (string) — Message ID.

    **Example:**

    ```json theme={null}
    {
      "messageId": "188c9a0f12abcde3"
    }
    ```

    [Google documentation: `users.messages.trash`](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/trash)
  </Accordion>

  <Accordion title="Download attachment">
    Retrieves an attachment by **attachmentId** for a message (e.g. to save or process in the flow).

    **Inputs:**

    * **messageId** (string) — Message ID.
    * **attachmentId** (string) — Attachment ID returned by the API when listing or getting the message.

    **Example:**

    ```json theme={null}
    {
      "messageId": "188c9a0f12abcde3",
      "attachmentId": "ANGjdJ8..."
    }
    ```

    [Google documentation: `users.messages.attachments.get`](https://developers.google.com/gmail/api/reference/rest/v1/users.messages.attachments/get)
  </Accordion>

  <Accordion title="Find email">
    Searches messages using **Gmail search** (same syntax as the Gmail search bar).

    **Inputs:**

    * **query** (string) — Query (e.g. `from:sales@example.com is:unread`).
    * **maxResults** (optional, number) — Max results.

    **Example:**

    ```json theme={null}
    {
      "query": "from:sales@example.com subject:Invoice is:unread",
      "maxResults": 20
    }
    ```

    [Google documentation: `users.messages.list`](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/list)
  </Accordion>

  <Accordion title="Get send-as alias">
    Gets the configuration for one “Send mail as” alias for the authenticated user.

    **Inputs:**

    * **sendAsEmail** (string) — Alias address (must exist in send-as settings).

    **Example:**

    ```json theme={null}
    {
      "sendAsEmail": "sales@mycompany.com"
    }
    ```

    [Google documentation: `users.settings.sendAs.get`](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.settings.sendAs/get)
  </Accordion>

  <Accordion title="List labels">
    Lists all labels in the account (system and custom).

    **Inputs:**

    * Usually none required.

    **Example:**

    ```json theme={null}
    {}
    ```

    [Google documentation: `users.labels.list`](https://developers.google.com/gmail/api/reference/rest/v1/users.labels/list)
  </Accordion>

  <Accordion title="List send-as aliases">
    Lists all “Send mail as” addresses configured for the user.

    **Inputs:**

    * Usually none required.

    **Example:**

    ```json theme={null}
    {}
    ```

    [Google documentation: `users.settings.sendAs.list`](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.settings.sendAs/list)
  </Accordion>

  <Accordion title="List thread messages">
    Retrieves messages in a thread by **threadId**.

    **Inputs:**

    * **threadId** (string) — Thread ID.

    **Example:**

    ```json theme={null}
    {
      "threadId": "188c1234abcd5678"
    }
    ```

    [Google documentation: `users.threads.get`](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.threads/get)
  </Accordion>

  <Accordion title="Remove label from email">
    Removes one or more labels from a message.

    **Inputs:**

    * **messageId** (string) — Message ID.
    * **removeLabelIds** (array of string) — Label IDs to remove.

    **Example:**

    ```json theme={null}
    {
      "messageId": "188c9a0f12abcde3",
      "removeLabelIds": ["INBOX", "UNREAD"]
    }
    ```

    [Google documentation: `users.messages.modify`](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/modify)
  </Accordion>

  <Accordion title="Send email">
    Sends email from the connected account, with HTML, CC, BCC, and replies in a thread.

    **Inputs:**

    * **to** (array of string) — Recipients.
    * **subject** (string) — Subject.
    * **body** (string) — Plain text body when not using HTML only.
    * **htmlBody** (optional, string) — HTML body.
    * **mimeType** (optional, enum) — `text/plain` | `text/html` | `multipart/alternative`.
    * **cc** / **bcc** (optional, array of string)
    * **threadId** / **inReplyTo** (optional, string) — For replies in a thread.

    **Example:**

    ```json theme={null}
    {
      "to": ["recipient@example.com"],
      "subject": "Project update",
      "body": "Hi, here is the summary.",
      "htmlBody": "<p>Hi,</p><p>Here is the <strong>summary</strong>.</p>",
      "cc": ["lead@example.com"],
      "threadId": "188c1234abcd5678"
    }
    ```

    [Google documentation: `users.messages.send`](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/send)
  </Accordion>

  <Accordion title="Update organization email signature">
    Updates the signature for a specific address in an **organization** context. Often requires a **Google Cloud service account** with **domain-wide delegation** and admin permissions.

    **Inputs:**

    * **sendAsEmail** (string) — “Send mail as” address to update.
    * **signature** (string) — HTML or text signature content.
    * Other optional fields per API (`replyToAddress`, etc.).

    <Warning>
      This action is not available for every account. If it fails or is missing, confirm with your Google Workspace admin and Brain Studio support.
    </Warning>

    **Example:**

    ```json theme={null}
    {
      "sendAsEmail": "team@mycompany.com",
      "signature": "<p>Regards,<br/>Support team</p>"
    }
    ```

    [Google documentation: `users.settings.sendAs.update`](https://developers.google.com/gmail/api/reference/rest/v1/users.settings.sendAs/update)
  </Accordion>

  <Accordion title="Update primary email address signature">
    Updates the signature for the user’s **primary** sending address.

    **Inputs:**

    * **signature** (string) — Signature content (HTML as allowed by the API).
    * Additional parameters if the form shows them (e.g. default send-as identifier).

    **Example:**

    ```json theme={null}
    {
      "signature": "<p>--<br/>First Last<br/>Tel: +1 555 000 0000</p>"
    }
    ```

    [Google documentation: `users.settings.sendAs.update`](https://developers.google.com/gmail/api/reference/rest/v1/users.settings.sendAs/update)
  </Accordion>
</AccordionGroup>

***

## How to use in Brain

Once connected, you can use **Gmail** in two surfaces:

### In AI Agent

Ideal when users want to search, draft, reply to, or label email in natural language.

<Steps>
  <Step title="Open the AI Agent node">
    In Canvas, select or add the **AI Agent** node.
  </Step>

  <Step title="Open Tools">
    In the right panel, open the **Tools** tab.
  </Step>

  <Step title="Add Gmail">
    Use **Add tool**, search for **Gmail**, and enable it.
  </Step>

  <Step title="Configure tools">
    Choose the full integration or enable only the actions you need. Adjust the prompt to request recipient, subject, and body if missing; use draft and confirmation before **Send email** on sensitive messages; and use search, labels, or archive when users ask to organize the inbox.

    <Check>
      **Gmail** appears in the agent tools list and you can open its settings using the gear icon.
    </Check>
  </Step>
</Steps>

The agent will automatically decide when to search, draft, or send emails based on the conversation.

### In Canvas

Ideal when you need full flow control (for example: validate recipient → draft → confirm → send).

<Steps>
  <Step title="Drag Gmail into Canvas">
    In the side panel, open **Marketplace** and drag **Gmail** into the flow.
  </Step>

  <Step title="Select the tool">
    With the node selected, in **Tools** choose the action (for example **Send email**).
  </Step>

  <Step title="Configure request body and memory">
    Fill in the request body JSON and, if needed, **Save response** to a memory variable.
  </Step>

  <Step title="Connect the flow">
    Link the **Task completed** and **An error occurred** outputs to the next nodes.

    <Check>
      The node is ready to run in the order defined by your flow.
    </Check>
  </Step>
</Steps>

**Configuration example:**

The node editor shows a JSON body aligned with the **Send email** tool. Fields depend on the selected tool; this example covers a basic send using recipient, subject, and body from memory.

```json theme={null}
{
  "to": ["{{$memory.destination_email}}"],
  "subject": "{{$memory.subject}}",
  "body": "{{$memory.message}}",
  "cc": ["{{$memory.cc_email}}"]
}
```

***

## Use cases

<AccordionGroup>
  <Accordion title="Automatic sales follow-up after a conversation">
    The prospect shows interest over WhatsApp. Instead of an executive opening Gmail afterward, the flow sends the proposal or follow-up from the connected account in the same process.

    **Specific example:** a B2B agency receives leads through web chat. The prospect asks for pricing information. The agent collects email and needs, drafts a follow-up email with the proposal, and sends it via Gmail. The lead receives follow-up without depending on manual drafting. If review is required, the flow creates a draft first for executive approval.

    **Ideal for:** B2B sales, agencies, and SaaS with conversational lead generation where follow-up speed matters.
  </Accordion>

  <Accordion title="Formal escalation: from chat to email with full context">
    When a support conversation must move to formal email (due to internal policy, customer type, or traceability), the flow builds the message with case context and sends it without copy-paste.

    **Specific example:** a financial services company closes a support case via WhatsApp. The flow builds an email to [compliance@company.com](mailto:compliance@company.com) with subject, case summary, applied resolution, and ticket reference. The email thread remains as formal process backup.

    **Ideal for:** customer support, help desks, compliance, and onboarding processes requiring formal communication and traceability.
  </Accordion>

  <Accordion title="Inbox assistant for quick chat requests">
    An executive can ask on WhatsApp, "Do I have pending emails from Acme?" and the agent searches, summarizes, and even prepares a draft response.

    **Specific example:** an independent consultant with high email volume asks on WhatsApp while heading to a meeting: "What did the client reply about the budget?" The agent finds the thread by sender and subject, summarizes the latest response, and offers to draft an answer. The consultant approves and the email is sent without opening Gmail.

    **Ideal for:** professionals with high email volume, executives, and small teams operating from mobile.
  </Accordion>
</AccordionGroup>

***

## Integrations that combine well with Gmail

<AccordionGroup>
  <Accordion title="Google Calendar">
    After scheduling a meeting in Google Calendar, the flow can send a confirmation email with date, time, meeting link, and prep materials.

    **Combined flow:** event created in Google Calendar → email via Gmail to attendee with details and agenda.

    [Google Calendar documentation](/en/guides/integraciones/agendamiento/google-calendar)
  </Accordion>

  <Accordion title="Google Sheets">
    Each sent email can be logged in a spreadsheet as an operational log: recipient, subject, date, and status. Useful for sales follow-up or communication audits.

    **Combined flow:** email sent via Gmail → new row in Sheets with recipient, subject, and timestamp.

    [Google Sheets documentation](/en/guides/integraciones/productividad/google-sheets)
  </Accordion>

  <Accordion title="HubSpot">
    The flow can update the HubSpot contact or deal and send follow-up email from Gmail in the same process, aligning CRM and formal communication.

    **Combined flow:** deal updated in HubSpot → proposal email to contact via Gmail.

    [HubSpot documentation](/en/guides/integraciones/crm/hubspot)
  </Accordion>

  <Accordion title="Google Drive">
    When email needs an attachment that already exists in Drive (proposal, contract, report), the flow can find it, adjust permissions, and include the link in email without manual intervention.

    **Combined flow:** search file in Drive → generate shared link → send email with link via Gmail.

    [Google Drive documentation](/en/guides/integraciones/productividad/google-drive)
  </Accordion>
</AccordionGroup>

***

## Related articles

<CardGroup cols={2}>
  <Card title="Integrations" href="/en/guides/integraciones/integraciones" icon="grid">
    Catalog of integrations available in Marketplace.
  </Card>

  <Card title="How to use integrations in Brain" href="/en/guides/integraciones/como-usar-integraciones-en-brain" icon="book-open">
    General flow for installing and using integrations in Brain Studio.
  </Card>
</CardGroup>
