{
  "id": "9otDcOI7hYF7QELs",
  "name": "AI Call Summary to HubSpot + Follow-Up Task",
  "tags": [],
  "nodes": [
    {
      "id": "62aa0111-3390-474f-9779-1d389398d3a0",
      "name": "Find Contact by Email",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        528,
        224
      ],
      "parameters": {
        "operation": "search",
        "authentication": "oAuth2",
        "filterGroupsUi": {
          "filterGroupsValues": [
            {
              "filtersUi": {
                "filterValues": [
                  {
                    "value": "={{ $json['Contact email'] }}",
                    "propertyName": "email|string"
                  }
                ]
              }
            }
          ]
        },
        "additionalFields": {
          "properties": "={{ [\"email\",\"firstname\",\"lastname\",\"jobtitle\",\"company\",\"country\",\"state\",\"city\",\"hs_language\",\"phone\",\"mobilephone\",\"lifecyclestage\",\"hs_lead_status\",\"hubspot_owner_id\",\"hs_email_last_open_date\",\"hs_email_last_reply_date\",\"hs_latest_meeting_activity\",\"hs_sequences_is_enrolled\",\"hs_sequences_enrolled_count\",\"createdate\",\"hs_lastmodifieddate\",\"hs_timezone\",\"notes_last_contacted\",\"hs_object_id\"] }}"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "bc13ee93-f748-4058-9429-a25883e9c25e",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        848,
        448
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "1dbedf6b-1427-4127-a0bf-ac745c386e6a",
      "name": "Form: Capture Transcript",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        304,
        224
      ],
      "parameters": {
        "options": {},
        "formTitle": "Get transcript",
        "formFields": {
          "values": [
            {
              "fieldType": "email",
              "fieldLabel": "Contact email",
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "Paste transcript here",
              "requiredField": true
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "e4ce0bc0-eaef-4d12-80af-8be92a32c059",
      "name": "AI: Summarize Call & Draft Task",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        848,
        224
      ],
      "parameters": {
        "text": "=### Inputs\n\n* **Contact info:** `{{  JSON.stringify($json.properties) }}`\n* **Call transcript (plain text):** `{{ $('Form: Capture Transcript').item.json['Paste transcript here'] }}`\n\n### Your goals\n\n1. Read the transcript and capture: participants, company, role, problem/opportunity, key requirements, objections/blockers, timeline, and any metrics (team size, volume, \\$\\$, dates).\n2. Write a **120\u2013160 word** plain-English summary a teammate can skim.\n3. Create **one actionable follow-up task** that clearly moves the deal forward.\n4. Based on what you've learned from the call transcript, update any missing HubSpot contact information (blank fields) using the HubSpot \"Update Contact\" tool.\n\n### Rules\n\n* Be factual; **do not invent** details.\n* If data is missing, note it as \u201cunknown\u201d.\n* Normalize dates to `YYYY-MM-DD` (use next business day for \u201ctomorrow\u201d, +7 days for \u201cnext week\u201d).\n* Keep original spelling for names/companies.\n* Use concise language; no fluff.\n\nRespond ONLY in the following JSON format:\n{\n  \"Summary\": \"<120\u2013160 word recap>\",\n  \"Task name\": \"<imperative title, e.g., Schedule security review with IT lead>\",\n  \"Task body\": \"<what to deliver, needed inputs, owner, due date and success criteria>\"\n}",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "4fdbc6bf-5cf9-4eb1-9951-f865ec218126",
      "name": "Log Call Summary",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1200,
        224
      ],
      "parameters": {
        "type": "call",
        "metadata": {
          "body": "={{ $json.output.Summary }}",
          "status": "COMPLETED"
        },
        "resource": "engagement",
        "authentication": "oAuth2",
        "additionalFields": {
          "associations": {
            "contactIds": "={{ $('Find Contact by Email').item.json.id }}"
          }
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "23a2c237-2a38-48c8-9c6b-3ca2f07e1816",
      "name": "Create Follow-Up Task",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1424,
        224
      ],
      "parameters": {
        "type": "task",
        "metadata": {
          "body": "={{ $('AI: Summarize Call & Draft Task').item.json.output['Task body'] }}",
          "status": "NOT_STARTED",
          "subject": "={{ $('AI: Summarize Call & Draft Task').item.json.output['Task name'] }}",
          "forObjectType": "CONTACT"
        },
        "resource": "engagement",
        "authentication": "oAuth2",
        "additionalFields": {
          "associations": {
            "contactIds": "={{ $('Find Contact by Email').item.json.id }}"
          }
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "8fcb293d-d6b2-4553-af27-cc340208fa8d",
      "name": "Update Contact from Transcript",
      "type": "n8n-nodes-base.hubspotTool",
      "position": [
        1040,
        448
      ],
      "parameters": {
        "email": "={{ $('Form: Capture Transcript').item.json['Contact email'] }}",
        "options": {},
        "authentication": "oAuth2",
        "additionalFields": {
          "city": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('City', `Update this if the prospect mentions the city`, 'string') }}",
          "country": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Country_Region', `Update this if the prospect mentions the country`, 'string') }}",
          "jobTitle": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Job_Title', `Update this if the prospect mentions their job title`, 'string') }}",
          "jobFunction": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Job_Function', `Update this if the prospect mentions their job function`, 'string') }}"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "affbd7c1-1970-417b-b9e3-80ddea9a77bd",
      "name": "Parse Structured Output",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1216,
        448
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\"Summary\": \"Hand from ClearPath spoke with Jordan (Plumber) regarding slow onboarding. Jordan\u2019s company, which remains unknown, hires 25-40 new employees monthly...\",\n\"Task name\": \"Send demo invite and prep materials to Jordan\",\n\"Task body\": \"Deliver a calendar invite for the 2025-10-01 2:00 PM demo, including a short checklist for the IT lead to prepare and an outline for the two-week sandbox pilot.\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "f3513e1b-b8d2-45e6-a073-9ce960255765",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        128
      ],
      "parameters": {
        "color": 7,
        "width": 448,
        "height": 304,
        "content": "## Get call transcript and contact"
      },
      "typeVersion": 1
    },
    {
      "id": "a287568d-b9ac-408a-b529-8705d5a7ea3a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        128
      ],
      "parameters": {
        "color": 7,
        "width": 880,
        "height": 496,
        "content": "## Add call summary, follow-up task and contact properties"
      },
      "typeVersion": 1
    },
    {
      "id": "d15dd7dd-df8e-4e07-a23a-cacf7a8f0173",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        80
      ],
      "parameters": {
        "color": 5,
        "width": 544,
        "height": 544,
        "content": "## AI Call Summary to HubSpot + Follow-Up Task\n\n### How it works\n1. Open the **Form** to enter the contact\u2019s email and a raw **call transcript**.\n2. The flow **finds the HubSpot contact** by email and pulls key properties.\n3. **AI** returns a 120\u2013160-word call summary, one follow-up task, and proposed contact updates (eg. the contact's job title).\n4. The summary is **logged as a completed Call** on the contact in HubSpot.\n5. The task is **created in HubSpot** and associated with the contact.\n6. (Optional) Contact properties are **updated** from the transcript via the HubSpot tool.\n\n### Setup\n- [ ] Connect all HubSpot nodes.\n- [ ] Add your credentials to the OpenAI Chat Model.\n\n### Customize\n- **Prompt:** Tweak tone, length, required fields, and date rules.\n- **Fields:** Add more HubSpot props; map extra updates (city, country, title, function, etc.).\n- **Input:** Swap the form for Gmail/Drive/Zoom or a folder watcher.\n- **Approval:** Insert a Slack review step before HubSpot writes.\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "f94ea283-ffe5-478c-8ca1-111c00923f75",
  "connections": {
    "Log Call Summary": {
      "main": [
        [
          {
            "node": "Create Follow-Up Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI: Summarize Call & Draft Task",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Find Contact by Email": {
      "main": [
        [
          {
            "node": "AI: Summarize Call & Draft Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Structured Output": {
      "ai_outputParser": [
        [
          {
            "node": "AI: Summarize Call & Draft Task",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Form: Capture Transcript": {
      "main": [
        [
          {
            "node": "Find Contact by Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Contact from Transcript": {
      "ai_tool": [
        [
          {
            "node": "AI: Summarize Call & Draft Task",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI: Summarize Call & Draft Task": {
      "main": [
        [
          {
            "node": "Log Call Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}