{
  "schema_version": "1.0.0",
  "id": "pipedrive-form-lead-score",
  "title": "Score a form lead into Pipedrive",
  "category": "lead-gen-crm",
  "difficulty": "intermediate",
  "featured": true,
  "description": "Score a Webflow enquiry, create the Pipedrive person and deal, and schedule a call within the hour for hot and warm leads.",
  "tags": [
    "leads",
    "pipedrive",
    "webflow",
    "lead-scoring",
    "speed-to-lead"
  ],
  "apps": [
    "Webflow",
    "Code by Zapier",
    "Pipedrive",
    "Filter by Zapier"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 5 steps after the trigger",
      "Filter by Zapier"
    ]
  },
  "tasks": {
    "typical": 4,
    "max": 4
  },
  "trigger": {
    "app": "Webflow",
    "event": "New Form Submission",
    "kind": "instant",
    "title": "Contact sales form submitted",
    "why": "Fires when the Contact sales form on your Webflow site is submitted.",
    "config": {
      "Site": "YOUR_WEBFLOW_SITE",
      "Form": "Contact sales"
    },
    "outputs": [
      "submission_id",
      "form_name",
      "site_name",
      "submitted_at",
      "name",
      "email",
      "company",
      "role",
      "team_size",
      "budget",
      "timeline",
      "message"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "score",
      "kind": "code",
      "app": "Code by Zapier",
      "event": "Run JavaScript",
      "title": "Score the lead",
      "why": "Scores work email, role, team size, budget, and timeline, and returns the reasons so the deal note explains itself.",
      "code": {
        "language": "javascript",
        "module": "score-lead",
        "file": "code/score-lead.js"
      },
      "input_data": {
        "email": "{{trigger.email}}",
        "company": "{{trigger.company}}",
        "job_title": "{{trigger.role}}",
        "company_size": "{{trigger.team_size}}",
        "budget": "{{trigger.budget}}",
        "timeline": "{{trigger.timeline}}",
        "message": "{{trigger.message}}"
      },
      "outputs": [
        "score",
        "tier",
        "reasons",
        "is_work_email"
      ]
    },
    {
      "key": "person",
      "kind": "action",
      "app": "Pipedrive",
      "event": "Create Person",
      "title": "Create the person",
      "why": "The person holds the contact details; the deal below links to it.",
      "fields": {
        "Name": "{{trigger.name}}",
        "Email": "{{trigger.email}}",
        "Organization Name": "{{trigger.company}}",
        "Owner": "YOUR_PIPEDRIVE_USER"
      },
      "outputs": [
        "id",
        "name"
      ]
    },
    {
      "key": "deal",
      "kind": "action",
      "app": "Pipedrive",
      "event": "Create Deal",
      "title": "Open a deal in the first stage",
      "why": "A deal puts the lead in the pipeline view, with the score and tier in the title so the board is sortable at a glance.",
      "fields": {
        "Title": "{{trigger.company}} ({{score.tier}}, {{score.score}})",
        "Person": "{{person.id}}",
        "Pipeline": "Sales",
        "Stage": "Lead in",
        "Value": "{{trigger.budget}}",
        "Currency": "USD",
        "Lead score (custom field)": "{{score.score}}",
        "Score reasons (custom field)": "{{score.reasons}}"
      },
      "outputs": [
        "id",
        "title"
      ]
    },
    {
      "key": "worth",
      "kind": "filter",
      "app": "Filter by Zapier",
      "event": "Only continue if...",
      "title": "Only hot or warm leads",
      "why": "Cold leads stay in the pipeline without a scheduled call. Most leads that fill in a contact-sales form score warm or better, so most runs continue.",
      "conditions": [
        [
          {
            "field": "{{score.tier}}",
            "operator": "(Text) Exactly matches",
            "value": "hot"
          }
        ],
        [
          {
            "field": "{{score.tier}}",
            "operator": "(Text) Exactly matches",
            "value": "warm"
          }
        ]
      ],
      "usually": true
    },
    {
      "key": "call",
      "kind": "action",
      "app": "Pipedrive",
      "event": "Create Activity",
      "title": "Schedule a call within the hour",
      "why": "An activity due today lands on the owner's Pipedrive to-do list, which is where reps actually look.",
      "fields": {
        "Subject": "Call {{trigger.name}} within the hour ({{score.tier}} lead)",
        "Type": "call",
        "Due Date": "today",
        "Duration": "00:15",
        "Deal": "{{deal.id}}",
        "Person": "{{person.id}}",
        "Note": "Form message: {{trigger.message}}\nScore reasons: {{score.reasons}}"
      },
      "outputs": [
        "id"
      ]
    }
  ]
}
