Quick overview
This workflow receives new contact form submissions via webhook, normalizes the lead data, assigns a duty attorney in round-robin order, and sends acknowledgments via Twilio SMS (through a compliance guardrail) and SMTP email, plus optional Slack alerts.
How it works
- Receives a POST webhook request when a lead submits your contact form.
- Normalizes the incoming payload into standard lead fields and stops if neither an email address nor a phone number is provided.
- Selects the next duty attorney from the DUTY_ATTORNEYS roster using a persistent round-robin counter.
- Builds a personalized SMS, runs it through the Bar-Compliance Guardrail workflow for opt-out/disclaimer checks, and sends it via Twilio when approved.
- Sends the lead a confirmation email with your booking link via SMTP.
- Emails the assigned attorney with the full lead details and optionally posts the same alert to Slack via an Incoming Webhook URL.
Setup
- Create n8n project variables for DUTY_ATTORNEYS, GUARDRAIL_WORKFLOW_ID, FIRM_NAME, FIRM_FROM_EMAIL, FIRM_EMAIL, FIRM_TWILIO_NUMBER, and FIRM_BOOKING_URL (and optionally FIRM_SLACK_WEBHOOK_URL).
- Add credentials for Twilio (Account SID/Auth Token) and an SMTP email account, and ensure DUTY_ATTORNEYS entries include valid attorney email addresses.
- Deploy and activate the Bar-Compliance Guardrail workflow and set its numeric workflow ID in GUARDRAIL_WORKFLOW_ID.
- Activate this workflow, copy the webhook Production URL, and paste it into your form builder’s webhook/integration settings to send submissions to /new-lead.