Log and thank legal referrals with webhooks, Google Sheets, and email digests
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
Nodes used (10)
- Webhook
n8n-nodes-base.webhook - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - No Operation, do nothing
n8n-nodes-base.noOp - Google Sheets
n8n-nodes-base.googleSheets - Execute Sub-workflow
n8n-nodes-base.executeWorkflow - Send Email
n8n-nodes-base.emailSend - Schedule Trigger
n8n-nodes-base.scheduleTrigger - Filter
n8n-nodes-base.filter - Aggregate
n8n-nodes-base.aggregate
What it does
Quick Overview This workflow captures referral form submissions via a webhook, logs them to Google Sheets, sends compliant thank-you emails to referrers via a guardrail sub-workflow, and notifies your firm by email, then runs monthly to analyze the ledger and email a reciprocal-referral reminder digest. How it works 1. Receives referral form submissions via a webhook endpoint. 2. Normalizes the incoming payload, validates that referrer details exist, and appends valid referrals to a Google Sheets “Referrals” ledger. 3. If a referrer email is present, generates a plain-text thank-you message and sends it through a compliance/opt-out guardrail workflow before sending via SMTP. 4. Emails the firm a referral summary via SMTP regardless of whether a thank-you was sent, skipped, or suppressed. 5. On the 1st of each month, reads the full Google Sheets referral ledger and calculates per-referrer referral counts for the last 90 days. 6. Filters referrers who meet the repeat-referral threshold, builds a digest reminder email, logs it via the guardrail workflow, and sends the reminder to the firm via SMTP. Setup 1. Create a Google Sheets spreadsheet with a “Referrals” tab and headers (date, leadname, leademail, referrername, referreremail, referrertype, mattertype, status), add a Google Sheets OAuth2 credential, and set the REFERRALLEDGERSHEETID variable. 2. Add an SMTP credential for sending emails and set the FIRMFROMEMAIL and FIRMEMAIL variables. 3. Set the FIRMNAME variable and provide a GUARDRAILWORKFLOWID variable that points to your compliance/opt-out guardrail sub-workflow. 4. Copy the production webhook URL from the webhook trigger after activation and paste it into your referral form tool’s webhook/notification settings. 5. Review the monthly schedule (cron set to 8:00 on the 1st) and adjust it to match your timezone and preferred send time.