I can trigger an agent via email, but I can’t figure out how to access the email’s data inside the agent. I'm unable to find it in the docs, and the copilot doesn’t seem to know this trigger method even exists.
Additionally, I want to attach files to the trigger emails and have the agent process them. Is that possible? Does the agent have access to email attachments?
For context, my goal is to:
Build an agent that checks the contents of a few files (ideally provided via email, as attachments), makes some API calls to pull extra data, and—if everything looks good—uploads the files to an endpoint.
From what the Retool team has told me, the agent is not able (yet) to parse documents neither from the email nor the chat. The suggested workaround now is to work with retool storage.
I too had as a first use case an agent that analyzes files from emails... but I'll guess we will have to wait for retool to release this.
Hey @Piny - when you invoke an agent via email, the body and sender are all passed into the first message to the agent:
From: {emailData.from}
Cc: {emailData.Cc} (if present)
To: {other recipients} (if present, excluding the agent email)
Subject: {emailData.subject}
Message-Id: {emailData['Message-Id']}
{emailData['stripped-text']}
In your agent instructions you could reference these things, and the agent will have them in context. Here's an example of me emailing an agent and asking what it was invoked with: