Creating Email-Triggered AI Agents

Ever wanted an AI to automatically process your emails and take action? In this tutorial, we'll create a worker that monitors emails and extracts urgent items into a note. This same pattern can be used to create workers that:

  • Summarize long email threads
  • Extract and track action items
  • Update project status based on updates
  • Process data attachments (coming soon)
  • Forward important information to your team

Creating the Worker

  1. Click the "+ New Worker" button in the Workers tab
  2. Enter this system prompt:
Iam going to copy you into our team emails.

Extract out everything that seems urgent, and keep a note in this workspace called "Urgent Project Items from Emails".

If nothing in the email appears to be urgent, just exit.
  1. Click "Save"

Setting Up Email Triggers

  1. Click the "Triggers" button
  2. Enable "Email Trigger"
  3. Copy the generated email address

That's it!

You've just created an AI worker that will process emails automatically. The worker will:

  • Receive emails sent to its address
  • Read through the content
  • Extract urgent items
  • Maintain a running note of urgent tasks
  • Skip non-urgent emails

Testing It Out

Let's make sure it works:

  1. Send a test email to your worker's address with this content:
Hey team,

The auth service is down again affecting Acme Corp and several other enterprise customers. 
Sarah - can you jump on this ASAP? Wea are getting heat from multiple VPs.

Quick updates:
- Q3 roadmap draft is in Confluence
- Mobile app v2.4 ships next week
- Legal needs the data retention docs by Thursday for SOC 2 (no extensions possible)

Heads up - just got out of an exec meeting. They want a board presentation ready by Tuesday showing our recovery from the recent outages and current growth metrics. I know it's short notice but this can't slip.

Let me know if you need anything from me.

  1. Check the "Urgent Project Items from Emails" note in your workspace - you should see the urgent items extracted and added automatically.

Next Steps

Now that you know how to create email-triggered workers, try:

  • Modifying the prompt to extract different types of information
  • Creating workers that process specific types of emails (e.g., status updates, client feedback)
  • Adding more complex processing logic (e.g., categorizing items, formatting reports)

Related Links