Email Action

Send email notifications automatically after a webhook delivery succeeds, fails, or on every attempt. Templates support Handlebars interpolation with full access to the event payload and delivery response.

Overview

The Email Action node is a post-delivery action that fires after an webhook processes an incoming webhook event. It renders an email from a configurable template and sends it to one or more recipients. The node appears on the canvas with a rose/pink color.

Event received--▶Webhook delivery--▶Email Action fires

Configuration

The following fields configure an Email Action node.

FieldTypeRequiredDescription
namestringYesFriendly label for the email action
tostringYesRecipient email address. Supports template strings.
subjectstringYesEmail subject line. Supports Handlebars templates.
bodystringYesEmail body (HTML). Supports {{payload.*}}, {{response.status}}, {{response.body.*}}.
attachmentsstringNoShown as Files from the payload. A payload path to the files to attach — see Attachments.
triggerOnstringNosuccess, failure, or always. Default: success.
inputNodes{ nodeType, nodeId }[]YesUpstream nodes that feed this one
isActivebooleanNoEnable or disable without deleting. Default: true.

⚠An HTML template escapes what it inserts. Every {{ }} in an HTML body comes out as text, so a value from the payload can't add tags or links to your email. To insert HTML you trust, add | raw — for example, the HTML an AI Node wrote: <div>{{$("AI").aiResponse | raw}}</div>. Plain-text bodies don't change.
ℹLinks go out only as http, https or mailto. A link with any other scheme (javascript:, data:, tel:…) becomes #. Images and other sources (src) take only http and https.

Attachments

The email can carry files the flow already has — what a webhook received, what a Drive node downloaded, what a trigger attached. You don't upload anything here: in Email Configuration, fill Files from the payload with a payload path, the same way the Gmail node does.

  • {{payload}} — every file the payload carries, wherever it sits.
  • {{payload._files}} — what a webhook trigger received.
  • {{payload._file}} — one file, for example what an HTTP Request or a Drive download produced.
  • {{payload.files}} — what a Drive list returned with Auto-download on.

Up to 5 files and 25 MB in total per email. More than that, or a file that doesn't belong to your organization, stops the email with an error that says why — it never goes out half-attached. A path that holds no files is not an error: the email goes out without attachments.


Create an Email Action

Send a POST request to create a new email action.

bashCreate Email Action
curl -X POST /api/email-actions \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "workspaceId": "<your-workspace-id>",
    "name": "Order Confirmation Email",
    "to": "{{payload.customer.email}}",
    "subject": "Order #{{payload.order.id}} confirmed",
    "body": "<h1>Thank you, {{payload.customer.name}}!</h1><p>Your order #{{payload.order.id}} totaling {{payload.order.total}} USD has been confirmed.</p><p>Delivery status: {{response.status}}</p>",
    "triggerOn": "success",
    "inputNodes": [{ "nodeType": "webhook", "nodeId": "6642f1a2c3b4d5e6f7890123" }],
    "isActive": true
  }'

Response

json201 Created
{
  "_id": "6642f2b3d4e5f6a7b8901234",
  "name": "Order Confirmation Email",
  "to": "{{payload.customer.email}}",
  "subject": "Order #{{payload.order.id}} confirmed",
  "body": "<h1>Thank you, {{payload.customer.name}}!</h1>...",
  "triggerOn": "success",
  "inputNodes": [{ "nodeType": "webhook", "nodeId": "6642f1a2c3b4d5e6f7890123" }],
  "isActive": true,
  "organizationId": "6640a1b2c3d4e5f6a7890001",
  "createdAt": "2025-05-14T10:30:00.000Z",
  "updatedAt": "2025-05-14T10:30:00.000Z"
}

Update an Email Action

Use PATCH to update specific fields without replacing the entire resource.

bashUpdate Email Action
curl -X PATCH /api/email-actions/6642f2b3d4e5f6a7b8901234 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "triggerOn": "always",
    "subject": "[{{response.status}}] Order #{{payload.order.id}}"
  }'

Response

json200 OK
{
  "_id": "6642f2b3d4e5f6a7b8901234",
  "name": "Order Confirmation Email",
  "to": "{{payload.customer.email}}",
  "subject": "[{{response.status}}] Order #{{payload.order.id}}",
  "body": "<h1>Thank you, {{payload.customer.name}}!</h1>...",
  "triggerOn": "always",
  "inputNodes": [{ "nodeType": "webhook", "nodeId": "6642f1a2c3b4d5e6f7890123" }],
  "isActive": true,
  "organizationId": "6640a1b2c3d4e5f6a7890001",
  "createdAt": "2025-05-14T10:30:00.000Z",
  "updatedAt": "2025-05-14T11:00:00.000Z"
}

Looking for Gmail?

Gmail used to live here as a provider setting. It is now its own node, with seventeen operations, its own Google credential and the AI toolkit: see Gmail. Existing nodes moved over automatically, keeping their credential and configuration.

Email Action sends through Resend and does one thing: render a template and deliver it. No mailbox, no threads, no labels — and no credential to connect.


Canvas Integration

On the visual canvas, the Email Action node uses the type email-action and is rendered with a rose/pink color scheme. Connect it to any webhook node to trigger emails after deliveries.

The node displays the action name, the recipient address, and the current trigger mode. Edges from webhooks flow into the email action node, indicating the post-delivery relationship.

✦You can attach multiple Email Action nodes to a single webhook to send different emails based on different trigger modes (e.g., one for success, another for failure).

Payload Examples

Incoming Webhook Payload

jsonEvent payload
{
  "type": "order.completed",
  "customer": {
    "name": "Jane Doe",
    "email": "jane@example.com"
  },
  "order": {
    "id": "ORD-9821",
    "total": 149.99,
    "items": [
      { "sku": "WIDGET-01", "qty": 3 },
      { "sku": "GADGET-05", "qty": 1 }
    ]
  }
}

Rendered Email

htmlRendered output
Subject: Order #ORD-9821 confirmed

<h1>Thank you, Jane Doe!</h1>
<p>Your order #ORD-9821 totaling 149.99 USD has been confirmed.</p>
<p>Delivery status: 200</p>

Template Variables Available

VariableDescription
{{payload.*}}Any field from the original webhook event payload
{{response.status}}HTTP status code from the webhook delivery
{{response.body.*}}Parsed JSON body from the webhook response

Use Cases

Order Confirmation Emails

Attach an email action to your payment processing webhook. When a payment webhook is delivered successfully, send the customer an order confirmation with their order details pulled from the payload.

Failure Notifications to Engineering

Set triggerOn to failure and send an alert to your engineering team whenever a delivery fails. Include the response status and body for debugging context.

Audit Trail Emails

Use triggerOn: always to send an email on every delivery attempt, creating a simple email-based audit trail of all webhook activity for compliance purposes.

ℹEmail actions are idempotent per event — even with triggerOn: always, the email is sent at most once per event. Delivery retries do not re-send.

API Reference

MethodWebhookDescription
GET/api/email-actionsList all email actions for your organization
POST/api/email-actionsCreate a new email action
GET/api/email-actions/:idGet a single email action by ID
PATCH/api/email-actions/:idUpdate an email action
DELETE/api/email-actions/:idDelete an email action
⚠Each email this node sends counts as one event toward your plan's weekly events.