{
  "id": "XJyz3uhjx55iLxQb",
  "name": "Property Tour Scheduling Automation (Real Estate)",
  "tags": [],
  "nodes": [
    {
      "id": "ca5c7060-eec9-4d57-9fc2-9d48e825fc07",
      "name": "0. Form Trigger (Property Tour Request)",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "path": "prospect-tour-request",
        "options": {},
        "formTitle": "Property Tour Request",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Full Name"
            },
            {
              "fieldLabel": "Email"
            },
            {
              "fieldLabel": "Phone Number"
            },
            {
              "fieldLabel": "Interested Property ID"
            },
            {
              "fieldLabel": "Property Name (optional)"
            }
          ]
        }
      },
      "description": "Triggers the workflow when a new form submission is received for a property tour request.",
      "typeVersion": 1
    },
    {
      "id": "299f1952-2e91-47ec-9142-a46e63b65c9d",
      "name": "1. Extract Prospect Data",
      "type": "n8n-nodes-base.function",
      "position": [
        260,
        0
      ],
      "parameters": {
        "functionCode": "const formData = items[0].json.body;\n\nconst clientName = formData['Full Name'] || '';\nconst clientEmail = formData['Email'] || '';\nconst clientPhone = formData['Phone Number'] || '';\nconst propertyId = formData['Interested Property ID'] || '';\nconst propertyName = formData['Property Name (optional)'] || `Property #${propertyId}`;\n\nreturn [\n  {\n    json: {\n      clientName: clientName,\n      clientEmail: clientEmail,\n      clientPhone: clientPhone,\n      propertyId: propertyId,\n      propertyName: propertyName\n    }\n  }\n];"
      },
      "description": "Extracts prospect and property details from the form data.",
      "typeVersion": 1
    },
    {
      "id": "2ccaeb4d-f047-4c78-95ef-118a43409587",
      "name": "2. Generate Scheduling Link",
      "type": "n8n-nodes-base.function",
      "position": [
        500,
        0
      ],
      "parameters": {
        "functionCode": "const prospectData = items[0].json;\nconst calendlyBaseLink = 'YOUR_CALENDLY_BASE_LINK_FOR_AGENT'; // Example: https://calendly.com/your-agent-name\n\nconst schedulingLink = `${calendlyBaseLink}?name=${encodeURIComponent(prospectData.clientName)}&email=${encodeURIComponent(prospectData.clientEmail)}&a1=${encodeURIComponent(prospectData.propertyName || '')}`;\n\nreturn [\n  {\n    json: {\n      ...prospectData,\n      schedulingLink: schedulingLink,\n      emailSubject: `Schedule Your Property Tour for ${prospectData.propertyName}`,\n      emailBody: `Hello ${prospectData.clientName},\n\nThank you for your interest in our property: ${prospectData.propertyName}.\n\nPlease use the link below to schedule your property tour at your most convenient time:\n\n<a href=\"${schedulingLink}\">${schedulingLink}</a>\n\nWe look forward to meeting you!\n\nSincerely,\nYour Property Agent Team`\n    }\n  }\n];"
      },
      "description": "Generates a personalized scheduling link for the prospect.",
      "typeVersion": 1
    },
    {
      "id": "ba3afff0-c72b-479f-b805-53c79cc9f59f",
      "name": "3. Send Scheduling Link (Gmail)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        760,
        0
      ],
      "parameters": {
        "subject": "={{ $json.emailSubject }}",
        "additionalFields": {}
      },
      "description": "Sends an email containing the scheduling link to the prospect.",
      "typeVersion": 1
    },
    {
      "id": "858e468e-2714-4595-932b-be6a6685931b",
      "name": "4. Webhook: Schedule Confirmation (Waiting for Confirmation)",
      "type": "n8n-nodes-base.webhook",
      "position": [
        0,
        300
      ],
      "parameters": {
        "path": "calendly-tour-confirm",
        "options": {}
      },
      "description": "Receives a webhook from the scheduling tool (e.g., Calendly) once a tour is scheduled.",
      "typeVersion": 1
    },
    {
      "id": "6c467579-91c4-4c69-90f7-7db4b9f3527d",
      "name": "6. Send Confirmation Notification (Slack to Agent)",
      "type": "n8n-nodes-base.slack",
      "position": [
        500,
        300
      ],
      "parameters": {
        "text": "New property tour scheduled!\n\nProspect: {{ $json.payload.invitee.first_name }} {{ $json.payload.invitee.last_name }} ({{ $json.payload.invitee.email }})\nProperty: {{ $json.payload.event.name }}\nDate & Time: {{ new Date($json.payload.event.start_time).toLocaleString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: '2-digit', minute: '2-digit' }) }}\n\nCalendly Event Link: {{ $json.payload.event.event_show_url }}",
        "channel": "YOUR_AGENT_SLACK_CHANNEL_ID_OR_NAME",
        "attachments": [],
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "description": "Sends a tour confirmation notification to the agent via Slack.",
      "typeVersion": 1
    },
    {
      "id": "038f6c54-7751-4988-8969-35c95c327c78",
      "name": "7. Wait (For Tour Reminder)",
      "type": "n8n-nodes-base.wait",
      "position": [
        760,
        300
      ],
      "parameters": {},
      "description": "Waits until 1 hour before the tour time to send a reminder.",
      "typeVersion": 1
    },
    {
      "id": "b3f2bab3-3bc8-4ad7-b76f-8d1d74c84d9f",
      "name": "8. Send Tour Reminder (Gmail)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1000,
        300
      ],
      "parameters": {
        "subject": "Reminder: Your Property Tour for {{ $json.payload.event.name }}",
        "additionalFields": {}
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "description": "Sends a reminder email to the prospect before the tour.",
      "typeVersion": 1
    },
    {
      "id": "7defe25d-ed6a-430e-8d26-1894c8ef194e",
      "name": "5. Add Event to Agent's Calendar (Google Calendar)",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        260,
        300
      ],
      "parameters": {
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "additionalFields": {}
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "57a198d9-3c80-4c80-8bd7-0d7c058160bb",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -980,
        -60
      ],
      "parameters": {
        "color": 4,
        "width": 860,
        "height": 3060,
        "content": "# Workflow Documentation: Property Tour Scheduling Automation (Real Estate)\n\n## Problem \ud83d\ude29\nManaging property tours manually can be a major bottleneck for real estate agents and agencies, leading to:\n* **Lost Leads:** Slow response times or difficulty coordinating schedules can cause interested prospects to move on.\n* **Scheduling Conflicts:** Manually juggling multiple calendars and prospect availabilities is prone to errors and double-bookings.\n* **Time Consumption:** Agents spend valuable time on administrative tasks like sending follow-ups and reminders instead of focusing on sales.\n* **No-Shows:** Lack of timely reminders can lead to prospects forgetting appointments, wasting agents' time and effort.\n\n## Solution \u2728\nThis n8n workflow automates the entire property tour scheduling process, from initial inquiry to post-confirmation reminders. It ensures prospects can easily book tours at their convenience and agents are always informed, reducing manual effort, minimizing scheduling errors, and improving prospect experience.\n\n## For Who \ud83e\udd1d\n* **Real Estate Agents:** To streamline tour bookings and focus on client interaction.\n* **Real Estate Agencies:** To standardize and automate their lead-to-tour process.\n* **Property Managers:** For efficient scheduling of viewings for rental properties.\n* **Anyone** in real estate looking to enhance client experience and operational efficiency.\n\n## How It Works \u2699\ufe0f\n\nThis workflow streamlines your property tour scheduling into two main automated flows:\n\n### A. Property Tour Request & Automated Scheduling\n1.  **Form Trigger (Property Tour Request):** \ud83d\ude80 The workflow initiates immediately when a prospective client fills out a property tour interest form on your website or a dedicated landing page. This serves as the initial data input point.\n2.  **Extract Prospect Data (Function):** \ud83e\uddf9 This node processes the incoming form data, intelligently extracting essential details such as the prospect's full name, email, phone number, and the specific property they are interested in.\n3.  **Generate Scheduling Link (Function):** \ud83d\udd17 This node dynamically constructs a personalized scheduling link (e.g., from Calendly or another scheduling tool) that is pre-configured to show your agent's real-time availability.\n4.  **Send Scheduling Link (Gmail/SMS):** \ud83d\udce7 An automated email or SMS containing this personalized scheduling link is instantly dispatched to the prospect, allowing them to conveniently select a tour time that fits their schedule and aligns with the agent's availability.\n\n### B. Tour Confirmation & Reminders\n1.  **Webhook: Schedule Confirmation (Waiting for Confirmation):** \u23f3 The workflow patiently waits for a webhook signal from your scheduling tool (e.g., Calendly) confirming that the prospect has successfully selected and confirmed a tour slot.\n2.  **Add Event to Agent's Calendar (Google Calendar):** \ud83d\uddd3\ufe0f Upon confirmation, the property tour event is automatically added to the relevant agent's Google Calendar, complete with all prospect and property details, ensuring no appointments are missed.\n3.  **Send Confirmation Notification (Slack to Agent):** \ud83d\udce2 A detailed notification is sent to the agent's Slack channel or email, immediately informing them about the newly scheduled tour and providing all pertinent information at a glance.\n4.  **Wait (For Tour Reminder):** \u23f1\ufe0f This node intelligently waits for a calculated period (e.g., 1 hour) before the scheduled tour time, ensuring the reminder is sent precisely when it's most impactful.\n5.  **Send Tour Reminder (Gmail/SMS):** \ud83d\udd14 A personalized reminder email or SMS is automatically sent to the prospect a set time before the scheduled tour, significantly helping to reduce no-shows and ensure timely attendance.\n\n## How to Set Up \ud83d\udee0\ufe0f\n\nFollow these steps carefully to get your \"Property Tour Scheduling Automation\" workflow up and running in n8n:\n\n1.  **Import Workflow JSON:**\n    * Open your n8n instance.\n    * Click on 'Workflows' in the left sidebar.\n    * Click the '+' button or 'New' to create a new workflow.\n    * Click the '...' (More Options) icon in the top right.\n    * Select 'Import from JSON' and paste the entire JSON code for this workflow.\n\n2.  **Configure 0. Form Trigger (Property Tour Request):**\n    * Locate the '0. Form Trigger (Property Tour Request)' node.\n    * Activate the workflow. n8n will provide a unique 'Webhook URL'.\n    * **Crucial Step:** Integrate this 'Webhook URL' into your website's property tour request form (e.g., via Elementor Forms, Gravity Forms, or any other form platform). Ensure your form sends data in JSON format.\n    * **Note:** Adjust the 'Form Fields' in this node to precisely match the input fields of your form (e.g., 'Full Name', 'Email', 'Phone Number', 'Interested Property ID', 'Property Name (optional)').\n\n3.  **Configure 1. Extract Prospect Data (Function):**\n    * Locate the '1. Extract Prospect Data' node.\n    * **Adjust Field Names:** Review the `functionCode` within this node. **You MUST adjust the variable assignments (e.g., `formData['Full Name']`, `formData['Interested Property ID']`)** to accurately match the exact field names sent by your *form trigger*. Use the 'Test Workflow' feature in n8n (after submitting a test form entry) to inspect the incoming `items[0].json.body` data structure and make precise adjustments.\n\n4.  **Configure 2. Generate Scheduling Link (Function):**\n    * Locate the '2. Generate Scheduling Link' node.\n    * **Set Base Scheduling URL:** Inside the `functionCode`, **replace `'YOUR_CALENDLY_BASE_LINK_FOR_AGENT'`** with the base URL of your Calendly or other scheduling tool link (e.g., `https://calendly.com/your-agent-name`).\n    * **Adjust Parameters:** If your scheduling tool supports URL parameters for pre-filling information (e.g., prospect name, email), adjust the code to include them (e.g., `?name=${encodeURIComponent(prospectData.clientName)}&email=${encodeURIComponent(prospectData.clientEmail)}`).\n\n5.  **Configure 3. Send Scheduling Link (Gmail):**\n    * Locate the '3. Send Scheduling Link (Gmail)' node.\n    * **Credentials:** Select your existing Gmail OAuth2 credential or click 'Create New' to set one up. Replace `YOUR_GMAIL_CREDENTIAL_ID` with the actual ID or name of your credential from your n8n credentials.\n    * **From Email:** Replace `your-agent-email@example.com` with the desired sending email address for tour requests.\n    * The 'To Email', 'Subject', and 'HTML' body fields will be dynamically populated from the previous 'Function' node.\n    * **(Optional: Switch to SMS):** Delete this Gmail node and add a Twilio node. Configure its credentials, 'From Phone Number', 'To Phone Number' (from prospect data), and 'Message' (include the scheduling link).\n\n6.  **Configure 4. Webhook: Schedule Confirmation (Waiting for Confirmation):**\n    * Locate the '4. Webhook: Schedule Confirmation (Waiting for Confirmation)' node.\n    * Activate the workflow. n8n will provide a unique 'Webhook URL'.\n    * **Crucial Step:** In your scheduling tool (e.g., Calendly), configure a webhook to send data to this n8n URL whenever an event is scheduled or confirmed. This is vital for the workflow to proceed after the prospect selects a time.\n\n7.  **Configure 5. Add Event to Agent's Calendar (Google Calendar):**\n    * Locate the '5. Add Event to Agent's Calendar (Google Calendar)' node.\n    * **Credentials:** Select your existing Google Calendar OAuth2 credential or create a new one. Replace `YOUR_GOOGLE_CALENDAR_CREDENTIAL_ID` with the actual ID or name of your credential.\n    * **Calendar ID:** Replace `YOUR_AGENT_CALENDAR_ID` with the specific calendar ID of the agent where you want to add the event.\n    * **Adjust Event Details:** Ensure 'Event Name', 'Start Date & Time', 'End Date & Time', and 'Description' use the correct expressions to pull data from the incoming scheduling tool webhook (e.g., `{{ $json.payload.event.start_time }}`).\n\n8.  **Configure 6. Send Confirmation Notification (Slack to Agent):**\n    * Locate the '6. Send Confirmation Notification (Slack to Agent)' node.\n    * **Credentials:** Ensure your Slack API credential is selected.\n    * **Channel:** Replace `YOUR_AGENT_SLACK_CHANNEL_ID_OR_NAME` with the exact ID or name of the Slack channel where agents receive tour scheduling notifications (e.g., `#tour-bookings`).\n    * **(Optional: Switch to Email):** Delete this Slack node and add a Gmail or SendGrid node. Configure its credentials, 'To Email' (agent's email), 'Subject', and 'HTML' body.\n\n9.  **Configure 7. Wait (For Tour Reminder):**\n    * Locate the '7. Wait (For Tour Reminder)' node.\n    * **Time Calculation:** The node is set to wait until 1 hour before the scheduled tour start time (`{{ $json.payload.event.start_time }}`).\n    * **Timezone:** **Replace `YOUR_TIMEZONE_LIKE_Asia/Jakarta`** with your actual timezone (e.g., `America/New_York`, `Europe/London`). This is crucial for accurate timing.\n\n10. **Configure 8. Send Tour Reminder (Gmail):**\n    * Locate the '8. Send Tour Reminder (Gmail)' node.\n    * **Credentials:** Ensure your Gmail API credential is selected.\n    * **From Email:** Replace `your-agent-email@example.com` with the sending email address.\n    * **(Optional: Switch to SMS):** Delete this Gmail node and add a Twilio node, configuring it similarly to step 5 for SMS reminders.\n\n11. **Review and Activate:**\n    * Thoroughly review all node configurations. Ensure all placeholder values (like `YOUR_...`) are replaced with your actual information and settings are correct.\n    * Click the 'Save' button in the top right corner.\n    * Finally, toggle the 'Inactive' switch to 'Active' to enable your workflow. \ud83d\udfe2 Your \"Property Tour Scheduling Automation\" workflow is now live, ready to help you manage tours seamlessly!"
      },
      "typeVersion": 1
    },
    {
      "id": "942b5de8-b2ac-4049-a994-94f72adcf96b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -60
      ],
      "parameters": {
        "color": 3,
        "width": 1040,
        "height": 260,
        "content": "## Property Tour Request & Automated Scheduling"
      },
      "typeVersion": 1
    },
    {
      "id": "5d6eafd1-1688-419d-88a1-dca10952fd1f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        240
      ],
      "parameters": {
        "color": 3,
        "width": 1280,
        "height": 260,
        "content": "## Tour Confirmation & Reminders"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "4fda4a0a-1ae5-457e-8f9a-4cb9465257ac",
  "connections": {
    "1. Extract Prospect Data": {
      "main": [
        [
          {
            "node": "2. Generate Scheduling Link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2. Generate Scheduling Link": {
      "main": [
        [
          {
            "node": "3. Send Scheduling Link (Gmail)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7. Wait (For Tour Reminder)": {
      "main": [
        [
          {
            "node": "8. Send Tour Reminder (Gmail)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0. Form Trigger (Property Tour Request)": {
      "main": [
        [
          {
            "node": "1. Extract Prospect Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5. Add Event to Agent's Calendar (Google Calendar)": {
      "main": [
        [
          {
            "node": "6. Send Confirmation Notification (Slack to Agent)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6. Send Confirmation Notification (Slack to Agent)": {
      "main": [
        [
          {
            "node": "7. Wait (For Tour Reminder)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4. Webhook: Schedule Confirmation (Waiting for Confirmation)": {
      "main": [
        [
          {
            "node": "5. Add Event to Agent's Calendar (Google Calendar)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}