---
title: "Mailgun Integration"
description: "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."
url: https://flowrunner.ai/integrations/mailgun
date_modified: 2026-08-07T17:20:23-07:00
---

# Mailgun

[Email](https://flowrunner.ai/integrations/category/email-marketing)

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.

[Verified](https://flowrunner.ai/integrations/verified "What does verified mean?") · 20 actions · API key · available

[Mailgun website](https://mailgun.com/) · [Platform Documentation](https://documentation.mailgun.com/docs/mailgun/api-reference/intro/) · Capability data verified 2026-08-12

1.  A new signup arrives from a form
2.  Agent runs Validate Email Address before adding the contact
3.  Agent adds the contact with Add List Member on the mailing list
4.  Agent sends the confirmation with Send Templated Email
5.  Agent reads Get Events to confirm the message was delivered
6.  Ops channel gets a summary of new members and deliveries
7.  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](https://flowrunner.ai/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](https://flowrunner.ai/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](https://flowrunner.ai/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](https://flowrunner.ai/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.

## Frequently Asked Questions

### What can FlowRunner do with Mailgun?

FlowRunner agents can run Send Email, Send Templated Email, and Get Events in Mailgun, plus 17 more actions.

### Does connecting Mailgun to FlowRunner require OAuth?

No. Mailgun connects to FlowRunner with an API key, no OAuth flow required.

### Can Mailgun trigger a FlowRunner workflow automatically?

Mailgun doesn't currently expose triggers in FlowRunner. It connects as an action step inside workflows started by another trigger.

**Work at Mailgun?** This integration exposes Mailgun to AI agents on every FlowRunner plan, including through MCP, at no cost to you. [See what FlowRunner offers integration partners](https://flowrunner.ai/integrations/partners), including how to keep this page current.

---
Markdown version of https://flowrunner.ai/integrations/mailgun. Site index: https://flowrunner.ai/llms.txt
