Skip to main content

Automated law firm lead management & scheduling with AI, Jotform & Calendar

Workflow preview

Workflow preview
100%
Automated law firm lead management & scheduling with AI, Jotform & Calendar preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Youtube Explanation: https://youtu.be/KgmNiV7SwkU This n8n workflow is designed to automate the initial intake and scheduling for a law firm. It's split into two ma...

Best for

  • Lead Nurturing automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.jotformtrigger, n8n-nodes-base.googlesheets, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatgooglegemini, n8n-nodes-base.whatsapptrigger, n8n-nodes-base.if, n8n-nodes-base.googlecalendartool, @n8n/n8n-nodes-langchain.memorypostgreschat

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by iamvaar.

Original n8n.io source

1.1 Workflow description

Title
Automated law firm lead management & scheduling with AI, Jotform & Calendar
Workflow name
Automated law firm lead management & scheduling with AI, Jotform & Calendar

Youtube Explanation: https://youtu.be/KgmNiV7SwkU

This n8n workflow is designed to automate the initial intake and scheduling for a law firm. It's split into two main parts:

  1. New Inquiry Handling: Kicks off when a potential client fills out a JotForm, saves their data, and sends them an initial welcome message on WhatsApp.
  2. Appointment Scheduling: Activates when the client replies on WhatsApp, allowing an AI agent to chat with them to schedule a consultation.

Here’s a detailed breakdown of the prerequisites and each node.


Prerequisites

Before building this workflow, you'll need accounts and some setup for each of the following services:

JotForm

  • JotForm Account: You need an active JotForm account.
  • A Published Form: Create a form with the exact fields used in the workflow: Full Name, Email Address, Phone Number, I am a..., Legal Service of Interest, Brief Message, and How Did You Hear About Us?.
  • API Credentials: Generate API keys from your JotForm account settings to connect it with n8n.

Google

  • Google Account: To use Google Sheets and Google Calendar.
  • Google Sheet: Create a new sheet named "Law Client Enquiries". The first row must have these exact headers: Full Name, Email Address, Phone Number, client type, Legal Service of Interest, Brief Message, How Did You Hear About Us?.
  • Google Calendar: An active calendar to manage appointments.
  • Google Cloud Project:
    • Service Account Credentials (for Sheets): In the Google Cloud Console, create a service account, generate JSON key credentials, and enable the Google Sheets API. You must then share your Google Sheet with the service account's email address (e.g., [email protected]).
    • OAuth Credentials (for Calendar): Create OAuth 2.0 Client ID credentials to allow n8n to access your calendar on your behalf. You'll need to enable the Google Calendar API.
    • Gemini API Key: Enable the Vertex AI API in your Google Cloud project and generate an API key to use the Google Gemini models.

WhatsApp

  • Meta Business Account: Required to use the WhatsApp Business Platform.
  • WhatsApp Business Platform Account: You need to set up a business account and connect a phone number to it. This is different from the regular WhatsApp or WhatsApp Business app.
  • API Credentials: Get the necessary access tokens and IDs from your Meta for Developers dashboard to connect your business number to n8n.

PostgreSQL Database

  • A running PostgreSQL instance: This can be hosted anywhere (e.g., AWS, DigitalOcean, Supabase). The AI agent needs it to store and retrieve conversation history.
  • Database Credentials: You'll need the host, port, user, password, and database name to connect n8n to it.

Node-by-Node Explanation

The workflow is divided into two distinct logical flows.

Flow 1: New Client Intake from JotForm

This part triggers when a new client submits your form.

  1. JotForm Trigger

    • What it does: This is the starting point. It automatically runs the workflow whenever a new submission is received for the specified JotForm (Form ID: 252801824783057).
    • Prerequisites: A JotForm account and a created form.
  2. Append or update row in sheet (Google Sheets)

    • What it does: It takes the data from the JotForm submission and adds it to your "Law Client Enquiries" Google Sheet.
    • How it works: It uses the appendOrUpdate operation. It tries to find a row where the "Email Address" column matches the email from the form. If it finds a match, it updates that row; otherwise, it appends a new row at the bottom.
    • Prerequisites: A Google Sheet with the correct headers, shared with your service account.
  3. AI Agent

    • What it does: This node crafts the initial welcome message to be sent to the client.
    • How it works: It uses a detailed prompt that defines a persona ("Alex," a legal intake assistant) and instructs the AI to generate a professional WhatsApp message. It dynamically inserts the client's name and service of interest from the Google Sheet data into the prompt.
    • Connected Node: It's powered by the Google Gemini Chat Model.
  4. Send message (WhatsApp)

    • What it does: It sends the message generated by the AI Agent to the client.
    • How it works: It takes the client's phone number from the data (Phone Number column) and the AI-generated text (output from the AI Agent node) to send the message via the WhatsApp Business API.
    • Prerequisites: A configured WhatsApp Business Platform account.

Flow 2: AI-Powered Scheduling via WhatsApp

This part triggers when the client replies to the initial message.

  1. WhatsApp Trigger

    • What it does: This node listens for incoming messages on your business's WhatsApp number. When a client replies, it starts this part of the workflow.
    • Prerequisites: A configured WhatsApp Business Platform account.
  2. If node

    • What it does: It acts as a simple filter. It checks if the incoming message text is empty. If it is (e.g., a status update), the workflow stops. If it contains text, it proceeds to the AI agent.
  3. AI Agent1

    • What it does: This is the main conversational brain for scheduling. It handles the back-and-forth chat with the client.
    • How it works: Its prompt is highly detailed, instructing it to act as "Alex" and follow a strict procedure for scheduling. It has access to several "tools" to perform actions.
    • Connected Nodes:
      • Google Gemini Chat Model1: The language model that does the thinking.
      • Postgres Chat Memory: Remembers the conversation history with a specific user (keyed by their WhatsApp ID), so the user doesn't have to repeat themselves.
      • Tools: Know about the user enquiry, GET MANY EVENTS..., and Create an event.
  4. AI Agent Tools (What the AI can do)

    • Know about the user enquiry (Google Sheets Tool): When the AI needs to know who it's talking to, it uses this tool. It takes the user's phone number and looks up their original enquiry details in the "Law Client Enquiries" sheet.
    • GET MANY EVENTS... (Google Calendar Tool): When a client suggests a date, the AI uses this tool to check your Google Calendar for any existing events on that day to see if you're free.
    • Create an event (Google Calendar Tool): Once a time is agreed upon, the AI uses this tool to create the event in your Google Calendar, adding the client as an attendee.
  5. Send message1 (WhatsApp)

    • What it does: Sends the AI's response back to the client. This could be a confirmation that the meeting is booked, a question asking for their email, or a suggestion for a different time if the requested slot is busy.
    • How it works: It sends the output text from AI Agent1 to the client's WhatsApp ID, continuing the conversation.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - JotForm Trigger

Type / Role
n8n-nodes-base.jotFormTrigger - jotFormTrigger
Config choices
Version 1

Block 2 - Append or update row in sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 3 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 4 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 5 - WhatsApp Trigger

Type / Role
n8n-nodes-base.whatsAppTrigger - whatsAppTrigger
Config choices
Version 1

Block 6 - If

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 7 - GET MANY EVENTS OF DAY THE USER ASKED

Type / Role
n8n-nodes-base.googleCalendarTool - googleCalendarTool
Config choices
Version 1.3

Block 8 - Create an event

Type / Role
n8n-nodes-base.googleCalendarTool - googleCalendarTool
Config choices
Version 1.3

Block 9 - Google Gemini Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 10 - AI Agent1

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 11 - Postgres Chat Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryPostgresChat - memoryPostgresChat
Config choices
Version 1.3

Block 12 - Know about the user enquiry

Type / Role
n8n-nodes-base.googleSheetsTool - googleSheetsTool
Config choices
Version 4.7

Block 13 - Send message

Type / Role
n8n-nodes-base.whatsApp - whatsApp
Config choices
Version 1

Block 14 - Send message1

Type / Role
n8n-nodes-base.whatsApp - whatsApp
Config choices
Version 1

Block 15 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Automated law firm lead management & scheduling with AI, Jotform & Calendar
Complexity advanced
Nodes 16
Categories Lead Nurturing, AI Chatbot
Author iamvaar
Published 08 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9383/9383.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automated law firm lead management & scheduling with AI, Jotform & Calendar do?

Youtube Explanation: https://youtu.be/KgmNiV7SwkU This n8n workflow is designed to automate the initial intake and scheduling for a law firm. It's split into two ma...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Lead Nurturing, AI Chatbot use case.