Quick overview
This workflow monitors a Google Sheets patient intake log, uses Anthropic Claude to decide the right follow-up action and draft an email, sends the message via Gmail, optionally notifies a clinic manager in Slack for re-bookings, and appends each communication to a Google Sheets log.
How it works
- Triggers when a new patient row appears in a Google Sheets intake spreadsheet.
- Loads clinic settings (sheet IDs, clinic name, booking link, sender email, and Slack channel) and formats the patient record into a prompt.
- Sends the prompt to Anthropic Claude (Sonnet) to return a JSON plan with an action, urgency, email subject/body, and a short reason.
- Parses Claude’s JSON response and falls back to a default follow-up message if parsing fails.
- Routes the patient to the correct branch and sends a plain-text email via Gmail (welcome, re-booking, or follow-up).
- For re-booking emails, posts a Slack notification to the clinic manager with patient details for manual confirmation.
- Appends a row to a Google Sheets communications log with the action, status, urgency, timestamp, and email details.
Setup
- Connect credentials for Google Sheets, Gmail, Slack, and Anthropic (Claude) in n8n.
- Update the configuration values for INTAKE_SHEET_ID, LOG_SHEET_ID, LOG_SHEET_NAME, SLACK_CHANNEL_ID, CLINIC_NAME, BOOKING_LINK, and SENDER_EMAIL.
- Ensure your intake sheet contains the expected fields (for example Patient Name, Email, Contact Reason, Appointment Status, Last Visit, and Notes) and create a communications log sheet with matching columns for the appended data.