Skip to main content
Automations are currently in private alpha and only available to a limited number of users. APIs might change before GA.To use the methods on this page, you must upgrade your Resend SDK:
npm install resend@6.10.0-preview-workflows.3
Contact us if you’re interested in testing this feature.

How it works

Edges are the code definitions for the connections between steps in the Automation graph and are defined and retrieved using the API. If creating an Automation via the API, define edges as an array of objects.
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.automations.create({
  name: 'Welcome series',
  status: 'disabled',
  steps: [
    {
      key: 'start',
      type: 'trigger',
      config: { eventName: 'user.created' },
    },
    {
      key: 'welcome',
      type: 'send_email',
      config: {
        templateId: '34a080c9-b17d-4187-ad80-5af20266e535',
      },
    },
  ],
  edges: [{ from: 'start', to: 'welcome' }],
});
When retrieving Automations, the API returns the edges as an array.
{
  "object": "automation",
  "id": "c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd",
  "name": "Welcome series",
  "status": "disabled",
  "created_at": "2026-10-01 12:00:00.000000+00",
  "updated_at": "2026-10-01 12:00:00.000000+00",
  "steps": [
    {
      "key": "start",
      "type": "trigger",
      "config": { "event_name": "user.created" }
    },
    {
      "key": "welcome",
      "type": "send_email",
      "config": {
        "template_id": "34a080c9-b17d-4187-ad80-5af20266e535"
      }
    }
  ],
  "edges": [
    {
      "from": "start",
      "to": "welcome",
      "edge_type": "default"
    }
  ]
}

Edge properties

Edges define connections between steps in the automation graph.
from
string
required
This is the key of the origin step.
to
string
required
This is the key of the destination step.
edge_type
string
The type of connection between the origin and destination steps. Most automations use the default edge type.Use a non-default edge_type only when the origin step can branch to multiple destinations:
  • For wait_for_event, use event_received or timeout.
  • For condition, use condition_met or condition_not_met.
Possible values:
  • default
  • condition_met
  • condition_not_met
  • timeout
  • event_received
Example
{
  "from": "start",
  "to": "welcome",
  "edge_type": "default"
}