Gmail Tool


Introduction

The Gmail Tool brings Gmail functionality directly into your AgenThink workspace. You can send, read, label, forward, and manage emails without switching apps or writing code.

Why this matters

Automate email tasks within your Thinkflows to save time, reduce manual effort, and maintain organization within your Thinkflows.

Who should use this tool?

Creators, teams, daily users, and businesses that want to integrate Gmail into their automated flows.


Prerequisites

Before you begin, make sure you have:

  • A valid Gmail account.
  • An active AgenThink account.
  • Gmail API credentials from Google Cloud Console.
Warning

Warning: You cannot connect Gmail to AgenThink without valid Gmail API credentials.


Accessing the Gmail Tool

  1. Sign in to your AgenThink account.
  2. In the top-right corner, open your profile menu and switch to the Creator role.
  3. From the dashboard, select Agentic Playground.
  4. Under Thinkflows, choose one of the following options:
  • Custom Flow: Create a new Thinkflow and manually add the Gmail Tool.
  1. Click Add Components.
  2. In the search box, type Gmail Tool.
  3. Drag and drop the Gmail Tool onto the canvas.
Info

Note: You can quickly find and add most tools through the Add Components menu.


Connecting Gmail to AgenThink

Step 1: Enable the Gmail API

  1. Go to Google Cloude Console.
  2. Sign in with your Gmail account.
Description
  1. In the search bar, type Gmail API.
  2. Select Gmail APIEnable.
Description
Warning

Caution: Ensure you enable the API for the correct Google project linked to your AgenThink Thinkflow.


  1. After you enable the Gmail API, Google Cloud Console redirects you to the Credentials page.
Description
  1. On the warning callout, select Configure consent screen.
  2. On the OAuth Overview page, click Get Started.
Description
  1. The Project Configuration page appears.
Description
  1. Fill in the App Information:
  • App name
  • User support email
  1. Under Audience, select ExternalNext.
Description
  1. Under Contact Information, enter your email address → Next.
  2. In the Finish section, select the check box to agree to the Google API Services: User Data Policy.
Description
  1. Click ContinueCreate.
  2. The system redirects you to the OAuth Overview page.
Info

Note: Google requires you to complete the consent screen setup before creating OAuth credentials.


Step 3: Create OAuth Credentials

  1. In the search bar, type Credentials and open the page.
  2. Select Create Credentials, select OAuth Client ID.
Description
  1. Under Application type, select Web application.
Description
  1. Switch to the AgenThink platform:
  • Open the Gmail Tool Flow.
  • In the Google Credentials section, select Create New Credential.
  • Copy the Redirect URL from the AgenThink pop-up.
DescriptionDescription
  1. Return to Google Cloud Console and paste the copied URL under Authorized Redirect URLs.
Description
  1. Click Create.
  2. Copy the Client ID and Client Secret from the confirmation pop-up.
  3. Download the credentials JSON file and store it securely on your local system.
Info

Security Tip: Never share your credentials JSON file. Store it securely to prevent unauthorized access.

Description

Step 4: Add Test Users

From the Credentials page:

  1. Under OAuth 2.0 Client IDs, select your Web client.
Description
  1. In the left navigation, select Audience.
Description
  1. In the Test Users section, click + Add users.
  2. Enter the Gmail address you want to authorize and select Save.
Description

Step 5: Configure Gmail Tool in AgenThink

  1. Open the Gmail Tool flow in AgenThink.
  2. In the Google Credentials section, select Create New Google Credentials.
  3. Paste your Client ID, Client Secret, and enter the display name.
  4. Click Save.
Description
  1. Select only the required Gmail scopes (e.g., Send Mail).
  2. Click Save.
DescriptionDescription

Step 6: Authenticate Gmail

  1. In the Gmail Tool, click Authenticate.
  2. A Google login pop-up appears. Sign in with your Gmail account.
  3. Review and accept the requested permissions.
  4. Click ContinueSave.
Description

Verifying Gmail Tool in a Thinkflow

  1. Connect the Gmail Tool output port to the input port of the LLM component (e.g., OpenAI Tool).
  2. In the OpenAI Tool:
  • Add your API key
  • Provide an Input prompt (e.g., “Get my profile”)
  1. Connect the OpenAI output port (messages) to the input port of a Chat component.
Description
  1. In the Gmail Tool, select the operation you want (e.g., Get Profile) from the dropdown.
  2. Click SaveAuto SaveDeployRun.
  3. The My Chats window will display the Gmail operation result.
Description