Skip to navigation

Resend (email sending)

Runtype sends email through Resend. The Send Email Flow step and the Send Email built-in tool (builtin:send_email) both use it. You can send from a platform-managed address without a Resend account, or connect your own Resend account to send from your own domain.

Choose a sender

The from value decides which sender and which Resend account a message uses:

from valueSends asResend account
BlankFLOW_ID@runtype.email from a Flow step, or AGENT_ID@runtype.email from an AgentThe Runtype platform account
An address on a domain that you ownThe address that you enter, such as team@example.comYour Resend account

In these addresses, FLOW_ID is the ID of the Flow that sends the email, and AGENT_ID is the ID of the Agent that calls the tool. A Flow that you send inline in a dispatch request, without saving it, sends as virtual@runtype.email. The only exception is a request whose flow.id names a Flow in your account, which sends as that Flow’s ID.

The platform-managed sender needs no setup. Runtype tracks each platform-managed send as platform-key spend. For how platform-key spend is billed and limited, see Platform keys vs. BYOK.

A custom sender can’t use the runtype.email domain. Messages from a blank from always go through the Runtype platform account, even after you connect your own Resend key.

Connect your Resend account

Before you begin, make sure that you have the following:

  • A Resend account with a domain that Resend has verified. Resend rejects messages from an unverified domain.
  • A Resend API key.
  • A Runtype plan that includes BYOK, which is the Team plan or higher.

To connect your Resend account, follow these steps:

  1. In Runtype, go to Settings > Integrations.
  2. Find the Email section.
  3. In Resend API Key, enter your key.
  4. Click Save Key.

After you save, the Email section confirms that your key is configured. To disconnect your account, click Remove Key. After you remove the key, only the platform-managed sender works.

Send from your domain in a Flow

To send from your own address in a Flow, follow these steps:

  1. Add a Send Email step.
  2. In from, enter an address on your verified domain. You can use variables, for example {{sender}}.
  3. In Send email to, subject, and HTML, enter the recipients, the subject, and the body.

The from field is read-only until you connect a Resend key. When it’s blank, the step shows the default sender {{_flow.id}}@runtype.email.

In a Flow definition, set from in the step’s config:

Send Email step with a custom sender
{
"type": "send-email",
"name": "Send digest",
"config": {
"from": "team@example.com",
"to": "{{customerEmail}}",
"subject": "Your weekly digest",
"html": "<p>{{summary}}</p>",
"outputVariable": "digestEmail"
}
}

After a successful send, the step writes an object with id, from, to, subject, status, and timestamp to its output variable. The id is the Resend email ID.

By default, a failed Send Email step doesn’t stop the Flow. It writes { "status": "failed", "error": "..." }, or the step’s default value, to the output variable. To stop the Flow instead, change the step’s error handling. For details, see Flow step types overview.

Send from your domain in an Agent

To let an Agent send email, add Send Email (builtin:send_email) to the Agent’s tools. The model sets the from parameter. When the model leaves from blank, the tool uses the platform-managed sender. For the full parameter list, see Send Email.

To send from your own domain every time, tell the Agent which address to use in its instructions. For example: Send all email from support@example.com.

The tool sends real email. To pause the Agent until a person approves each send, add builtin:send_email to the Agent’s approval list. For the setting, see Require approval for tools that act for you.

Reply from an Email Surface through Resend

An Email Surface can send its replies through your Resend account instead of the Runtype platform account. This setting uses its own key, separate from the key in Settings > Integrations.

To set it up, follow these steps:

  1. Open the Email Surface’s settings, and then open the Inbound tab.
  2. In Email Provider, select Resend.
  3. In API Key, enter a Resend API key. To receive email through Resend, the key needs the Full access permission.
  4. In From Address, enter an address on your verified domain.
  5. Optional: In From Name, enter the sender name that recipients see, such as Support Team.

To go back to the platform account, select Runtype Email in Email Provider.

Troubleshooting

The following table lists common errors. In the table, STATUS is the HTTP status code that Resend returns. A Flow step adds the prefix Failed to send email: when its error handling stops the Flow. The Agent tool adds the prefix send_email failed:.

ErrorCauseFix
A custom email provider key is required for custom sender addressesThe from value is a custom address, and no Resend key is connected.Connect your Resend key in Settings > Integrations, or leave from blank.
Custom sender addresses cannot use the managed @runtype.email domainThe from value is a custom address on runtype.email.Use an address on your own domain, or leave from blank.
Platform key spend credit is exhaustedfrom is blank, and your platform-key credit balance is used up.Set a default payment method in Billing, or send from your own domain with your Resend key.
Resend API error: STATUS - ...Resend rejected the request. For example, the sender domain isn’t verified, or the key is invalid.Verify the domain and check the key in the Resend dashboard.
Failed to save Resend API key when you click Save KeyYour plan doesn’t include BYOK.Upgrade to the Team plan or higher, or use the platform-managed sender.

Next steps

Continue with these pages: