Send Email
Send Email sends an email through a connected Outlook or Gmail mailbox. Give it a recipient, subject, and body, and it dispatches the message through the mailbox integration attached to the agent (with no LLM call on the send itself).
Send Email belongs to the Generation group in the agent library. Under the hood it runs as a Custom agent (custom_agent): the agent service forwards the agent's inputs to the custom-action service, which executes the agent and returns its output. See Custom Agent for how the custom_agent dispatch mechanism works.
When to use it
Use Send Email as the last agent in a workflow that needs to deliver a message rather than just produce text:
- Reply to an inbound support email once a Custom Agent or Document Writer Agent has composed the response.
- Notify a stakeholder when a workflow reaches a particular state.
- Send a generated document or summary directly to a recipient's inbox.
Send Email requires a mailbox integration (Outlook or Gmail) to be connected to the agent before it can run.
Configuration
Add the agent to a workflow as a Custom agent and pin it by ID in agent_config.type_config:
{ "custom_agent_id": "send_email_agent" }
| Input key | Required | Purpose |
|---|---|---|
to_email | Yes | The recipient email address (or a list of addresses). |
subject | Yes | The email subject line. |
email_body | Yes | The email body content. |
attachments | No | One or more documents already held by Ema to attach. See Attaching documents below. |
Inputs and output
Input
{
"to_email": "[email protected]",
"subject": "Re: Order #4821 delay",
"email_body": "Hi Alice, your order is scheduled to ship tomorrow. Thanks for your patience!"
}
Output
{ "status": "sent" }
A downstream agent reads the send status via {{<node_id>.output.status}}.
Attaching documents
A Send Email agent can attach a document that Ema already holds. The agent sends a reference, not the file bytes; the integrations service fetches the bytes server-side, workspace-scoped, so the file never crosses the inter-service hop.
Two reference kinds are supported:
- Ingestion document — a bare document ID (a Knowledge Base article, a dashboard upload, or any document with a stored file). Example:
8f1c9e4a-0000-0000-0000-000000000001 - Storage blob — a
blob:<key>reference for transient files that are not ingestion documents. Example:blob:chat/sess-1/uploads/justification.docx
Bind the attachments input in the agent's input_mapping. The value can be a single reference, a comma-separated list, or an array bound from an upstream agent's output. To attach a document generated by a Document Writer agent, bind attachments to that agent's attachment_ref output:
{
"attachments": "{{document_writer_node.output.attachment_ref}}"
}
Each attachment entry may also be an object carrying the document reference and an optional filename override:
{
"attachments": [
{ "ref": "blob:chat/sess-1/uploads/1f4c9d2e.pdf", "name": "Q3 Handover Notes.pdf" },
"8f1c9e4a-0000-0000-0000-000000000001"
]
}
The filename override is useful for blob references, whose keys are machine-generated IDs. An ingestion document already carries its filename from the stored file, so no override is needed there.
Limits: at most 10 attachments per email; each resolved document must be 3 MiB or smaller (Microsoft Graph's inline attachment limit).
Feature flag
Document attachments are gated by the send_email_attachments_enabled feature flag, which must be enabled for your workspace. When the flag is off, an agent that receives attachment references fails the step rather than sending a stripped email.
Reviewing attachments before sending
If the agent has require_confirmation enabled, the HITL reviewer sees the attachment filenames listed in the review prompt before approving the send. The attachment references are stored on the pending review row, so an approved send carries the same documents the reviewer saw.
If you use attachments without require_confirmation or draft_mode, the AI Employee builder shows an advisory warning (DAG_SEND_EMAIL_ATTACHMENTS_UNREVIEWED) at save time. This does not block publishing; it is a reminder that the file and the recipient may both be chosen by an upstream agent, and a send cannot be undone. Set require_confirmation or draft_mode if you want a human checkpoint before the email goes out.
What's next
- Custom Agent — how the
custom_agentdispatch this agent runs on works. - Email Parser Agent — parse the inbound email this workflow is replying to.
- Document Writer Agent — draft the content Send Email delivers.