Back to Templates

Automated Gmail Reply Drafts with OpenAI Assistant for Labeled Emails

Created by

Created by: Hichul || melikahichul

Hichul

Last update

Last update a day ago

Share


n8n workflow template description [template]
This workflow automatically drafts replies to your emails using an OpenAI Assistant, streamlining your inbox management. It's designed for support teams, sales professionals, or anyone looking to accelerate their email response process by leveraging AI to create context-aware draft replies in Gmail.
How it works
The workflow runs on a schedule (every minute) to check for emails with a specific label in your Gmail account.
It takes the content of the newest email in a thread and sends it to your designated OpenAI Assistant for processing.
A draft reply is generated by the AI assistant.
This AI-generated reply is then added as a draft to the original email thread in Gmail.
Finally, the initial trigger label is removed from the email thread to prevent it from being processed again.
Set up steps
Connect your accounts: You'll need to connect your Gmail and OpenAI accounts in the respective nodes.
Configure the trigger: In the "Get threads with specific labels" Gmail node, specify the label that you want to use to trigger the workflow (e.g., generate-reply). Any email you apply this label to will be processed.
Select your OpenAI Assistant: In the "Ask OpenAI Assistant" node, choose the pre-configured Assistant you want to use for generating replies.
Configure label removal: In the "Remove AI label from email" Gmail node, ensure the same trigger label is selected to be removed after the draft has been successfully created.
Activate the workflow: Save and activate the workflow to begin automating your email replies.