Skip to content
NEWMarketplace and your team: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Email Automation

Email Automation

Draft and approve Gmail replies with OpenAI, Cognee, Slack, and Google Sheets

When a new email arrives, it handles email with OpenAI / ChatGPT using Gmail, Google Sheets, Slack, Cognee.

What it does

## 📧 Cognee Agentic Email Reply Drafter – RAG-Powered Gmail AI ### How it works This workflow turns your Gmail inbox into a self-drafting AI assistant. When a new email arrives, it first filters out automated senders (newsletters, no-reply addresses). The remaining emails are classified by GPT-4o-mini — only emails that genuinely need a human reply are processed further. For those, a RAG-powered Draft Reply Agent (backed by GPT-4o-mini and a Cognee company knowledge base tool) generates a contextually grounded reply. The draft is saved to Gmail, then sent to Slack for human approval. An approver clicks Approve or Reject — approved drafts are marked ready to send, rejected ones are flagged for revision. Both outcomes are logged to Google Sheets. A global error handler sends any failure to Slack. ### Setup steps 1. Connect Gmail OAuth2 to New Email Received and Create Gmail Draft. 2. Connect OpenAI API to both OpenAI Chat Model nodes. 3. Connect Cognee API to Search Company Brain (Cognee) — configure your dataset. 4. Connect Slack API to Request Approval in Slack — replace YOUR_SLACK_CHANNEL_ID. 5. Connect Slack OAuth2 to Notify Error in Slack — replace YOUR_SLACK_ERROR_CHANNEL_ID. 6. Connect Google Sheets OAuth2 to Log to Google Sheet — replace YOUR_GOOGLE_SHEET_ID. 7. Activate the Gmail trigger.

The steps

  1. Request Approval in Slack
  2. Approved?
  3. Mark Approved
  4. Mark Rejected
  5. Log to Google Sheet
  6. New Email Received
  7. Is Automated Sender?
  8. Skip - Automated Sender
  9. Classify: Needs Reply?
  10. OpenAI Chat Model (Classifier)
  11. Reply Classification Schema
  12. Needs a Reply?
  13. Skip - No Reply Needed
  14. OpenAI Chat Model (Drafting)

20 steps in total.

Similar automations