{
  "schema_version": "1.0.0",
  "id": "hubspot-deal-won-handoff",
  "title": "Hand a won HubSpot deal to onboarding",
  "category": "lead-gen-crm",
  "difficulty": "intermediate",
  "featured": false,
  "description": "When a deal moves to closed won, open an onboarding task in Asana, tell the delivery channel, and email the new client a welcome.",
  "tags": [
    "onboarding",
    "hubspot",
    "asana",
    "slack",
    "gmail"
  ],
  "apps": [
    "HubSpot",
    "Filter by Zapier",
    "Asana",
    "Slack",
    "Gmail"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 4 steps after the trigger",
      "Filter by Zapier"
    ]
  },
  "tasks": {
    "typical": 0,
    "max": 3
  },
  "trigger": {
    "app": "HubSpot",
    "event": "Updated Deal Stage",
    "kind": "polling",
    "title": "Deal stage changed",
    "why": "Fires whenever a deal in the pipeline changes stage, for any stage.",
    "config": {
      "Pipeline": "Sales Pipeline"
    },
    "outputs": [
      "deal_id",
      "deal_name",
      "dealstage",
      "amount",
      "close_date",
      "owner_email",
      "contact_email",
      "contact_first_name",
      "company_name"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "won",
      "kind": "filter",
      "app": "Filter by Zapier",
      "event": "Only continue if...",
      "title": "Only deals moved to closed won",
      "why": "The trigger fires on every stage change, so most runs stop here.",
      "conditions": [
        [
          {
            "field": "{{trigger.dealstage}}",
            "operator": "(Text) Exactly matches",
            "value": "closedwon"
          }
        ]
      ],
      "usually": false
    },
    {
      "key": "task",
      "kind": "action",
      "app": "Asana",
      "event": "Create Task",
      "title": "Open the onboarding task",
      "why": "One task in the onboarding project, due in two working days, with the deal details in the notes.",
      "fields": {
        "Workspace": "YOUR_ASANA_WORKSPACE",
        "Project": "Client onboarding",
        "Name": "Onboard {{trigger.company_name}}",
        "Notes": "Deal: {{trigger.deal_name}}\nValue: {{trigger.amount}}\nClosed: {{trigger.close_date}}\nSales owner: {{trigger.owner_email}}\nClient contact: {{trigger.contact_first_name}} <{{trigger.contact_email}}>",
        "Due On": "+2 days",
        "Assignee": "YOUR_ONBOARDING_LEAD"
      },
      "outputs": [
        "id",
        "permalink_url"
      ]
    },
    {
      "key": "tell",
      "kind": "action",
      "app": "Slack",
      "event": "Send Channel Message",
      "title": "Tell the delivery channel",
      "why": "Delivery hears the same hour the deal closes.",
      "fields": {
        "Channel": "#delivery",
        "Message Text": ":tada: {{trigger.company_name}} signed ({{trigger.amount}}). Onboarding task: {{task.permalink_url}}",
        "Send as a bot?": "Yes",
        "Bot Name": "Zap alerts",
        "Include a link to this Zap?": "No"
      },
      "outputs": [
        "ts",
        "permalink"
      ]
    },
    {
      "key": "welcome",
      "kind": "action",
      "app": "Gmail",
      "event": "Send Email",
      "title": "Welcome the new client",
      "why": "A short note with the next step, sent while the decision is fresh.",
      "fields": {
        "To": "{{trigger.contact_email}}",
        "Subject": "Welcome aboard, {{trigger.contact_first_name}}",
        "Body Type": "plain",
        "Body": "Hi {{trigger.contact_first_name}},\n\nWelcome! Our onboarding lead will email you within two working days to book the kickoff call. If anything is urgent before then, just reply here.\n\nYOUR_NAME",
        "From Name": "YOUR_NAME"
      },
      "outputs": [
        "id",
        "thread_id"
      ]
    }
  ]
}
