logo_smallAxellero.io

Gmail

Send, search, and manage Gmail messages through the Gmail API in Axellero workflows.

Gmail Node

Send, search, and manage Gmail messages through OAuth2-authenticated Gmail API access in Axellero workflows.

Available Operations

  • Send: Send individual emails and bulk broadcasts with optional attachments
  • Search: Find messages using Gmail search syntax and filters
  • Retrieve: Get detailed message content and metadata
  • Manage: Organize messages with labels and read status management
  • Delete: Remove messages from Gmail

Connection Configuration

ParameterTypeRequiredDescription
accessTokenTEXTYesOAuth2 access token for Gmail API with required scopes
{
  "accessToken": "{{ctx.consts.GMAIL_ACCESS_TOKEN}}"
}

Operations

sendEmail

Send an email with optional CC/BCC recipients and HTML formatting.

ParameterTypeRequiredDescription
toTEXTYesRecipient email address (comma-separated for multiple)
subjectTEXTYesEmail subject line
bodyTEXTYesEmail body content (HTML or plain text)
ccTEXTNoCC recipients (comma-separated)
bccTEXTNoBCC recipients (comma-separated)
isHtmlBOOLEANNoWhether body content is HTML (default: false)
{
  "to": "recipient@example.com,another@example.com",
  "subject": "Project Update",
  "body": "<h2>Status Report</h2><p>Project is on track for delivery.</p>",
  "cc": "manager@company.com",
  "isHtml": true
}

listMessages

List emails with optional filters and search criteria.

ParameterTypeRequiredDescription
maxResultsINTNoMaximum number of messages to return (default: 10)
qTEXTNoGmail search query (e.g., 'is:unread', 'from:example@email.com')
labelIdsTEXTNoComma-separated label IDs to filter by
includeSpamTrashBOOLEANNoInclude spam and trash messages (default: false)
{
  "maxResults": 20,
  "q": "is:unread from:notifications@example.com",
  "labelIds": "INBOX,IMPORTANT",
  "includeSpamTrash": false
}

getMessage

Get detailed content of a specific email message.

ParameterTypeRequiredDescription
messageIdTEXTYesMessage ID to retrieve
formatTEXTNoFormat of the message (full, minimal, metadata, raw)
{
  "messageId": "{{ctx.vars.messageId}}",
  "format": "full"
}

searchMessages

Search emails with advanced query parameters and Gmail search syntax.

ParameterTypeRequiredDescription
queryTEXTYesGmail search query (supports Gmail search syntax)
maxResultsINTNoMaximum number of results (default: 10)
includeSpamTrashBOOLEANNoInclude spam and trash in results (default: false)
{
  "query": "has:attachment from:client@company.com newer_than:7d",
  "maxResults": 50,
  "includeSpamTrash": false
}

sendBroadcast

Send bulk emails to multiple recipients with batch processing.

ParameterTypeRequiredDescription
recipientsTEXTYesJSON array of recipient objects with email and optional name
subjectTEXTYesEmail subject line
bodyTEXTYesEmail body content (HTML or plain text)
isHtmlBOOLEANNoWhether body content is HTML (default: false)
batchSizeINTNoNumber of emails to send per batch (default: 10)
{
  "recipients": "[{\"email\":\"user1@example.com\",\"name\":\"User One\"},{\"email\":\"user2@example.com\",\"name\":\"User Two\"}]",
  "subject": "Monthly Newsletter",
  "body": "Your newsletter content here",
  "isHtml": false,
  "batchSize": 5
}

markAsRead

Mark one or more messages as read or unread.

ParameterTypeRequiredDescription
messageIdsTEXTYesComma-separated message IDs
readBOOLEANNoMark as read (true) or unread (false), default: true
{
  "messageIds": "{{ctx.vars.messageId1}},{{ctx.vars.messageId2}}",
  "read": true
}

deleteMessage

Delete one or more messages permanently from Gmail.

ParameterTypeRequiredDescription
messageIdsTEXTYesComma-separated message IDs to delete
{
  "messageIds": "{{ctx.vars.messageId1}},{{ctx.vars.messageId2}}"
}

addLabel

Add labels to one or more messages for organization.

ParameterTypeRequiredDescription
messageIdsTEXTYesComma-separated message IDs
labelIdsTEXTYesComma-separated label IDs to add
{
  "messageIds": "{{ctx.vars.messageId}}",
  "labelIds": "IMPORTANT,CATEGORY_PERSONAL"
}

removeLabel

Remove labels from one or more messages.

ParameterTypeRequiredDescription
messageIdsTEXTYesComma-separated message IDs
labelIdsTEXTYesComma-separated label IDs to remove
{
  "messageIds": "{{ctx.vars.messageId}}",
  "labelIds": "SPAM,CATEGORY_PROMOTIONS"
}

Workflow Integration

Use workflow context to construct dynamic email content:

{
  "to": "{{ctx.user.email}}",
  "subject": "Order Confirmation #{{ctx.vars.orderNumber}}",
  "body": "Hello {{ctx.user.name}}, your order for {{ctx.vars.productName}} has been confirmed.",
  "isHtml": false
}

Response Format

Success Response

{
  "success": true,
  "messageId": "gmail_msg_12345",
  "threadId": "thread_67890"
}

Error Response

{
  "success": false,
  "error": "Failed to send email: Invalid recipient"
}

Use Cases

  • Automated notifications: Send order confirmations and status updates
  • Email management: Organize and process incoming emails automatically
  • Bulk communications: Send newsletters and marketing campaigns
  • Customer support: Monitor and respond to support inquiries