Gmail inbox summary
This workflow automates inbox management by integrating artificial intelligence, turning the volume of emails into actionable and synthesized information.
+2
graph TD
%%{init: {'theme': 'mc','layout': 'elk'}}%%
ChatOutput-qsrsy[<div><img alt="logo" src="/_astro/messages-square.BaSDmT6g.svg" style="height: 20px !important;width: 20px !important"/></div>Chat Output]
style ChatOutput-qsrsy stroke:#a170ff
Prompt-cu2bi[<div><img alt="logo" src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>Prompt]
style Prompt-cu2bi stroke:#a170ff
ParseData-6kq7u[<div><img alt="logo" src="/_astro/braces.Djq0PW4_.svg" style="height: 20px !important;width: 20px !important"/></div>Extract Text]
style ParseData-6kq7u stroke:#a170ff
GmailMesageComponent-oada2[<div><img alt="logo" src="/_astro/gmail.CLxyIGOu.svg" style="height: 20px !important;width: 20px !important"/></div>Get Messages]
style GmailMesageComponent-oada2 stroke:#a170ff
OpenAIModel-efuet[<div><img alt="logo" src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI]
style OpenAIModel-efuet stroke:#a170ff
ParseData-6kq7u -.- Prompt-cu2bi
linkStyle 0 stroke:#a170ff
GmailMesageComponent-oada2 -.- ParseData-6kq7u
linkStyle 1 stroke:#a170ff
Prompt-cu2bi -.- OpenAIModel-efuet
linkStyle 2 stroke:#a170ff
OpenAIModel-efuet -.- ChatOutput-qsrsy
linkStyle 3 stroke:#a170ff
Gmail Inbox Summary
đź§© Overview
The workflow automates the management of a Gmail inbox by extracting the latest messages, converting them into a concise textual format, and generating AI‑driven summaries. It then presents the summarized information in a chat‑style interface, allowing users to quickly scan key points from their inbox.
⚙️ Main Features
- Automatic email retrieval from a specified Gmail label or query.
- Structured extraction of email contents into plain text.
- Dynamic prompt construction that inserts the extracted emails into a reusable template.
- AI summarization using a configurable OpenAI model.
- Chat‑style presentation of the final summaries for easy consumption.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Get Messages | Retrieves email messages from Gmail according to a filter or query. | Number of emails to read, Gmail labels, optional search query, authentication credentials. | Data – a collection of raw email objects. |
| Extract Text | Converts raw email data into a plain‑text representation following a user‑defined template. | Email data, template string, separator character. | Text – a concatenated string containing the formatted email bodies. |
| Prompt | Builds the instruction set for the AI model by inserting the extracted text into a pre‑defined prompt template. | Emails text. | Prompt message – a formatted prompt ready for the language model. |
| OpenAI | Generates summarized text from the prompt using an OpenAI language model. | Prompt message, model configuration (name, temperature, token limits, etc.). | Text – the AI‑generated summary of the emails. |
| Chat Output | Renders the AI summary as a chat message in the user interface. | Summarized text. | Displayed chat message – the final output shown to the user. |
đź§ Notes
- The workflow requires valid Google Gmail credentials and OpenAI API credentials to function.
- The Get Messages component supports fetching by label, query, or a specified number of recent messages.
- The Extract Text step can be customized with different templates and separators to suit various email structures.
- The OpenAI component uses a user‑selectable model (e.g., GPT‑4.1) and allows optional JSON mode for structured output.
- The Chat Output component presents the results in a familiar chat format, facilitating quick review of summarized emails.
- If the workflow is extended, additional steps such as attachment processing or sentiment analysis could be inserted after the Extract Text component without altering the core flow.