Gmail Custom

Send email via Gmail API with token caching for service accounts

Gmail Custom

AI-generated

Summary

Send an email through the Gmail API using a Google service account and a delegated Google Workspace sender. Provide the required account credentials, sender, recipients, subject, message, and text or HTML format; optional settings add recipients, reply routing, a sender name, attachments from incoming binary fields, or an existing thread ID.

Inputs

  • Service Account Email (required) — Service account client email used to issue the JWT.
  • Private Key (required) — Service account RSA private key in PEM format.
  • From Email (required) — Google Workspace sender address; the service account must have domain-wide delegation for it.
  • To (required) — Recipient email addresses, separated by commas for multiple recipients.
  • Subject (required) — Email subject.
  • Email Type (required) — Choose Text or HTML. HTML messages are also converted to plain text by stripping tags.
  • Message (required) — Email body.
  • Options — Optional BCC and CC recipient lists, reply-to address, sender display name, and Gmail thread ID. Attachments can reference one or more comma-separated binary field names from the incoming item; missing fields or binary data that cannot be read are skipped.

Output shape

One output item per successfully processed input item, containing Gmail's send response in json and paired to the input item.

With no input items, returns an empty output list. If continue on fail is enabled, failed items instead contain json.error; otherwise an error is thrown. Access tokens are cached by service account and delegated sender.

Links

Discussion