Procesador de Mensajes no leidos
Marca como leído los correos que se requieran
+3
graph TD
%%{init: {'theme': 'mc','layout': 'elk'}}%%
ParseData-ptp7g[<div><img src="/_astro/braces.Djq0PW4_.svg" style="height: 20px !important;width: 20px !important"/></div>Obtener Datos]
style ParseData-ptp7g stroke:#a170ff
Prompt-7qn0s[<div><img src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>Consulta]
style Prompt-7qn0s stroke:#a170ff
OpenAIModel-kx9h5[<div><img src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI]
style OpenAIModel-kx9h5 stroke:#a170ff
ChatOutput-ugeve[<div><img src="/_astro/messages-square.BaSDmT6g.svg" style="height: 20px !important;width: 20px !important"/></div>Chat Output]
style ChatOutput-ugeve stroke:#a170ff
GmailMesageComponent-riqjp[<div><img src="/_astro/gmail.CLxyIGOu.svg" style="height: 20px !important;width: 20px !important"/></div>Obtener Mensajes]
style GmailMesageComponent-riqjp stroke:#a170ff
GmailMesageComponent-1gc2u[<div><img src="/_astro/gmail.CLxyIGOu.svg" style="height: 20px !important;width: 20px !important"/></div>Marcar como leído]
style GmailMesageComponent-1gc2u stroke:#a170ff
TextInput-1cb9o[<div><img src="/_astro/type.Dy26vmDy.svg" style="height: 20px !important;width: 20px !important"/></div>Tema a comprobar]
style TextInput-1cb9o stroke:#a170ff
AdvancedAgent-csduv[Agent2]
style AdvancedAgent-csduv stroke:#a170ff
GmailMesageComponent-riqjp -.- ParseData-ptp7g
linkStyle 0 stroke:#a170ff
ParseData-ptp7g -.- Prompt-7qn0s
linkStyle 1 stroke:#a170ff
TextInput-1cb9o -.- Prompt-7qn0s
linkStyle 2 stroke:#a170ff
Prompt-7qn0s -.- AdvancedAgent-csduv
linkStyle 3 stroke:#a170ff
AdvancedAgent-csduv -.- ChatOutput-ugeve
linkStyle 4 stroke:#a170ff
OpenAIModel-kx9h5 -.- AdvancedAgent-csduv
linkStyle 5 stroke:#a170ff
GmailMesageComponent-1gc2u -.- AdvancedAgent-csduv
linkStyle 6 stroke:#a170ff
Procesador de Mensajes no leidos
🧩 Overview
This workflow automates the processing of unread emails in a Gmail inbox. It retrieves messages from a specified folder, analyzes their content against a user-defined topic, and uses an AI agent to intelligently mark relevant unread messages as read. This process helps in managing email clutter by automatically handling messages that match specific criteria, saving time on manual inbox organization.
⚙️ Main Features
- Fetches a configurable number of emails from a Gmail inbox based on a search query.
- Extracts and formats key email data (sender, subject, snippet, etc.) for analysis.
- Utilizes a Large Language Model (LLM) agent to interpret a user prompt and decide which unread emails to mark as read.
- Empowers the AI agent with a Gmail tool to execute the "mark as read" action on identified emails.
- Displays the agent's final decision and action summary in a chat interface.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Obtener Mensajes (Gmail) | Fetches a list of emails from the Gmail inbox. | Search query (e.g., "Linkedin"), number of emails to retrieve. | Raw email data. |
| Obtener Datos (Parse Data) | Parses the raw email data into a structured, readable text format. | Raw email data from Gmail. | Formatted text containing email details (ID, sender, subject, etc.). |
| Tema a comprobar (Text Input) | Provides the user-defined topic or filter criteria for the agent. | User-defined topic string (e.g., "Linkedin"). | The topic as a text message. |
| Consulta (Prompt) | Constructs the final instruction for the AI agent by combining the formatted emails and the topic. | Formatted email data and the user-defined topic. | A complete prompt message instructing the agent. |
| OpenAI Model | Provides the core language model that powers the reasoning of the AI agent. | Model configuration (e.g., GPT-4.1). | A configured language model instance. |
| Marcar como leído (Gmail Tool) | Serves as a tool that the AI agent can call to perform the "mark as read" action. | Tool configuration for marking emails. | A tool interface for the agent. |
| Agent (Advanced Agent) | The central AI agent that receives the prompt, reasons about which emails to process, and decides to use the Gmail tool. | The constructed prompt, the language model, and the Gmail tool. | A decision or action plan, often instructing the Gmail tool. |
| Chat Output | Displays the final response or action summary from the AI agent in a readable format. | The agent's response message. | A formatted chat message in the output interface. |
🧠 Notes
- The workflow requires valid credentials for both the OpenAI API and Google Gmail to function.
- The effectiveness of email filtering depends on the clarity of the user-provided topic in the Text Input component and the search query in the first Gmail component.
- The AI agent operates based on the instructions in the prompt template; its decisions are guided by the LLM's interpretation of the email content and the specified topic.
- The number of emails processed in a single run is limited by the configuration in the first Gmail component.