Skip to main content
searchMessages searches a mailbox using the same query syntax as Gmail’s search box. It returns identifiers only, which keeps broad searches lightweight. Use Get message or Get messages when you need bodies, headers, or attachments.

Example

automations/find-unread-invoices.automation.ts

Inputs

Each input can also be a compatible Signal from an earlier trigger or action.

Output

Returns a Signal<MessageIdentifier[]>:
messageId identifies the individual email; threadId identifies the Gmail conversation containing it. Multiple results can share a threadId. The action fetches additional Gmail result pages internally until it reaches limit or exhausts the search.
Test complex queries in Gmail’s search box first. labelIds uses provider IDs such as INBOX or IDs returned by List labels; label names belong in query, for example label:Receipts.