{
  "schema_version": "1.0.0",
  "id": "airtable-lead-dedupe",
  "title": "Log Webflow leads in Airtable without duplicates",
  "category": "lead-gen-crm",
  "difficulty": "intermediate",
  "featured": false,
  "description": "Search Airtable for the enquiry email first, then either create a new lead record or update the existing one with the latest message.",
  "tags": [
    "leads",
    "airtable",
    "webflow",
    "deduplication"
  ],
  "apps": [
    "Webflow",
    "Airtable",
    "Paths by Zapier"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 4 steps after the trigger",
      "Paths by Zapier"
    ]
  },
  "tasks": {
    "typical": 2,
    "max": 2
  },
  "trigger": {
    "app": "Webflow",
    "event": "New Form Submission",
    "kind": "instant",
    "title": "Project enquiry submitted",
    "why": "Fires for each submission of the project enquiry form.",
    "config": {
      "Site": "YOUR_WEBFLOW_SITE",
      "Form": "Start a project"
    },
    "outputs": [
      "submission_id",
      "form_name",
      "site_name",
      "submitted_at",
      "name",
      "email",
      "company",
      "project_type",
      "budget",
      "message"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "find",
      "kind": "search",
      "app": "Airtable",
      "event": "Find Record",
      "title": "Look for the email in the Leads table",
      "why": "Searches the Email field, so the Zap knows if this person is already a lead.",
      "fields": {
        "Base": "YOUR_AIRTABLE_BASE",
        "Table": "Leads",
        "Search by Field": "Email",
        "Search Value": "{{trigger.email}}",
        "Should this step be considered a \"success\" when nothing is found?": "Yes"
      },
      "outputs": [
        "id",
        "_zap_search_was_found_status",
        "Status"
      ]
    },
    {
      "key": "route",
      "kind": "paths",
      "app": "Paths by Zapier",
      "event": "Split into paths",
      "title": "New lead or returning",
      "why": "Exactly one path runs, based on the search.",
      "paths": [
        {
          "name": "New lead",
          "conditions": [
            [
              {
                "field": "{{find._zap_search_was_found_status}}",
                "operator": "(Boolean) Is false"
              }
            ]
          ],
          "usually": true,
          "steps": [
            {
              "key": "create",
              "kind": "action",
              "app": "Airtable",
              "event": "Create Record",
              "title": "Create the lead record",
              "why": "A full record for a first-time enquiry.",
              "fields": {
                "Base": "YOUR_AIRTABLE_BASE",
                "Table": "Leads",
                "Name": "{{trigger.name}}",
                "Email": "{{trigger.email}}",
                "Company": "{{trigger.company}}",
                "Project type": "{{trigger.project_type}}",
                "Budget": "{{trigger.budget}}",
                "Latest message": "{{trigger.message}}",
                "Status": "New",
                "First enquiry": "{{trigger.submitted_at}}",
                "Last enquiry": "{{trigger.submitted_at}}"
              },
              "outputs": [
                "id"
              ]
            }
          ]
        },
        {
          "name": "Returning lead",
          "conditions": [
            [
              {
                "field": "{{find._zap_search_was_found_status}}",
                "operator": "(Boolean) Is true"
              }
            ]
          ],
          "usually": false,
          "steps": [
            {
              "key": "update",
              "kind": "action",
              "app": "Airtable",
              "event": "Update Record",
              "title": "Update the existing record",
              "why": "Keeps one record per person; the status the team set by hand is left alone.",
              "fields": {
                "Base": "YOUR_AIRTABLE_BASE",
                "Table": "Leads",
                "Record": "{{find.id}}",
                "Latest message": "{{trigger.message}}",
                "Last enquiry": "{{trigger.submitted_at}}",
                "Project type": "{{trigger.project_type}}"
              },
              "outputs": [
                "id"
              ]
            }
          ]
        }
      ]
    }
  ]
}
