{
  "schema_version": "1.0.0",
  "id": "cold-reply-to-pipedrive",
  "title": "Turn an interested cold-email reply into a Pipedrive deal",
  "category": "lead-gen-crm",
  "difficulty": "intermediate",
  "featured": false,
  "description": "Classify each reply to outreach with AI and open a Pipedrive person and deal only when the prospect says they are interested.",
  "tags": [
    "outreach",
    "gmail",
    "pipedrive",
    "ai-classification",
    "sales"
  ],
  "apps": [
    "Gmail",
    "AI by Zapier",
    "Filter by Zapier",
    "Pipedrive"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 4 steps after the trigger",
      "Filter by Zapier",
      "AI by Zapier"
    ]
  },
  "tasks": {
    "typical": 1,
    "max": 3
  },
  "trigger": {
    "app": "Gmail",
    "event": "New Email Matching Search",
    "kind": "polling",
    "title": "New reply under the outreach label",
    "why": "Polls Gmail for new mail matching the search. The outreach tool or a Gmail filter puts replies under that label.",
    "config": {
      "Search String": "label:outreach-replies newer_than:2d"
    },
    "outputs": [
      "message_id",
      "thread_id",
      "from_email",
      "from_name",
      "to",
      "subject",
      "date",
      "body_plain",
      "snippet",
      "labels",
      "attachment_count",
      "attachment_names"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "classify",
      "kind": "ai",
      "app": "AI by Zapier",
      "event": "Analyze and Return Data",
      "title": "Classify the reply",
      "why": "Sorts the reply into four intents and pulls the sender's company and a one-line summary.",
      "fields": {
        "Model": "Default (fast)",
        "Instructions": "This is a reply to a cold sales email. Return intent: exactly one of interested, not_now, unsubscribe, out_of_office. Use interested only if they ask for a call, pricing, or more detail. Also return sender_first_name, sender_last_name, company (from the signature or domain), and reply_summary (one sentence).",
        "Input data": "From: {{trigger.from_name}} <{{trigger.from_email}}>\nSubject: {{trigger.subject}}\n\n{{trigger.body_plain}}",
        "Output fields": "intent, sender_first_name, sender_last_name, company, reply_summary"
      },
      "outputs": [
        "intent",
        "sender_first_name",
        "sender_last_name",
        "company",
        "reply_summary"
      ]
    },
    {
      "key": "interested",
      "kind": "filter",
      "app": "Filter by Zapier",
      "event": "Only continue if...",
      "title": "Only interested replies",
      "why": "Most replies are not interested, and they stop here. Unsubscribes should be handled in your outreach tool, not the CRM.",
      "conditions": [
        [
          {
            "field": "{{classify.intent}}",
            "operator": "(Text) Exactly matches",
            "value": "interested"
          }
        ]
      ],
      "usually": false
    },
    {
      "key": "person",
      "kind": "action",
      "app": "Pipedrive",
      "event": "Create Person",
      "title": "Create the person",
      "why": "The prospect, with their email from the reply.",
      "fields": {
        "Name": "{{classify.sender_first_name}} {{classify.sender_last_name}}",
        "Email": "{{trigger.from_email}}",
        "Organization Name": "{{classify.company}}"
      },
      "outputs": [
        "id"
      ]
    },
    {
      "key": "deal",
      "kind": "action",
      "app": "Pipedrive",
      "event": "Create Deal",
      "title": "Open the deal",
      "why": "Opens the deal in the first stage with the reply summary as the note.",
      "fields": {
        "Title": "{{classify.company}} (outreach reply)",
        "Person": "{{person.id}}",
        "Pipeline": "Sales",
        "Stage": "Lead in",
        "Note": "{{classify.reply_summary}}\nThread: https://mail.google.com/mail/u/0/#all/{{trigger.thread_id}}"
      },
      "outputs": [
        "id"
      ]
    }
  ]
}
