Procesador de hilos no deseados como deshecho
Basados en los correos de entrada se deshechan los hilos no deseados
+3
graph TD
%%{init: {'theme': 'mc','layout': 'elk'}}%%
GmailMesageComponent-2262z[<div><img src="/_astro/gmail.CLxyIGOu.svg" style="height: 20px !important;width: 20px !important"/></div>Obtener Mensajes]
style GmailMesageComponent-2262z stroke:#a170ff
ParseData-dkr4x[<div><img src="/_astro/braces.Djq0PW4_.svg" style="height: 20px !important;width: 20px !important"/></div>Obtener Datos 1]
style ParseData-dkr4x stroke:#a170ff
Prompt-qroxz[<div><img src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>Consulta 1]
style Prompt-qroxz stroke:#a170ff
OpenAIModel-iocjj[<div><img src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI]
style OpenAIModel-iocjj stroke:#a170ff
GmailThreadComponent-siyju[<div><img src="/_astro/gmail.CLxyIGOu.svg" style="height: 20px !important;width: 20px !important"/></div>Declarar hilo como deshecho]
style GmailThreadComponent-siyju stroke:#a170ff
ParseData-9csmb[<div><img src="/_astro/braces.Djq0PW4_.svg" style="height: 20px !important;width: 20px !important"/></div>Obtener Datos 2]
style ParseData-9csmb stroke:#a170ff
Prompt-k0mn8[<div><img src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>Consulta 2]
style Prompt-k0mn8 stroke:#a170ff
OpenAIModel-544uh[<div><img src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI2]
style OpenAIModel-544uh stroke:#a170ff
ChatOutput-aamor[<div><img src="/_astro/messages-square.BaSDmT6g.svg" style="height: 20px !important;width: 20px !important"/></div>Chat Output]
style ChatOutput-aamor stroke:#a170ff
TextInput-qers6[<div><img src="/_astro/type.Dy26vmDy.svg" style="height: 20px !important;width: 20px !important"/></div>Tema a comprobar]
style TextInput-qers6 stroke:#a170ff
GmailMesageComponent-2262z -.- ParseData-dkr4x
linkStyle 0 stroke:#a170ff
ParseData-dkr4x -.- Prompt-qroxz
linkStyle 1 stroke:#a170ff
Prompt-qroxz -.- OpenAIModel-iocjj
linkStyle 2 stroke:#a170ff
GmailThreadComponent-siyju -.- ParseData-9csmb
linkStyle 3 stroke:#a170ff
ParseData-9csmb -.- Prompt-k0mn8
linkStyle 4 stroke:#a170ff
Prompt-k0mn8 -.- OpenAIModel-544uh
linkStyle 5 stroke:#a170ff
OpenAIModel-544uh -.- ChatOutput-aamor
linkStyle 6 stroke:#a170ff
OpenAIModel-iocjj -.- GmailThreadComponent-siyju
linkStyle 7 stroke:#a170ff
TextInput-qers6 -.- Prompt-qroxz
linkStyle 8 stroke:#a170ff
Procesador de hilos no deseados como deshecho
🧩 Overview
This workflow automates the identification and disposal of unwanted email threads from a Gmail inbox. It functions as a personal assistant that scans incoming messages, uses AI to filter out undesirable content based on a user-defined topic, and moves the identified threads to the trash. Finally, it provides a clear summary of the actions taken.
⚙️ Main Features
- Connects to Gmail to securely fetch the latest emails from the inbox.
- Structures and formats raw email data for analysis.
- Employs an OpenAI model to intelligently identify threads related to a specified unwanted topic.
- Automatically modifies the labels of identified threads to move them to the trash.
- Generates and displays a final report listing the emails that were discarded.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Gmail Message Component | Fetches a specified number of recent emails from the Gmail inbox. | Number of emails to retrieve, target label (e.g., INBOX). | Raw email data including sender, subject, and thread ID. |
| Parse Data | Converts the structured email data into a readable, plain text format for analysis. | Raw email data. | Formatted text list of emails. |
| Text Input | Provides the user-defined topic or keyword used to filter unwanted emails. | User input (e.g., "Duolingo"). | The topic string. |
| Prompt | Constructs a query for the AI model, combining the formatted email list and the user's topic to find the corresponding thread ID. | Formatted email list, user topic. | A complete prompt instruction for the AI. |
| OpenAI Model | Analyzes the prompt to identify the thread ID associated with the unwanted topic from the email list. | Constructed prompt from the previous step. | The identified thread ID as plain text. |
| Gmail Thread Component | Takes the identified thread ID and performs an action to modify its label, moving it to the trash. | Target thread ID, operation (Modify Label), target label (TRASH). | Confirmation data of the action performed. |
| Parse Data (2) | Converts the confirmation data from the trash action into a readable format. | Action confirmation data. | Formatted text result of the operation. |
| Prompt (2) | Constructs an instruction for the AI to list the emails that have been trashed. | Formatted result of the trash operation. | A prompt asking for a summary list. |
| OpenAI Model (2) | Processes the prompt to generate a clean, human-readable list of the discarded emails. | Summary prompt. | A final list of trashed emails. |
| Chat Output | Displays the final AI-generated list of discarded emails to the user in the interface. | Final list from the AI model. | A formatted chat message for user review. |
🧠 Notes
- The workflow requires valid and pre-configured credentials for both Google Gmail and the OpenAI API.
- The AI filtering is based on the prompt logic and the user-provided topic; its accuracy depends on the clarity of the topic and the model's interpretation.
- The component is configured to move threads to the trash (TRASH label) rather than deleting them permanently.
- The number of emails fetched from the inbox is configurable within the Gmail Message Component.