Quick overview
This workflow monitors Gmail for new messages, uses Anthropic Claude to classify and summarize them, then routes outcomes to Gmail (drafts/labels/archive), Slack alerts, Airtable task creation, and Google Sheets logging, with optional deduplication via a Supabase/Airtable HTTP endpoint.
How it works
- Polls Gmail every minute for new incoming emails.
- Extracts key fields (message ID, thread ID, sender, subject, body, and received date) and optionally checks an external endpoint to avoid processing the same message twice.
- Sends the email content to Anthropic Claude to classify it (Urgent/Important/Normal/Promotional) and return a JSON summary, action items, response requirement, and sentiment.
- Labels, archives, and logs Promotional emails to a Google Sheets tab.
- Drafts a reply with Anthropic Claude for Urgent, Important, and Normal emails and saves it as a Gmail draft in the original thread.
- Sends a Slack alert and creates an Airtable task for non-Normal emails, while logging Normal emails to Google Sheets.
- Calls an external endpoint to mark the message as processed for future deduplication.
Setup
- Connect your Gmail OAuth2 credential and verify the trigger is monitoring the correct mailbox.
- Add an Anthropic API key (as an HTTP header credential) and ensure the request headers include
x-api-key, anthropic-version, and content-type.
- Connect Slack OAuth2 and replace
REPLACE_WITH_URGENT_CHANNEL_ID and REPLACE_WITH_GENERAL_CHANNEL_ID with your channel IDs.
- Connect Airtable and replace
REPLACE_WITH_YOUR_AIRTABLE_BASE_ID and REPLACE_WITH_YOUR_TASKS_TABLE_ID, ensuring the table has fields matching the mapped columns (Due, From, Title, Status, Summary, Category, Action Items).
- Connect Google Sheets and replace
REPLACE_WITH_YOUR_SHEET_ID, creating the “Promotional Log” and “Normal Log” sheet tabs.
- (Optional) Replace the placeholder Supabase/Airtable HTTP endpoints for the check and mark-processed steps with your own deduplication service keyed by
messageId.