Gmail

Comprehensive guide to using the Gmail node in StackAI workflows, including available actions, required inputs, configurations, and output examples.

The Gmail Node in StackAI enables you to automate sending and managing emails directly through your Gmail account. This integration streamlines communication tasks, allowing you to trigger email actions within your automated workflows.


How to use it?

To use the Gmail node, connect your Gmail account using a valid connection ID. Choose the desired action (such as sending an email), provide the required input fields, and configure any optional settings. The node will execute the action and return the relevant output, which can be used in downstream workflow steps.


Example of Usage

Suppose you want to automatically send a notification email when a new lead is added to your CRM. You can set up a workflow where the Gmail node is triggered with the lead’s details, and an email is sent to your sales team.


Available Actions

Below are the most commonly used actions for the Gmail node in StackAI:


1. Send Email

Description: Send an email from your connected Gmail account to one or more recipients.

Inputs:

  • to (Required): The recipient’s email address or a list of addresses. Example: "to": "[email protected]" or "to": ["[email protected]", "[email protected]"]

  • subject (Required): The subject line of the email. Example: "subject": "Welcome to Our Service"

  • body (Required): The main content of the email. Example: "body": "Thank you for signing up!"

  • cc (Optional): Email addresses to be copied on the email. Example: "cc": "[email protected]"

  • bcc (Optional): Email addresses to be blind-copied on the email. Example: "bcc": "[email protected]"

  • attachments (Optional): List of file paths or file objects to attach. Example: "attachments": ["/path/to/file.pdf"]

Configurations:

  • connection_id (Required): The ID of your Gmail connection. Example: "connection_id": "5a56b86a-c7d3-4e6a-af3f-0969d00ff9f8"

Outputs:

  • message_id (Always returned): The unique ID of the sent email. Example: "message_id": "17c8b2e5e8b2c1a2"

  • status (Always returned): The status of the email send operation. Example: "status": "sent"


2. Search Emails

Description: Search for emails in your Gmail account using specific criteria.

Inputs:

  • query (Required): The search query string (Gmail search syntax). Example: "query": "from:[email protected] is:unread"

  • max_results (Optional): Maximum number of emails to return. Example: "max_results": 10

Configurations:

  • connection_id (Required): The ID of your Gmail connection.

Outputs:

  • emails (Always returned): A list of email objects matching the search criteria. Example:

    "emails": [
      {
        "subject": "Meeting Reminder",
        "from": "[email protected]",
        "date": "2025-07-07T10:00:00Z",
        "snippet": "Don't forget our meeting at 2pm."
      }
    ]

3. (Optional) Additional Actions

Other actions may be available, such as managing labels or retrieving email details. For most workflow automations, "Send Email" and "Search Emails" are the primary actions used.


Best Practices

  • Always use a valid Gmail connection ID from your available connections.

  • Ensure all required fields are provided for each action.

  • Use dynamic references (e.g., from previous nodes) to personalize email content or search queries.

  • Attachments should be properly formatted and accessible by the workflow.


Summary Table

Action
Required Inputs
Optional Inputs
Required Configurations
Outputs

Send Email

to, subject, body

cc, bcc, attachments

connection_id

message_id, status

Search Emails

query

max_results

connection_id

emails


Use the Gmail node in StackAI to automate your email workflows, streamline communication, and enhance productivity with seamless Gmail integration.

Last updated

Was this helpful?