{
  "schema_version": "1.0.0",
  "id": "pipedrive-person-firmographics",
  "title": "Add company firmographics to a new Pipedrive person",
  "category": "scraping-enrichment",
  "difficulty": "beginner",
  "featured": false,
  "description": "When a person with a work email is added in Pipedrive, look the company up in Apollo and pin a note with industry, headcount, and location.",
  "tags": [
    "pipedrive",
    "apollo",
    "enrichment",
    "crm"
  ],
  "apps": [
    "Pipedrive",
    "Code by Zapier",
    "Filter by Zapier",
    "Apollo"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 4 steps after the trigger",
      "Filter by Zapier"
    ]
  },
  "tasks": {
    "typical": 3,
    "max": 3
  },
  "trigger": {
    "app": "Pipedrive",
    "event": "New Person",
    "kind": "polling",
    "title": "New Pipedrive person",
    "why": "Fires for each person added to Pipedrive.",
    "config": {
      "Account": "YOUR_PIPEDRIVE_ACCOUNT"
    },
    "outputs": [
      "person_id",
      "name",
      "email",
      "phone",
      "org_name",
      "owner_name",
      "add_time"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "domain",
      "kind": "code",
      "app": "Code by Zapier",
      "event": "Run JavaScript",
      "title": "Split the email domain",
      "why": "Finds the company domain and spots free mailboxes.",
      "code": {
        "language": "javascript",
        "module": "email-domain",
        "file": "code/email-domain.js"
      },
      "input_data": {
        "email": "{{trigger.email}}"
      },
      "outputs": [
        "valid",
        "domain",
        "is_free_provider",
        "is_role_address",
        "company_guess",
        "website"
      ]
    },
    {
      "key": "work",
      "kind": "filter",
      "app": "Filter by Zapier",
      "event": "Only continue if...",
      "title": "Only work email addresses",
      "why": "Free mailboxes have no company to look up, so they stop here.",
      "conditions": [
        [
          {
            "field": "{{domain.is_free_provider}}",
            "operator": "(Boolean) Is false"
          },
          {
            "field": "{{domain.valid}}",
            "operator": "(Boolean) Is true"
          }
        ]
      ],
      "usually": true
    },
    {
      "key": "org",
      "kind": "search",
      "app": "Apollo",
      "event": "Enrich Organization",
      "title": "Look the company up in Apollo",
      "why": "Returns the company snapshot for the domain.",
      "fields": {
        "Domain": "{{domain.domain}}",
        "Should this step be considered a \"success\" when nothing is found?": "Yes"
      },
      "outputs": [
        "name",
        "industry",
        "estimated_num_employees",
        "annual_revenue_printed",
        "city",
        "country",
        "linkedin_url",
        "short_description",
        "_zap_search_was_found_status"
      ]
    },
    {
      "key": "note",
      "kind": "action",
      "app": "Pipedrive",
      "event": "Create Note",
      "title": "Pin a company note to the person",
      "why": "A note is visible in the person's timeline and does not overwrite anything the rep typed.",
      "fields": {
        "Person": "{{trigger.person_id}}",
        "Pin to person": "Yes",
        "Content": "Company snapshot (Apollo): {{org.name}}, {{org.industry}}, about {{org.estimated_num_employees}} people, {{org.city}} {{org.country}}. Revenue band: {{org.annual_revenue_printed}}. {{org.short_description}} LinkedIn: {{org.linkedin_url}}"
      },
      "outputs": [
        "id"
      ]
    }
  ]
}
