Quick overview
This workflow watches for new unread Gmail messages, uses OpenAI to classify each email and draft a reply, then either creates a Gmail draft in the original thread and labels the message for follow-up, or files it by applying FYI/Noise labels.
How it works
- Triggers every minute when a new unread email arrives in Gmail.
- Sends the email subject and snippet to OpenAI to return a category, a draft reply, and a flag indicating whether the sender is waiting for an answer.
- If an answer is needed, creates a Gmail draft reply in the same thread addressed to the original sender.
- Labels the original Gmail message as YouDecide when OpenAI classifies it as “du”, otherwise labels it as Drafted.
- If no answer is needed, labels the original Gmail message as Noise when OpenAI classifies it as “werbung”, otherwise labels it as FYI.
Setup
- Connect your Gmail OAuth2 account and select the same credential in the Gmail trigger and all Gmail action steps.
- Add your OpenAI API credentials and pick a model that can return JSON. The system message is already written - adjust the four category definitions if your inbox needs different buckets.
- Create the four Gmail labels used by the workflow (YouDecide, Drafted, FYI, Noise) and update the label IDs in the labeling steps if they differ in your account.