Quick Overview
This workflow polls Gmail for new inbox emails, looks up the sender in Stripe to classify them as a customer or non-customer, uses OpenAI plus Google Docs playbooks to draft a reply, and posts the draft to Slack for human review while sending an immediate confirmation email.
How it works
- Triggers every minute when new emails arrive in Gmail and processes only messages labeled INBOX.
- Retrieves the full Gmail message and its thread history, then formats a transcript and counts prior exchanges for escalation context.
- Parses the sender name/email and searches Stripe for a matching customer record.
- Fetches the appropriate Google Docs support playbook, builds a confirmation email, and sends the acknowledgement via the Gmail API.
- Uses OpenAI (GPT-4.1-mini) to generate a structured JSON draft reply (intent, sentiment, escalation flags, and HTML email body) using the email content, thread context, and (if available) Stripe customer details.
- Creates a Gmail draft reply in the original thread and converts the HTML draft into Slack mrkdwn.
- Posts the draft, classification, and escalation notes to a configured Slack channel for approval.
Setup
- Connect credentials for Gmail (Gmail Trigger and Gmail draft/thread nodes) and Google OAuth2 for the Gmail API send requests.
- Add Stripe API credentials and ensure the workflow can query customers by email.
- Add Google Docs OAuth2 credentials and replace BOTH playbook document URLs with your Google Doc IDs.
- Add an OpenAI API key (or replace the OpenAI chat model nodes with your preferred provider).
- Add Slack credentials and replace BOTH Slack channel IDs with the channel where reviewers should receive draft notifications.
- Update the Settings values (company name, support from-address, support email addresses list, SLA text, and escalation threshold) to match your support setup.