3.1 AgentMail Configuration

Setting up the Ears.

We use AgentMail.to because it parses messy emails into clean JSON for us.

Access AgentMail Documentation here: https://docs.agentmail.to/welcome

Step 1: Provision the Inbox

  1. Log in to your AgentMail Dashboard.

  2. Create a new Organization: DealTrail.

  3. Create a new Inbox:

    • Address: tc (which becomes tc@dealtrail.agentmail.to or your custom domain).

    • Name: "DealTrail Central".

Step 2: Connect the Webhook

We need AgentMail to "push" emails to n8n instantly.

  1. Open n8n.

  2. Create a new Workflow called "01 - Ingestion Router".

  3. Add a Webhook node.

    • Method: POST.

    • Path: /webhook/ingest.

    • Copy the Production URL.

  4. Go back to AgentMail.

  5. Navigate to Webhooks settings.

  6. Add Webhook: Paste your n8n URL.

    • Events: Select message.created.

Step 3: Verify the Payload

Send a test email to your new address. In n8n, you should see a JSON object like this:

{
"from": "agent@gmail.com",
"subject": "Fwd: Contract for 123 Maple",
"body": "Hi Amy, see attached.",
"attachments": [
{
"filename": "RPA_123_Maple.pdf",
"url": "https://agentmail.to/..."
}
]
}

Developer Note: We use the attachments array heavily. Ensure your n8n flow downloads these files immediately as the temporary links expire.


Was this article helpful?
© 2025 DealTrail 3.0