Compose reply draft in Gmail with OpenAI Assistant
This workflow uses OpenAI Assistant to compose draft replies for labeled email messages. It automatically connects the drafts to Gmail threads.
š” You can add knowledge base to your OpenAI Assistant and make your reply drafts very customized (e.g. compose response with product information in response to inquiry from customer).
š¬ See this workflow in action in my YouTube video about automating Gmail.
How it works?
The workflow is triggered at regular intervals (default: every 1 minute ā you can change this value) to check for messages with a specific label (e.g., "AI").
The content of the retrieved email message is then forwarded to the OpenAI Assistant node, and a reply draft is generated. Next, the response from the Assistant is converted to HTML, and a raw message in RFC standard is composed.
š” You can learn more about composing drafts with the Gmail API in the official Google documentation.
The raw email message (reply draft) is encoded and attached to the original thread ID. Finally, the trigger label (in this case: "AI") is removed to prevent the workflow from looping.
Set up steps
Set credentials for Gmail and OpenAI. Add new label in Gmail account for messages that should be handled by the workflow (e.g. name it "AI"). Select this label in the first and last Gmail nodes in workflow. Create and configure your OpenAI Assistant. Select your assistant in "OpenAI Assistant" node. Optionally: change trigger interval (by default interval is 1 minute).
If you like this workflow, please subscribe to my YouTube channel and/or my newsletter.
Related Templates
AI Email Classifier & Auto-Delete for Gmail (SPAM/OFFER Cleaner)
This workflow is designed for freelancers, solopreneurs, and business owners who receive a high volume of irrelevant mes...
Generate Food Recipes from Gmail & Form Requests with Ollama & Llama 3.2
This n8n template demonstrates how to create an intelligent food recipe assistant that accepts requests via Gmail and we...
Automatic News Summarization & Email Digest with GPT-4, NewsAPI and Gmail
š° AI News Digest Agent: Auto News Summarizer & Email Newsletter Create an intelligent news curation system that automat...
š Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments