FlowRunner
Pricing
Theme

Mailgun

Email

Connect AI agents to Mailgun. Agents send plain, HTML, and templated email with attachments, validate addresses, manage mailing lists and members, maintain suppression lists, and pull sending statistics.

20 actions available
A new signup arrives from a form
Agent runs Validate Email Address before adding the contact
Agent adds the contact with Add List Member on the mailing list
Agent sends the confirmation with Send Templated Email
Agent reads Get Events to confirm the message was delivered
Ops channel gets a summary of new members and deliveries
A message to an entire mailing list routes for approval first

What This Integration Enables

An agent can send email through a Mailgun sending domain with plain-text or HTML bodies and FlowRunner file attachments, or send from a stored template with variables passed as a JSON object. It queries the message event log for accepted, delivered, failed, opened, and complained events, and validates a single address before it ever adds it to a list. Mailing lists and their members are fully managed: create and delete lists, add and remove members with custom variables, and read membership. Around the send, the agent keeps deliverability clean. It maintains the bounce, unsubscribe, and complaint suppression lists per domain, pulls aggregated sending statistics, and inspects sending domains and their verification state. Mailgun exposes no event triggers in this integration, so flows start from the systems feeding it: a form, a CRM, or a scheduled sweep. The agent is the bridge that turns those signals into deliverable mail and keeps the recipient data around it in good standing.

Without FlowRunner

Bad addresses added Invalid signups land on the list and bounce on the next send
Suppressions drift Unsubscribed and complained addresses still receive mail
Deliverability unknown No one checks whether a message actually landed until a complaint

With FlowRunner

Validated before add Validate Email Address screens each signup before it joins the list
Suppressions maintained The agent keeps bounces, unsubscribes, and complaints current per domain
Delivery confirmed Get Events confirms the message was accepted and delivered

Use Case Scenarios

Validated Signup to a Managed List

New signups arrive through [Typeform](/integrations/typeform). The agent pulls the responses with Get Form Responses, calls Validate Email Address to filter out invalid entries, and enrolls only the valid addresses with Add List Member. The mailing list grows with deliverable contacts, not bounces waiting to happen.

Booking Confirmation From a Template

A [Calendly](/integrations/calendly) On Invitee Created trigger fires. The agent calls Send Templated Email to deliver a branded confirmation with the meeting details, then reads Get Events to confirm the message was delivered before closing the flow.

Welcome and Verify

When [HubSpot](/integrations/hubspot) Create Contact adds a new lead, the agent sends a welcome message with Send Email and checks Get Events to confirm delivery. If the message failed, the agent surfaces the failure instead of assuming the welcome landed.

Human-in-Loop Highlight

Sending to an entire mailing list is a high-reach action, and reach is where a mistake multiplies. A wrong template or a wrong list reaches every subscriber before anyone can pull it back. When the agent is about to send to a full list rather than a single recipient, it treats the send as a [human-in-the-loop](/concepts/human-in-the-loop/) step. It pauses, shows the template, the target list, and the member count, and routes approval to a marketing owner through Slack or email. The owner approves, and the agent sends. The owner holds, and nothing goes out. One-to-one transactional mail flows untouched; the sends that reach everyone get a human first.

Agent processes routinely
Detects exception requiring judgment
Clear match Continues automatically
Ambiguous Routes to human via Slack
Human decides
Agent resumes with decision

Agent Capabilities

20 actions

Sending

2
  • Send Email Sends an email through a Mailgun sending domain. Supports plain-text and HTML bodies, CC and BCC recipients, and file attachments taken from FlowRunner file URLs.
  • Send Templated Email Sends an email using a stored Mailgun template. Template variables are passed as a JSON object, so the same template renders per recipient.

Deliverability

3
  • Get Events Retrieves message events (accepted, delivered, failed, opened, clicked, unsubscribed, complained) so the agent can confirm what happened to a message.
  • Validate Email Address Validates a single email address using Mailgun's validation service, returning a result the agent can act on before adding the address to a list or CRM.
  • Get Stats Retrieves aggregated sending statistics for a domain from the stats API, for a chosen event and time window.

Mailing Lists

7
  • Create Mailing List Creates a new mailing list, identified by its own email address.
  • List Mailing Lists Retrieves the mailing lists in your account, including each list's address, name, and member count.
  • Get Mailing List Retrieves a single mailing list's details by its address.
  • Delete Mailing List Permanently deletes a mailing list and all of its members. This cannot be undone.
  • Add List Member Adds a member to a mailing list, optionally with a display name and custom JSON variables.
  • List Members Retrieves the members of a mailing list, including each member's address, name, and subscription state.
  • Delete List Member Removes a member from a mailing list by email address.

Suppressions

6
  • List Bounces Retrieves the bounce suppression list for a domain, addresses that hard-bounced and are blocked from delivery.
  • Delete Bounce Removes an address from a domain's bounce suppression list so Mailgun will attempt delivery again.
  • List Unsubscribes Retrieves the unsubscribe suppression list for a domain, addresses that opted out.
  • Add Unsubscribe Adds an address to a domain's unsubscribe suppression list, blocking future messages to it.
  • Delete Unsubscribe Removes an address from a domain's unsubscribe suppression list so it can receive messages again.
  • List Complaints Retrieves the complaint suppression list for a domain, addresses that marked your messages as spam.

Domains

2
  • List Domains Retrieves the sending domains registered in your account, including each domain's state.
  • Get Domain Retrieves a single domain's details, including its verification state and sending and receiving settings.

Start building with Mailgun

$100 in credits. No card required. Connect in minutes.