Contents

Gmail Trigger

gmail_trigger · Nodes · Google · Trigger

Starts a workflow from Gmail events.

Gmail Trigger#

Overview#

Starts a workflow when new Gmail messages match the configured search.

This node appears in the google catalog category because that is the provider grouping. It is a trigger through node metadata. It has no input sockets and emits one event on the output socket.

Delivery is at-least-once. Downstream workflows should dedupe by message_id.

Configuration#

Field Description
connection Google OAuth connection id ULID from list_connections. Use the returned id, not the display name.
query Gmail search query. Empty query matches messages selected by labels.
label_ids Gmail label IDs to filter by. Defaults to INBOX.

Output#

Socket: output

On success, the output remains the existing Gmail event data shape:

Field Type Description
message_id string Gmail message ID.
thread_id string Gmail thread ID.
received_at string RFC3339 timestamp from Gmail internalDate.
snippet string | null Gmail-provided message preview.
label_ids string[] Gmail label IDs on the message.
from string | null Sender header value.
to string[] Recipient header values.
cc string[] CC recipient header values.
subject string | null Subject header value.
date string | null Date header value.
body_text string | null Decoded text/plain MIME body when present.
body_html string | null Decoded text/html MIME body when present.

body_text and body_html are decoded from Gmail MIME parts when present and may be null. Attachments and attachment bytes are not included.

Runtime Errors and Notes#

  • Polling runs periodically, so delivery can lag message arrival.
  • Each new matching message starts one run, in the order Gmail reported them, including messages that arrive while earlier runs are still going.
  • The first poll records current state and skips existing matching mail.
  • Invalid or missing Google connections prevent subscription. Use list_connections and set connection to the returned id ULID.
  • Missing Gmail scopes cause Google API authorization errors.
  • Polling and authorization errors start a workflow execution that fails at the trigger node through the normal workflow error pipeline.
  • Use Gmail action nodes for historical backfills, labels, archive, or read-state changes.

Inputs

None.

Outputs

  • output

Configuration

FieldTypeRequiredDescription
connectionconnection(google)YesGoogle connection to use
querystringNoGmail search query (e.g., 'is:unread from:example@gmail.com')
label_idsarray<string>NoGmail label IDs to filter by
base_configrecordNoShared node configuration. failure_mode decides what a failure of this node does to the workflow; leave it at the default stop unless the workflow handles the failure itself on the node's error output (route_to_error) or the node is a rare emergency kill switch (stop_workflow).