Email actions
Reference for the Send Email, Gmail and Outlook actions: step types, connections, each action id, the fields each executor reads, outputs and an example.
Three blocks send email: Send Email (resend), Gmail (gmail) and Outlook (outlook). For the plain-language guide, see Email (Gmail, Outlook, Send Email).
| Block | Action ids | Step type | Connection |
|---|---|---|---|
| Send Email | resend.send | action | None. The worker's Resend API key sends it |
| Gmail | gmail.<operation> | gmail | Gmail (Google OAuth) |
| Outlook | outlook.<operation> | action | Outlook (Microsoft OAuth) |
To start a workflow from an inbound email, use the email trigger; see Inbound email trigger. Gmail and Outlook have no trigger.
Send Email
resend.send is the block's only action. It needs no connection.
| Field | Studio label | Type | Notes |
|---|---|---|---|
to | To | string or string[] | Required |
subject | Subject | string | Required |
body | Body | object | { "html": "..." }, { "text": "..." } or both. Required in practice |
layout | Email layout | branded or none | branded (default) wraps body.html in the Loopfour email template unless it is already a complete HTML document. body.text is not wrapped |
cc, bcc | CC, BCC | string[] | Must be arrays |
reply_to | – | string | Reply-to address |
from | – | string | Sender. Defaults to onboarding@resend.dev |
attachments | – | array | { filename, content, content_type? }, content base64 |
The executor reads body.html and body.text only, so a plain string body sends no message text. A string cc or bcc fails the step, and the Studio field replyTo is not read; use reply_to. Studio saves the Body field as a string, so steps built in Studio send a subject with no body. The overdue invoice template writes body as an object and sets from.
Output: the Resend response, { "id": "..." }.
Gmail
Write Gmail steps as "type": "gmail" and put the operation in config.action, for example "action": "searchEmails". The top-level action (gmail.searchEmails) is what workflow validation checks. A "type": "action" step fails at run time for searchEmails, getEmail and replyToEmail, because the runtime maps those names to listMessages, getMessage and replyToThread only inside the Gmail step type.
| Action id | Studio label | What it does |
|---|---|---|
gmail.sendEmail | Send Email | Send an email. |
gmail.searchEmails | Search Emails | Search the mailbox with Gmail search syntax. |
gmail.getEmail | Get Email | Read one email. With hashAttachments, return a SHA-256 for each attachment instead of the file. |
gmail.createDraft | Create Draft | Create a draft. |
gmail.replyToEmail | Reply to Email | Reply in the email's thread. |
gmail.forwardEmail | Forward Email | Forward an email, with its attachments by default. |
gmail.downloadAttachments | Download Attachments | Return an email's attachments as base64 content. |
gmail.archiveEmail | Archive Email | Archive a message by removing it from the Inbox without deleting it. |
gmail.markRead | Mark as Read | Mark a message as read by removing the UNREAD label. |
gmail.markUnread | Mark as Unread | Mark a message as unread by adding the UNREAD label. |
gmail.modifyLabels | Add or Remove Labels | Add or remove labels, creating missing ones by default. |
gmail.listLabels | List Labels | List every system and user label in the mailbox, with its ID, name, and type. |
gmail.createLabel | Create Label | Create a label. |
gmail.deleteLabel | Delete Label | Delete a label. |
| Field | Studio label | Type | Used by | Required for |
|---|---|---|---|---|
connection | Gmail Account | string (connection id) | All | Optional. Without it the step uses the company default connection for this system |
to | To | string | sendEmail, createDraft, replyToEmail, forwardEmail | |
subject | Subject | string | sendEmail, createDraft | |
body | Body | string | sendEmail, createDraft, replyToEmail, forwardEmail | |
cc | CC | string | sendEmail, createDraft, forwardEmail | |
bcc | BCC | string | sendEmail, createDraft, forwardEmail | |
searchQuery | Search Query | string | searchEmails | |
messageId | Message ID | string | getEmail, replyToEmail, forwardEmail, downloadAttachments, archiveEmail, markRead, markUnread, modifyLabels | |
includeAttachments | Include Original Attachments | boolean | forwardEmail | |
includeInline | Include Inline Images | boolean | downloadAttachments | |
hashAttachments | Return Hashes Instead of Attachments | boolean | getEmail | |
addLabels | Add Labels | string | modifyLabels | |
removeLabels | Remove Labels | string | modifyLabels | |
createMissingLabels | Create Missing Labels | boolean | modifyLabels | |
labelName | Label Name | string | createLabel, deleteLabel | |
maxResults | Max Results | number | searchEmails |
Fields each action reads
searchQueryis passed to Gmail asq; either name works.maxResultsandpageTokenpage the results.ccandbccaccept an array or a comma-separated string.sendEmailandcreateDraftneedto,subjectandbody(plain text) orhtmlBody. They also readfrom,replyToandattachments.replyToEmailneedsthreadId,toandbodyorhtmlBody;messageIdsets the In-Reply-To header. Studio has nothreadIdfield, so a reply built only in Studio fails withthreadId is required. ReadthreadIdfrom agetEmailorsearchEmailsresult.forwardEmailneedsmessageIdandto.bodyis a note above the forwarded email. Attachments are included by default (includeAttachments), up to 15 MiB in total.downloadAttachmentsreturns the attachments as base64, up to 3 MiB in total.includeInlineadds inline images.getEmailwithhashAttachments: truereturns the full message with anattachmentHasheslist (sha256:<hex>per attachment) and the file data removed.modifyLabelstakesaddLabelsandremoveLabelsas label names or ids, and creates missing labels unlesscreateMissingLabelsis false.
Output
Each action returns the Gmail API response. searchEmails returns messages (each { id, threadId }), nextPageToken and resultSizeEstimate; read the content with getEmail.
Outlook
Write Outlook steps as "type": "action" with "action": "outlook.<operation>".
| Action id | Studio label | What it does |
|---|---|---|
outlook.sendEmail | Send Email | Send an email. |
outlook.listMessages | Search Emails | Search or list messages. |
outlook.getMessage | Get Email | Read one email. |
outlook.createDraft | Create Draft | Create a draft. |
outlook.replyToThread | Reply to Email | Reply to an email. |
| Field | Studio label | Type | Used by | Required for |
|---|---|---|---|---|
connection | Outlook Account | string (connection id) | All | Optional. Without it the step uses the company default connection for this system |
to | To | string | sendEmail, createDraft | |
subject | Subject | string | sendEmail, createDraft | |
body | Body | string | sendEmail, createDraft, replyToThread | |
cc | CC | string | sendEmail, createDraft | |
searchQuery | Search Query | string | listMessages | |
messageId | Message ID | string | getMessage, replyToThread | |
maxResults | Max Results | number | listMessages |
Fields each action reads
Some Outlook keys have a second name, and some have no Studio field:
| Action | Studio field | Executor reads |
|---|---|---|
listMessages | searchQuery, maxResults | search or searchQuery (Graph $search), top or maxResults, filter (OData $filter), skip, orderBy, select, folderId |
sendEmail, createDraft | cc | cc and bcc as an array or a comma-separated string |
replyToThread | None | additionalTo (an array or a comma-separated string); replyAll: true replies to all |
When both names are set, search and top win over searchQuery and maxResults. top must be a positive whole number (a numeric string such as "5" works), and a value above 1,000 is sent as 1,000. skip must be a whole number of 0 or more. Any other value fails the step before Outlook is called. sendEmail and createDraft need to, subject and body (plain text) or htmlBody; sendEmail also reads replyTo, importance (low, normal, high) and attachments ({ name, contentBytes, contentType }).
Output
listMessages and getMessage return the Microsoft Graph response.
Legacy email step
Older workflows use "type": "email" with config.action set to send, send_template or schedule and config.provider set to gmail, outlook or resend (default gmail). The block is hidden from the Studio palette. It takes the same fields as Send Email above, with cc and bcc as arrays. New workflows should use the blocks above.
Example
Find this morning's vendor statement in the AP mailbox, read it, and email the team a short notice.
{
"name": "Vendor statement notice",
"trigger": { "type": "schedule", "cron": "0 8 * * 1-5", "timezone": "America/Los_Angeles" },
"steps": [
{
"id": "find_statement",
"type": "gmail",
"name": "Find the statement",
"action": "gmail.searchEmails",
"config": {
"action": "searchEmails",
"searchQuery": "from:statements@vendor.example has:attachment newer_than:1d",
"maxResults": 1
}
},
{
"id": "read_statement",
"type": "gmail",
"name": "Read the statement",
"action": "gmail.getEmail",
"config": {
"action": "getEmail",
"messageId": "{{steps.find_statement.messages.0.id}}"
}
},
{
"id": "notify_team",
"type": "action",
"name": "Tell the AP team",
"action": "resend.send",
"config": {
"to": ["ap@yourcompany.example"],
"subject": "Vendor statement received",
"body": { "text": "A vendor statement arrived: {{steps.read_statement.snippet}}" },
"from": "workflows@yourcompany.example"
}
}
]
}Live catalog
GET /api/v1/blocks/resend,GET /api/v1/blocks/gmailandGET /api/v1/blocks/outlookreturn the actions and fields.GET /api/v1/blocks/<type>/actions/<operation>/examplesreturns stored input and output examples where they exist.
Errors and limits
- Gmail and Outlook fail the step with the provider's message, such as
to is requiredor a Google or Microsoft API error. - Send Email fails with
Resend API error (<status>): ...when Resend refuses the email, for example afromdomain that is not verified. - Gmail declarative actions (
archiveEmail,markRead,markUnread,listLabels) have a 30-second limit per call.
Dropbox Sign actions
Reference for the Dropbox Sign actions: the sign-in connection, each action id, the fields each executor reads, outputs and a complete example.
Google Sheets actions
Reference for the Google Sheets actions: the Google connection, each action id, A1 ranges, value input options, row upserts, outputs and an example.
Loopfour