Google Gmail Message
Google Gmail Message is a component that lets you send, read, update, delete, reply to, and mark Gmail messages directly from the Nappai dashboard. It connects to your Gmail account through a secure GMail credential and uses the Gmail API to perform the requested action.
How it Works
When you add this component to a workflow, you first choose a GMail credential that you have set up in Nappai’s credentials section. The component then talks to Google’s Gmail API.
- Send Message builds an email with the fields you provide (recipient, subject, body, attachments, etc.) and posts it to Gmail.
- Get Message pulls emails that match your query or label, optionally downloading attachments and extracting text from PDFs, DOCX files, or images if OCR is enabled.
- Update Message Label changes the labels on a specific email.
- Delete Message removes an email from your mailbox.
- Reply Message sends a reply to an existing email.
- Realize Message Marks adds a mark (label) to an email.
All actions are performed through authenticated API calls, so no sensitive data is stored in Nappai.
Operations
This component offers several operations that you can select based on what you need to do. You can only use one operation at a time:
- Send Message: Send a new email to one or more recipients.
- Get Message: Retrieve one or more emails that match a query or label.
- Update Message Label: Change the labels on a specific email.
- Delete Message: Remove an email from your mailbox.
- Reply Message: Send a reply to an existing email.
- Realize Message Marks: Add a mark (label) to an email.
To use the component, first select the operation you need in the Operation field.
Inputs
Mapping Mode
This component has a special mode called Mapping Mode. When you enable this mode using the toggle switch, an additional input called Mapping Data is activated, and each input field offers you three different ways to provide data:
- Fixed: You type the value directly into the field.
- Mapped: You connect the output of another component to use its result as the value.
- Javascript: You write Javascript code to dynamically calculate the value.
This flexibility allows you to create more dynamic and connected workflows.
Input Fields
The following fields are available to configure this component. Each field may be visible in different operations:
-
Attachments: Attachments for email. It will used the Binary Component to upload the files.
- Visible in: Send Message
-
Operation: Choose the action you want to perform.
- Visible in: Send Message, Get Message, Update Message Label, Delete Message, Reply Message, Realize Message Marks
-
Body: Body for email. Here you write the text that will be used as the body of the email.
- Visible in: Send Message
-
Save as draft.: Save email as draft.
- Visible in: Send Message
-
Enable OCR: Requires both ‘Fetch Attachments’ and ‘Process Attachments’. If enabled, applies OCR to extract text from image attachments (e.g., PNG, JPG) during processing. If disabled, text will not be extracted from images.
- Visible in: Get Message
-
Fetch Attachments: Download attachments found in the emails. If disabled, attachments will be ignored. This is required for processing attachments.
- Visible in: Get Message
-
Labels: Labels to filter emails. In modify label, previous labels will be removed except by draft and sent.
- Visible in: Get Message, Update Message Label
-
Email Id.: If of the email. If not provided in get messages, it will return all the messages.
- Visible in: Get Message, Update Message Label, Delete Message, Reply Message, Realize Message Marks
-
Mapping Mode: Enable mapping mode to process multiple data records in batch.
- Visible in: Send Message, Get Message, Update Message Label, Delete Message, Reply Message, Realize Message Marks
-
Select Mark: Select the mark that you want to put on the message.
- Visible in: Realize Message Marks
-
Number of Emails to read: Number of emails to read. If left empty, it will read by default 10 emails.
- Visible in: Get Message
-
Process Attachments: Requires ‘Fetch Attachments’. If enabled, attempts to extract text content from supported downloaded attachments (e.g., PDF, DOCX). If disabled, attachments are fetched but not processed for text.
- Visible in: Get Message
-
Query: Query to filter emails. With this query you can filter the emails that you want to read in dependency if the message contain the query.
- Visible in: Get Message
-
Recipient: The email address of the recipient.
- Visible in: Send Message
-
Reply Text: Text to reply to the email.
- Visible in: Reply Message
-
Subject: The subject that will be used for the email.
- Visible in: Send Message
-
Tool Name: The name of the tool that will be used when this component is connected as a tool. This name will be displayed to the agent when it selects tools to use.
- Visible in: Send Message, Get Message, Update Message Label, Delete Message, Reply Message, Realize Message Marks
-
Tool Description: A detailed description of what this tool does. This description will help the agent understand when and how to use this tool effectively.
- Visible in: Send Message, Get Message, Update Message Label, Delete Message, Reply Message, Realize Message Marks
-
Tools arguments metadata: Defines the arguments metadata for the tools.
- Visible in: Send Message, Get Message, Update Message Label, Delete Message, Reply Message, Realize Message Marks
Credential
This component requires a GMail credential.
- Configure a GMail credential in the Nappai credentials section.
- Select that credential in the Credential field of this component.
The credential contains your Client Id, Client Secret, and Google Drive access settings.
Outputs
- Data: The raw data returned from the Gmail API (e.g., email details, attachment metadata).
- Tool: A tool representation that can be used by Nappai agents.
Usage Example
Sending an Email
- Drag the Google Gmail Message component onto the canvas.
- Set Operation to Send Message.
- Fill in Recipient, Subject, and Body.
- (Optional) Add Attachments by connecting a Binary component.
- Choose whether to Save as draft.
- Click Run.
The component will send the email and return the message ID in the Data output.
Retrieving Emails with OCR
- Drag the component onto the canvas.
- Set Operation to Get Message.
- Set Number of Emails to read to 5.
- Enable Fetch Attachments and Process Attachments.
- Enable Enable OCR to extract text from image attachments.
- (Optional) Set a Query like
subject:"Report"
to filter. - Click Run.
The component returns the email data, attachment metadata, and extracted text in the Data output.
Related Components
- Google Gmail Label – Manage Gmail labels.
- Google Drive File – Upload or download files from Google Drive.
- Binary – Handle file uploads and downloads.
Tips and Best Practices
- Use Mapping Mode when you need to process many emails at once (e.g., batch replies).
- Keep Email Id. short and specific to avoid pulling too many messages.
- Enable Enable OCR only when you need text from images; it adds extra processing time.
- Use Labels to quickly filter inboxes and keep your mailbox organized.
- Store sensitive credentials in Nappai’s credential store; never hard‑code them in workflows.
Security Considerations
- Credentials are stored encrypted in Nappai and are never exposed in logs.
- The component uses OAuth 2.0 to authenticate with Gmail, ensuring that only the permissions granted by the user are used.
- When enabling Enable OCR, be aware that image data is sent to Google’s OCR service; ensure compliance with your data‑privacy policies.