Each new email gets a reply drafted in your voice and filed under the original message in Gmail, with blanks where a fact is missing.
Uses
Claude
Gmail
Draft a reply to every new email in your voice
email.When an email arrives. Save it as email.aboutMe to blank.Set aboutMe to blank.signOffName to blank.Set signOffName to blank.deliveryMode to draft.Set deliveryMode to draft.skipSenderPatterns to [noreply, no-reply, donotreply, do-not-reply, mailer-daemon, postmaster@, notifications@, bounce].Set skipSenderPatterns to [noreply, no-reply, donotreply, do-not-reply, mailer-daemon, postmaster@, notifications@, bounce].skipSubjectPatterns to [out of office, automatic reply, auto-reply, autoreply, undeliverable, delivery status notification, read receipt].Set skipSubjectPatterns to [out of office, automatic reply, auto-reply, autoreply, undeliverable, delivery status notification, read receipt].skipBodyPatterns to [unsubscribe, view this email in your browser, you are receiving this email because].Set skipBodyPatterns to [unsubscribe, view this email in your browser, you are receiving this email because].minBodyChars to 20.Set minBodyChars to 20.maxBodyChars to 6000.Set maxBodyChars to 6000.fromHeader to email.from.Set fromHeader to email.from.subjectHeader to email.subject.Set subjectHeader to email.subject.bodyHeader to email.body.Set bodyHeader to email.body.dateHeader to email.date.Set dateHeader to email.date.fromHeader is empty or subjectHeader is empty or bodyHeader is empty or…If fromHeader is empty or subjectHeader is empty or bodyHeader is empty or…Yes
No email to work from. This workflow runs by itself when a new email arrives in Gmail: connect Gmail, turn the workflow on, and the next message that lands gets a drafted reply. Running it by hand has nothing to read..Show in the output: No email to work from. This workflow runs by itself when a new email arrives in Gmail: connect Gmail, turn the workflow on, and the next message that lands gets a drafted reply. Running it by hand has nothing to read..No
No steps
fromHeader and save it as sender.Extract the first email address from fromHeader and save it as sender.subjectHeader and save it as subject.Trim subjectHeader and save it as subject.bodyHeader and save it as bodyText.Trim bodyHeader and save it as bodyText.skipReason to blank.Set skipReason to blank.sender is blankIf sender is blankYes
skipReason to its From line carries no address a reply could go to.Change skipReason to its From line carries no address a reply could go to.No
No steps
skipReason is blankIf skipReason is blankYes
pattern in skipSenderPatterns:For each pattern in skipSenderPatterns:sender contains pattern (ignoring case) If sender contains pattern (ignoring case)Yes
it came from an unattended address (@sender) and save it as skipReason.Build the text it came from an unattended address (@sender) and save it as skipReason.No
No steps
No
No steps
skipReason is blankIf skipReason is blankYes
pattern in skipSubjectPatterns:For each pattern in skipSubjectPatterns:subject contains pattern (ignoring case) If subject contains pattern (ignoring case)Yes
it is itself an automatic message (the subject says @pattern) and save it as skipReason.Build the text it is itself an automatic message (the subject says @pattern) and save it as skipReason.No
No steps
No
No steps
skipReason is blankIf skipReason is blankYes
pattern in skipBodyPatterns:For each pattern in skipBodyPatterns:bodyText contains pattern (ignoring case) If bodyText contains pattern (ignoring case)Yes
it reads as bulk mail (the body says @pattern) and save it as skipReason.Build the text it reads as bulk mail (the body says @pattern) and save it as skipReason.No
No steps
No
No steps
skipReason is blank and the length of bodyText is less than minBodyCharsIf skipReason is blank and the length of bodyText is less than minBodyCharsYes
skipReason to there is too little text in it to reply to.Change skipReason to there is too little text in it to reply to.No
No steps
skipReason isn't blankIf skipReason isn't blankYes
@subject: skipReason.Show in the output: No draft written for @subject: skipReason.No
No steps
bodyText to maxBodyChars characters (keeping words whole) and save it as emailForModel.Shorten bodyText to maxBodyChars characters (keeping words whole) and save it as emailForModel.drafted.Run an AI agent: Decide whether this email needs a reply and, if it does, draft it. THE EMAIL THEY RECEIVE… and save it as drafted.drafted.output.needs_reply is noIf drafted.output.needs_reply is noYes
@subject and judged that it needs no reply, so no draft was written.Show in the output: Read @subject and judged that it needs no reply, so no draft was written.Else if @drafted.output.needs_reply is not "yes"
@subject from sender: the AI did not say clearly whether it needs a reply (it answered @drafted.output.needs_reply). Answer this email by hand.Stop and report a problem: No draft was written for @subject from sender: the AI did not say clearly whether it needs a reply (it answered @drafted.output.needs_reply). Answer this email by hand.Otherwise
No steps
drafted.output.reply with ** replaced by and save it as reply.Trim drafted.output.reply with ** replaced by and save it as reply.reply is less than 20If the length of reply is less than 20Yes
@subject from sender: the AI said it needs a reply but only wrote @reply, which is too little to be a usable draft. Answer this email by hand.Stop and report a problem: No draft was written for @subject from sender: the AI said it needs a reply but only wrote @reply, which is too little to be a usable draft. Answer this email by hand.No
No steps
deliveryMode in lowercase is sendIf deliveryMode in lowercase is sendYes
email.Reply to email email.reply@subject from sender, in the same conversation, unreviewed, because deliveryMode is send.Show in the output: Sent a reply to @subject from sender, in the same conversation, unreviewed, because deliveryMode is send.No
email.Draft a reply to email email.reply@subject from sender in the same conversation. Read it, edit it, send it.Show in the output: Draft saved in Gmail, under @subject from sender in the same conversation. Read it, edit it, send it.