{
  "version": "1.0.0",
  "snapshot_name": "Condo Intel — Workflow Pack",
  "generated_by": "Condo Intel v2.1",
  "generated_at": "2026-06-04",
  "compatible_with": "GoHighLevel Workflows v2 (2024+)",
  "notes": "This JSON is a portable workflow specification, not a GHL-internal export. GHL's native workflow export format is account-bound and not portable across sub-accounts. If you imported a snapshot and one or both workflows don't appear, build them manually using the steps in snapshot/README.md — every field, branch, and merge tag is documented.",
  "contact_custom_fields_required": [
    { "name": "Condo Intel Payload", "type": "TEXTAREA", "description": "Full JSON payload from Condo Intel webhook — for audit + advanced templating" },
    { "name": "Condo Intel Deal ID", "type": "SINGLE_LINE", "description": "Unique deal identifier in Condo Intel" },
    { "name": "Condo Intel Deal URL", "type": "URL", "description": "Direct link back to the deal in Condo Intel" },
    { "name": "Condo Intel Buyer Name", "type": "SINGLE_LINE" },
    { "name": "Condo Intel Seller Name", "type": "SINGLE_LINE" },
    { "name": "Condo Intel Property Address", "type": "SINGLE_LINE" },
    { "name": "Condo Intel Association Name", "type": "SINGLE_LINE" },
    { "name": "Condo Intel Management Company", "type": "SINGLE_LINE" },
    { "name": "Condo Intel Sale Price USD", "type": "NUMBER" },
    { "name": "Condo Intel Application Deadline", "type": "DATE" },
    { "name": "Condo Intel Approval Deadline", "type": "DATE" },
    { "name": "Condo Intel Closing Date", "type": "DATE" },
    { "name": "Condo Intel MLS Number", "type": "SINGLE_LINE" },
    { "name": "Condo Intel Listing Agent Name", "type": "SINGLE_LINE" },
    { "name": "Condo Intel Listing Brokerage", "type": "SINGLE_LINE" },
    { "name": "Condo Intel Buyer Agent Name", "type": "SINGLE_LINE" },
    { "name": "Condo Intel Buyer Brokerage", "type": "SINGLE_LINE" },
    { "name": "Condo Intel Lender Name", "type": "SINGLE_LINE" },
    { "name": "Condo Intel Title Company", "type": "SINGLE_LINE" },
    { "name": "Condo Intel Sender Name", "type": "SINGLE_LINE" },
    { "name": "Condo Intel Sender Brokerage", "type": "SINGLE_LINE" },
    { "name": "Condo Intel Sender Email", "type": "EMAIL" },
    { "name": "Condo Intel Template Key", "type": "SINGLE_LINE", "description": "Discriminator for which template to send (Party Outreach workflow)" }
  ],
  "workflows": [
    {
      "id": "condo-intel-hoa-application-request",
      "name": "Condo Intel — HOA Application Request",
      "description": "Receives an HOA application request webhook from Condo Intel. Creates/updates the management-company contact, populates all Condo Intel custom fields, sends the branded application email, and follows up after 5 days if no response is recorded.",
      "trigger": {
        "type": "INBOUND_WEBHOOK",
        "expected_payload": {
          "tenant_id": "string",
          "deal_id": "string",
          "deal_url": "string",
          "template_key": "string (typically 'hoa_application_request')",
          "to": { "email": "string", "name": "string", "phone": "string" },
          "from": { "name": "string", "email": "string", "brokerage": "string", "phone": "string" },
          "buyer_name": "string",
          "seller_name": "string",
          "property_address": "string",
          "association_name": "string",
          "management_company": "string",
          "sale_price_usd": "number",
          "application_deadline": "ISO date",
          "approval_deadline": "ISO date",
          "closing_date": "ISO date",
          "deal_token": "string"
        }
      },
      "steps": [
        {
          "order": 1,
          "type": "FIND_OR_CREATE_CONTACT",
          "match_by": "{{trigger.body.to.email}}",
          "create_with": {
            "email": "{{trigger.body.to.email}}",
            "name": "{{trigger.body.to.name}}",
            "phone": "{{trigger.body.to.phone}}",
            "tags": ["condo-intel", "hoa-management-company"]
          }
        },
        {
          "order": 2,
          "type": "UPDATE_CONTACT_CUSTOM_FIELDS",
          "mappings": {
            "Condo Intel Payload": "{{trigger.body}}",
            "Condo Intel Deal ID": "{{trigger.body.deal_id}}",
            "Condo Intel Deal URL": "{{trigger.body.deal_url}}",
            "Condo Intel Buyer Name": "{{trigger.body.buyer_name}}",
            "Condo Intel Seller Name": "{{trigger.body.seller_name}}",
            "Condo Intel Property Address": "{{trigger.body.property_address}}",
            "Condo Intel Association Name": "{{trigger.body.association_name}}",
            "Condo Intel Management Company": "{{trigger.body.management_company}}",
            "Condo Intel Sale Price USD": "{{trigger.body.sale_price_usd}}",
            "Condo Intel Application Deadline": "{{trigger.body.application_deadline}}",
            "Condo Intel Approval Deadline": "{{trigger.body.approval_deadline}}",
            "Condo Intel Closing Date": "{{trigger.body.closing_date}}",
            "Condo Intel Sender Name": "{{trigger.body.from.name}}",
            "Condo Intel Sender Brokerage": "{{trigger.body.from.brokerage}}",
            "Condo Intel Sender Email": "{{trigger.body.from.email}}",
            "Condo Intel Template Key": "{{trigger.body.template_key}}"
          }
        },
        {
          "order": 3,
          "type": "IF_ELSE",
          "condition": "{{trigger.body.to.email}} is not empty",
          "then": [
            {
              "type": "SEND_EMAIL",
              "from_name": "{{contact.custom_field.condo_intel_sender_name}}",
              "from_email": "{{contact.custom_field.condo_intel_sender_email}}",
              "to": "{{contact.email}}",
              "subject": "Condo board application — {{contact.custom_field.condo_intel_property_address}}",
              "body_html_source": "Condo Intel admin → Email Templates → 'HOA Application Request'",
              "fallback_body_html": "<p>Hello {{contact.name}},</p><p>We're representing {{contact.custom_field.condo_intel_buyer_name}} on the purchase of unit at {{contact.custom_field.condo_intel_property_address}} ({{contact.custom_field.condo_intel_association_name}}).</p><p>Please send the current condo board application packet along with the application fee, estoppel cost, and any other documentation the buyer needs to submit. We're targeting an approval deadline of {{contact.custom_field.condo_intel_approval_deadline}} with closing on {{contact.custom_field.condo_intel_closing_date}}.</p><p>If you can confirm receipt and send the packet at your earliest convenience, it would be appreciated.</p><p>Thank you,<br>{{contact.custom_field.condo_intel_sender_name}}<br>{{contact.custom_field.condo_intel_sender_brokerage}}</p>"
            },
            {
              "type": "WAIT",
              "duration_days": 5
            },
            {
              "type": "IF_ELSE",
              "condition": "{{contact.custom_field.condo_intel_application_status}} == 'requested'",
              "then": [
                {
                  "type": "SEND_EMAIL",
                  "subject": "Following up — condo board application for {{contact.custom_field.condo_intel_property_address}}",
                  "body_html_source": "Condo Intel admin → Email Templates → 'HOA Application Follow-up'",
                  "fallback_body_html": "<p>Hi {{contact.name}},</p><p>Following up on the request below for the condo board application for {{contact.custom_field.condo_intel_property_address}}. With our approval deadline of {{contact.custom_field.condo_intel_approval_deadline}} approaching, any update would be much appreciated.</p><p>Thanks,<br>{{contact.custom_field.condo_intel_sender_name}}</p>"
                }
              ]
            }
          ],
          "else": [
            {
              "type": "INTERNAL_NOTIFICATION",
              "to": "{{trigger.body.from.email}}",
              "subject": "Condo Intel: HOA management contact missing for {{trigger.body.property_address}}",
              "body": "Condo Intel tried to send the HOA application request for {{trigger.body.property_address}}, but the management company email was missing. Please update the association record in Condo Intel and click 'Request HOA Application' again."
            }
          ]
        }
      ]
    },
    {
      "id": "condo-intel-party-outreach",
      "name": "Condo Intel — Party Outreach",
      "description": "Receives a party-outreach webhook from Condo Intel. Routes to the right send based on template_key. Used for buyer welcome, seller welcome, agent briefings, lender intake, title intake, and general notifications.",
      "trigger": {
        "type": "INBOUND_WEBHOOK",
        "expected_payload": {
          "tenant_id": "string",
          "deal_id": "string",
          "deal_url": "string",
          "template_key": "string (welcome_buyer | welcome_seller | agent_brief | lender_intake | title_intake | general_notification)",
          "party_type": "string (buyer | seller | buyer_agent | listing_agent | lender | title | other)",
          "to": { "email": "string", "name": "string", "phone": "string" },
          "from": { "name": "string", "email": "string", "brokerage": "string", "phone": "string" },
          "buyer_name": "string",
          "seller_name": "string",
          "property_address": "string",
          "association_name": "string",
          "sale_price_usd": "number",
          "application_deadline": "ISO date",
          "approval_deadline": "ISO date",
          "closing_date": "ISO date"
        }
      },
      "steps": [
        {
          "order": 1,
          "type": "FIND_OR_CREATE_CONTACT",
          "match_by": "{{trigger.body.to.email}}",
          "create_with": {
            "email": "{{trigger.body.to.email}}",
            "name": "{{trigger.body.to.name}}",
            "phone": "{{trigger.body.to.phone}}",
            "tags": ["condo-intel", "{{trigger.body.party_type}}"]
          }
        },
        {
          "order": 2,
          "type": "UPDATE_CONTACT_CUSTOM_FIELDS",
          "mappings": {
            "Condo Intel Payload": "{{trigger.body}}",
            "Condo Intel Deal ID": "{{trigger.body.deal_id}}",
            "Condo Intel Deal URL": "{{trigger.body.deal_url}}",
            "Condo Intel Buyer Name": "{{trigger.body.buyer_name}}",
            "Condo Intel Seller Name": "{{trigger.body.seller_name}}",
            "Condo Intel Property Address": "{{trigger.body.property_address}}",
            "Condo Intel Association Name": "{{trigger.body.association_name}}",
            "Condo Intel Sale Price USD": "{{trigger.body.sale_price_usd}}",
            "Condo Intel Application Deadline": "{{trigger.body.application_deadline}}",
            "Condo Intel Approval Deadline": "{{trigger.body.approval_deadline}}",
            "Condo Intel Closing Date": "{{trigger.body.closing_date}}",
            "Condo Intel Template Key": "{{trigger.body.template_key}}",
            "Condo Intel Sender Name": "{{trigger.body.from.name}}",
            "Condo Intel Sender Brokerage": "{{trigger.body.from.brokerage}}",
            "Condo Intel Sender Email": "{{trigger.body.from.email}}"
          }
        },
        {
          "order": 3,
          "type": "SWITCH",
          "field": "{{trigger.body.template_key}}",
          "branches": {
            "welcome_buyer": [
              {
                "type": "SEND_EMAIL",
                "subject": "Welcome — your condo at {{contact.custom_field.condo_intel_property_address}}",
                "body_html_source": "Condo Intel admin → Email Templates → 'Buyer Welcome'",
                "fallback_body_html": "<p>Hi {{contact.name}},</p><p>Excited to start work on your purchase at {{contact.custom_field.condo_intel_property_address}}. Here's what's coming next:</p><ul><li>Application packet to {{contact.custom_field.condo_intel_association_name}} — going out this week.</li><li>Approval target: {{contact.custom_field.condo_intel_approval_deadline}}.</li><li>Closing: {{contact.custom_field.condo_intel_closing_date}}.</li></ul><p>Track everything live at {{contact.custom_field.condo_intel_deal_url}}.</p><p>{{contact.custom_field.condo_intel_sender_name}}<br>{{contact.custom_field.condo_intel_sender_brokerage}}</p>"
              }
            ],
            "welcome_seller": [
              {
                "type": "SEND_EMAIL",
                "subject": "Listing kickoff — {{contact.custom_field.condo_intel_property_address}}",
                "body_html_source": "Condo Intel admin → Email Templates → 'Seller Welcome'",
                "fallback_body_html": "<p>Hi {{contact.name}},</p><p>Listing is officially live. We're already prepping HOA paperwork for the eventual buyer so we can move fast when an offer lands.</p><p>{{contact.custom_field.condo_intel_sender_name}}</p>"
              }
            ],
            "agent_brief": [
              {
                "type": "SEND_EMAIL",
                "subject": "{{contact.custom_field.condo_intel_property_address}} — coordinator briefing",
                "body_html_source": "Condo Intel admin → Email Templates → 'Agent Brief'",
                "fallback_body_html": "<p>Hi {{contact.name}},</p><p>Quick brief on {{contact.custom_field.condo_intel_property_address}}:</p><ul><li>Buyer: {{contact.custom_field.condo_intel_buyer_name}}</li><li>Approval deadline: {{contact.custom_field.condo_intel_approval_deadline}}</li><li>Closing: {{contact.custom_field.condo_intel_closing_date}}</li></ul><p>Live dashboard: {{contact.custom_field.condo_intel_deal_url}}</p>"
              }
            ],
            "lender_intake": [
              {
                "type": "SEND_EMAIL",
                "subject": "Lender intake — {{contact.custom_field.condo_intel_buyer_name}} / {{contact.custom_field.condo_intel_property_address}}",
                "body_html_source": "Condo Intel admin → Email Templates → 'Lender Intake'",
                "fallback_body_html": "<p>Hi {{contact.name}},</p><p>Looping you in on a new condo file. Loan details and timeline below — please confirm receipt and let us know what you need from the buyer.</p><p>Approval target: {{contact.custom_field.condo_intel_approval_deadline}}<br>Closing: {{contact.custom_field.condo_intel_closing_date}}</p>"
              }
            ],
            "title_intake": [
              {
                "type": "SEND_EMAIL",
                "subject": "Title intake — {{contact.custom_field.condo_intel_property_address}}",
                "body_html_source": "Condo Intel admin → Email Templates → 'Title Intake'",
                "fallback_body_html": "<p>Hi {{contact.name}},</p><p>New file: {{contact.custom_field.condo_intel_property_address}}. Closing target {{contact.custom_field.condo_intel_closing_date}}. Reach out with any questions.</p>"
              }
            ],
            "general_notification": [
              {
                "type": "SEND_EMAIL",
                "subject": "Update on {{contact.custom_field.condo_intel_property_address}}",
                "body_html_source": "Condo Intel admin → Email Templates → 'General Notification'",
                "fallback_body_html": "<p>Hi {{contact.name}},</p><p>Update on {{contact.custom_field.condo_intel_property_address}}. Full details in the deal: {{contact.custom_field.condo_intel_deal_url}}.</p>"
              }
            ]
          }
        }
      ]
    }
  ]
}
