What is the email autodrafting assistant workflow for Gmail using OpenAI API and its features?

This topic was automatically generated from Slack. You can find the original thread here.

Hey all! I just joined the slack and spent some time scrolling through what you’ve all made - really awesome and inspiring workflows. Thanks for sending this channel my way.

I wanted to share an email autodrafting assistant workflow I made as a few weeks back. It uses the Gmail API and OpenAI API (you can use either GPT-3.5 or 4 if you have access) to bulk draft emails using the drafts as prompts for GPT and then sends the completed draft right back as a new draft in the thread. A few things you can do with it:

In-Gmail Prompting via Labels: The workflow is triggered by Gmail labels, meaning you can call it both from your regular Gmail web UI and mobile app. Existing drafts serve as user instructions, so you can write a few bullet points in a draft of what you want to say, followed with a prompt like “expand on x part” or “revise to be more y” and the model will use it as instructions.
Context Rich Drafting and your own Tone of Voice: Included are the System and User Prompts I created. The user prompt takes in the full thread context and makes sure the model understands the scenario, such as if we’re replying to someone or drafting a new message, so it can generate a meaningfully relevant message. In the system prompt you’ll find a series of branding and tone of voice variables you can swap in your own for.
Bulk concurrent drafting for batching: The workflow can generate multiple drafts concurrently thanks to Pipedreams concurrency features, allowing for faster email batching. I’ve used this to write out a few bullet points in each email I need to respond to, label them, go get a glass of water and come back to all them them drafted up and then I can revise from there. It doesn’t always get it right - for context sensitive scenarios it is still faster to just type of emails yourself rather than do heavy revisions, but I’ve found for most threads it can be really helpful, especially on mobile.
You can use this link to clone it directly in Pipedream here: https://pipedream.com/new?h=tch_wjPf72 (love this new feature)

And you can find setup instructions and the step by step logic here: GitHub - jacob-dietle/Gen-AI-Gmail-Autodrafting-Assistant: This is a Pipedream workflow that integrates GPT-3.5 (or GPT-4) with Gmail to automatically generate email drafts based on the context of email threads and user instructions from Gmail. Allows context rich draft, customizable tone of voice and bulk concurrent drafting for faster email drafting.

I could imagine this being super useful on more generic help desk replies.

respond empathically to the sender acknowledging their email

Oh yeah - great idea! I’ll make sure to add thanks