This workflow corresponds to n8n.io template #16214 — we link there as the canonical source.
This workflow follows the HTTP Request → HubSpot recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "iWjJZ8GR8ihInxJ0",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "My workflow 179",
"tags": [],
"nodes": [
{
"id": "ae203266-4e39-44e8-970c-0e1181412ca8",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
208,
1008
],
"parameters": {
"width": 480,
"height": 736,
"content": "## Automated Invoice parsing from whatsapp and sync with hubspot CRM\n\n@[youtube](KwK7vf58WZs)\n\n### How it works\n\n1. The workflow triggers upon receiving a new WhatsApp message.\n2. It downloads any attached media files from the message.\n3. The downloaded media is parsed to extract invoice data using Gemini.\n4. The workflow routes the data based on the extracted information.\n5. It performs actions in HubSpot and sends relevant notifications via WhatsApp or Slack.\n\n### Setup steps\n\n- - [ ] Connect your WhatsApp Business API account to the trigger and sender nodes.\n- - [ ] Configure the Google Gemini API credentials for invoice parsing.\n- - [ ] Set up HubSpot API credentials to perform CRM operations.\n- - [ ] Connect your Slack workspace to receive automated notifications.\n"
},
"typeVersion": 1
},
{
"id": "06860371-b464-4601-b1d7-8cf3ce6fc845",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
768,
1216
],
"parameters": {
"color": 7,
"width": 400,
"height": 304,
"content": "## Receive and filter WhatsApp messages\n\nTriggering the flow upon receiving a message."
},
"typeVersion": 1
},
{
"id": "e2a9a9e1-3426-43bb-a9b9-c8197feeafd9",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1216,
1200
],
"parameters": {
"color": 7,
"width": 384,
"height": 304,
"content": "## Download attached media files\n\nDownloading media attachments for processing."
},
"typeVersion": 1
},
{
"id": "cd0eeeea-9ed5-486d-a607-022656f86870",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1648,
1232
],
"parameters": {
"color": 7,
"width": 688,
"height": 272,
"content": "## Parse invoice data with Gemini\n\nExtracting invoice data using Gemini."
},
"typeVersion": 1
},
{
"id": "a21cd886-80e4-46f9-bf94-39c142975e66",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
2400,
1184
],
"parameters": {
"color": 7,
"width": 672,
"height": 528,
"content": "## Route parsed invoice data\n\nRouting based on parsed invoice data."
},
"typeVersion": 1
},
{
"id": "a3f1d70a-4f1b-4848-b566-1264137caad1",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
3104,
880
],
"parameters": {
"color": 7,
"width": 1056,
"height": 272,
"content": "## Create Vendor specific tasks in CRM and notify accounts team \n\nHandling tasks and notifications for clients."
},
"typeVersion": 1
},
{
"id": "57bb918b-8b93-41a3-9699-540b50a87af8",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
3120,
1200
],
"parameters": {
"color": 7,
"width": 1056,
"height": 272,
"content": "## Update deals and notify client that we recieve payment\n\nUpdating deals within HubSpot systems."
},
"typeVersion": 1
},
{
"id": "42d8c0cc-4f48-499e-9ca5-1b70a2cd08f0",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
3520,
1504
],
"parameters": {
"color": 7,
"height": 336,
"content": "## Notify on deal status update\n\nSending Slack notifications for deal updates."
},
"typeVersion": 1
},
{
"id": "4f90d24b-5c88-455e-8625-bf74c7b62e45",
"name": "When WhatsApp Message Received",
"type": "n8n-nodes-base.whatsAppTrigger",
"position": [
816,
1344
],
"parameters": {
"options": {
"messageStatusUpdates": []
},
"updates": [
"messages"
]
},
"credentials": {
"whatsAppTriggerApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "369d600a-835d-466f-b5c4-f121f766f678",
"name": "Check Message Type",
"type": "n8n-nodes-base.if",
"position": [
1024,
1344
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"id": "6fb4f0ef-b870-439c-85ad-668d3103e0d6",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.messages[0].type }}",
"rightValue": "image"
},
{
"id": "f19a67e3-1afa-4ed4-b901-171bdaeb4e56",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.messages[0].type }}",
"rightValue": "document"
}
]
}
},
"typeVersion": 2.3
},
{
"id": "4d4a789d-df7d-404b-adbf-11d89a4c0ebe",
"name": "Get WhatsApp Media Metadata",
"type": "n8n-nodes-base.whatsApp",
"position": [
1264,
1328
],
"parameters": {
"resource": "media",
"operation": "mediaUrlGet",
"mediaGetId": "={{ $json.messages[0]?.image?.id || $json.messages[0]?.document?.id }}"
},
"credentials": {
"whatsAppApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.1
},
{
"id": "887a5f24-3560-4e3c-b130-256fc5746800",
"name": "Route by Workflow Path",
"type": "n8n-nodes-base.switch",
"position": [
2688,
1296
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Payable",
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "9befacdc-6c6e-4d0a-a2c3-ec199cb6c4f7",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.invoice_direction }}",
"rightValue": "Payable"
}
]
},
"renameOutput": true
},
{
"outputKey": "Receivable",
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "75036f0c-7ce2-4498-9243-4ea5f7a8e095",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.invoice_direction }}",
"rightValue": "Receivable"
}
]
},
"renameOutput": true
},
{
"outputKey": "Unknown",
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "8976c245-159f-461c-ab23-29923e989b84",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.invoice_direction }}",
"rightValue": "Unknown"
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.4
},
{
"id": "a3d4112c-30f6-43cb-ac43-e0186c96d0ff",
"name": "Search HubSpot Contacts",
"type": "n8n-nodes-base.hubspot",
"position": [
3376,
960
],
"parameters": {
"operation": "search",
"authentication": "oAuth2",
"filterGroupsUi": {
"filterGroupsValues": [
{
"filtersUi": {
"filterValues": [
{
"value": "=+{{ $('When WhatsApp Message Received').item.json.contacts[0].wa_id }}",
"propertyName": "phone|string"
}
]
}
}
]
},
"additionalFields": {}
},
"credentials": {
"hubspotOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2.2
},
{
"id": "2d82a1fb-88ab-4493-af75-9a0f7c433f34",
"name": "Download WhatsApp Media",
"type": "n8n-nodes-base.httpRequest",
"position": [
1456,
1328
],
"parameters": {
"url": "={{ $json.url }}",
"options": {},
"authentication": "predefinedCredentialType",
"nodeCredentialType": "whatsAppApi"
},
"credentials": {
"whatsAppApi": {
"name": "<your credential>"
}
},
"typeVersion": 4.4
},
{
"id": "f6be8dfa-184e-4fec-b285-63b2b1561f87",
"name": "Parse Invoice with Gemini",
"type": "n8n-nodes-base.httpRequest",
"position": [
1936,
1328
],
"parameters": {
"url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-flash-lite:generateContent",
"method": "POST",
"options": {},
"jsonBody": "={\n \"contents\": [\n {\n \"parts\": [\n {\n \"text\": \"Role: You are an expert financial data extraction AI. Your task is to extract structured data from the provided invoice image or document.\\n\\nContext & Logic:\\n1. Direction: Our company name is \\\"blankarray\\\" (case-insensitive). Analyze the \\\"From/Issuer\\\" and \\\"To/Billed To\\\" fields.\\n- If \\\"blankarray\\\" is the ISSUER (From), set `invoice_direction` to \\\"Receivable\\\".\\n- If \\\"blankarray\\\" is the RECIPIENT (To), set `invoice_direction` to \\\"Payable\\\".\\n- If \\\"blankarray\\\" does not appear, set `invoice_direction` to \\\"Unknown\\\".\\n\\n2. Status: Analyze the document for watermarks, stamps (e.g., \\\"PAID\\\"), balance due amounts, or explicit status fields to determine the current state of the invoice. Set `invoice_status` accordingly.\\n\\n3. Invoice Verification: Analyze the document structure, headings, and content to determine if it is an invoice or another document type (like a receipt, purchase order, passport, or random image). Set `is_invoice` to true if it is an invoice, and false otherwise.\\n\\nTask: Extract the data and format it EXACTLY according to the JSON schema below. Do not include markdown formatting, explanations, or conversational text. Output pure JSON only.\\n\\nJSON Schema:\\n{\\n \\\"is_invoice\\\": \\\"boolean\\\",\\n \\\"invoice_direction\\\": \\\"Payable | Receivable | Unknown\\\",\\n \\\"invoice_status\\\": \\\"Paid | Due | Overdue | Cancelled | Unknown\\\",\\n \\\"invoice_id\\\": \\\"string\\\",\\n \\\"issuer_name\\\": \\\"string\\\",\\n \\\"billed_to_name\\\": \\\"string\\\",\\n \\\"invoice_number\\\": \\\"string\\\",\\n \\\"date_issued\\\": \\\"YYYY-MM-DD\\\",\\n \\\"due_date\\\": \\\"YYYY-MM-DD\\\",\\n \\\"total_amount\\\": \\\"number\\\",\\n \\\"balance_due\\\": \\\"number\\\",\\n \\\"currency\\\": \\\"string (e.g., USD, EUR, INR)\\\",\\n \\\"tax_amount\\\": \\\"number\\\",\\n \\\"line_items\\\": [\\n {\\n \\\"description\\\": \\\"string\\\",\\n \\\"quantity\\\": \\\"number\\\",\\n \\\"unit_price\\\": \\\"number\\\",\\n \\\"total\\\": \\\"number\\\"\\n }\\n ]\\n}\"\n },\n {\n \"inline_data\": {\n \"mime_type\": \"{{ $('Download WhatsApp Media').item.json.mime_type }}\",\n \"data\": \"{{ $json.data }}\"\n }\n }\n ]\n }\n ],\n \"generationConfig\": {\n \"response_mime_type\": \"application/json\",\n \"temperature\": 0.1\n }\n}",
"sendBody": true,
"sendQuery": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"queryParameters": {
"parameters": []
},
"nodeCredentialType": "googlePalmApi"
},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"typeVersion": 4.4
},
{
"id": "8a622a99-d36b-456e-b291-923eb1fd8bbf",
"name": "Clean and Parse JSON Response",
"type": "n8n-nodes-base.code",
"position": [
2208,
1328
],
"parameters": {
"jsCode": "const returnItems = [];\n\nfor (const item of $input.all()) {\n try {\n // Target the specific path where the stringified JSON lives\n const rawText = item.json.candidates[0].content.parts[0].text;\n \n // Parse the string into a proper JSON object\n const cleanData = JSON.parse(rawText);\n \n // Output the clean data back to the n8n workflow\n // The new \"invoice_id\" key will automatically be present in cleanData\n returnItems.push({ json: cleanData });\n \n } catch (error) {\n // Failsafe just in case the model returns something unexpected\n returnItems.push({ \n json: { \n error: \"Failed to parse Gemini output\", \n details: error.message,\n raw_payload: item.json\n } \n });\n }\n}\n\nreturn returnItems;"
},
"typeVersion": 2
},
{
"id": "430874db-07f4-47c0-9b99-6a3115e28153",
"name": "Create HubSpot Task",
"type": "n8n-nodes-base.httpRequest",
"position": [
3584,
960
],
"parameters": {
"url": "https://api.hubapi.com/crm/v3/objects/tasks",
"method": "POST",
"options": {},
"jsonBody": "={\n \"properties\": {\n \"hs_task_subject\": \"Process Client Payment\",\n \"hs_task_body\": \"Initiate payout for the client. Verify the invoice details and ensure funds are successfully transferred.\",\n \"hs_task_status\": \"NOT_STARTED\",\n \"hs_task_priority\": \"HIGH\",\n \"hs_task_type\": \"TODO\",\n \"hs_timestamp\": \"2026-06-10T04:30:00.000Z\"\n },\n \"associations\": [\n {\n \"to\": {\n \"id\": \"{{ $json.id }}\"\n },\n \"types\": [\n {\n \"associationCategory\": \"HUBSPOT_DEFINED\",\n \"associationTypeId\": 204\n }\n ]\n }\n ]\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "hubspotOAuth2Api"
},
"credentials": {
"hubspotOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.4
},
{
"id": "f33673e9-db1a-49a1-9c3c-b90b51559da5",
"name": "Send WhatsApp Task Confirm",
"type": "n8n-nodes-base.whatsApp",
"position": [
3792,
960
],
"parameters": {
"textBody": "Your invoice will be cleared in time",
"operation": "send",
"phoneNumberId": "1083481144853090",
"additionalFields": {},
"recipientPhoneNumber": "={{ $('When WhatsApp Message Received').item.json.contacts[0].wa_id }}"
},
"credentials": {
"whatsAppApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.1
},
{
"id": "3c6a33d3-f46a-4e90-99bf-acc06f3067ec",
"name": "Search HubSpot Deals",
"type": "n8n-nodes-base.hubspot",
"position": [
3152,
1312
],
"parameters": {
"operation": "search",
"authentication": "oAuth2",
"filterGroupsUi": {
"filterGroupsValues": [
{
"filtersUi": {
"filterValues": [
{
"value": "=+{{ $('When WhatsApp Message Received').item.json.contacts[0].wa_id }}",
"propertyName": "phone|string"
}
]
}
}
]
},
"additionalFields": {}
},
"credentials": {
"hubspotOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2.2
},
{
"id": "d01b2327-fdcc-4e93-9a16-0931f02d55cc",
"name": "Fetch HubSpot Deal Data",
"type": "n8n-nodes-base.httpRequest",
"position": [
3360,
1312
],
"parameters": {
"url": "https://api.hubapi.com//crm/v3/objects/deals/search",
"method": "POST",
"options": {},
"jsonBody": "={\n \"filterGroups\": [\n {\n \"filters\": [\n {\n \"propertyName\": \"associations.contact\",\n \"operator\": \"EQ\",\n \"value\": \"{{ $json.id }}\"\n },\n {\n \"propertyName\": \"invoice_id\",\n \"operator\": \"EQ\",\n \"value\": \"{{ $('Clean and Parse JSON Response').item.json.invoice_id }}\"\n }\n ]\n }\n ],\n \"properties\": [\n \"amount\",\n \"dealname\",\n \"dealstage\",\n \"invoice_id\"\n ]\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "hubspotOAuth2Api"
},
"credentials": {
"hubspotOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.4,
"alwaysOutputData": true
},
{
"id": "5ab69b6a-40cf-4333-a45d-64c06dc4bf6a",
"name": "Send WhatsApp Deal Update",
"type": "n8n-nodes-base.whatsApp",
"position": [
4032,
1296
],
"parameters": {
"textBody": "Thanks for the payment : )",
"operation": "send",
"phoneNumberId": "1083481144853090",
"additionalFields": {},
"recipientPhoneNumber": "={{ $('When WhatsApp Message Received').item.json.contacts[0].wa_id }}"
},
"credentials": {
"whatsAppApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.1
},
{
"id": "b5381fb2-83b8-4695-a490-fff866bc5c0f",
"name": "If Deal Found",
"type": "n8n-nodes-base.if",
"position": [
3568,
1312
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "d0fbb0b7-adfd-46a2-8c9d-a85bc49ac326",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json.results[0].id }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.3
},
{
"id": "7b5aa256-88f9-4152-a429-0035c3aed6df",
"name": "Update HubSpot Deal",
"type": "n8n-nodes-base.hubspot",
"position": [
3792,
1296
],
"parameters": {
"dealId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.results[0].id }}"
},
"resource": "deal",
"operation": "update",
"updateFields": {
"stage": "closedwon"
},
"authentication": "oAuth2"
},
"credentials": {
"hubspotOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2.2
},
{
"id": "b8f4e108-c8a0-4fd8-aedf-5dea597c921a",
"name": "Post Alert to Slack",
"type": "n8n-nodes-base.slack",
"position": [
3568,
1680
],
"parameters": {
"text": "=*Urgent Invoice Related Issue: [Matching Deal with invoiceid Not Found]*\n\n\u2022 *Client/Vendor Contact Search (HubSpot):* `+{{ $('When WhatsApp Message Received').item.json.contacts[0].wa_id }}`\n\u2022 *Invoice Media Asset ID:* `{{ $('When WhatsApp Message Received').item.json.messages[0].document.id }}`\n\n\n*Invoice Details*\n\n\u2022 *Direction:* `{{ $('Clean and Parse JSON Response').item.json.invoice_direction }}`\n\u2022 *Status:* `{{ $('Clean and Parse JSON Response').item.json.invoice_status }}`\n\u2022 *Invoice ID:* `{{ $('Clean and Parse JSON Response').item.json.invoice_id }}`\n\u2022 *Invoice Number:* `{{ $('Clean and Parse JSON Response').item.json.invoice_number }}`\n\u2022 *Issuer Name:* `{{ $('Clean and Parse JSON Response').item.json.issuer_name }}`\n\u2022 *Billed To Name:* `{{ $('Clean and Parse JSON Response').item.json.billed_to_name }}`\n\u2022 *Date Issued:* `{{ $('Clean and Parse JSON Response').item.json.date_issued }}`\n\u2022 *Due Date:* `{{ $('Clean and Parse JSON Response').item.json.due_date }}`\n\u2022 *Total Amount:* `{{ $('Clean and Parse JSON Response').item.json.total_amount }}`\n\u2022 *Balance Due:* `{{ $('Clean and Parse JSON Response').item.json.balance_due }}`\n\u2022 *Currency:* `{{ $('Clean and Parse JSON Response').item.json.currency }}`\n\u2022 *Tax Amount:* `{{ $('Clean and Parse JSON Response').item.json.tax_amount }}`",
"select": "channel",
"channelId": {
"__rl": true,
"mode": "id",
"value": ""
},
"otherOptions": {
"mrkdwn": true,
"includeLinkToWorkflow": true
}
},
"credentials": {
"slackApi": {
"name": "<your credential>"
}
},
"typeVersion": 2.5
},
{
"id": "861afc73-08bd-4f18-afe7-66836a8f81f4",
"name": "Post Update to Slack",
"type": "n8n-nodes-base.slack",
"position": [
2928,
1552
],
"parameters": {
"text": "=*Urgent Invoice Related Issue: Invoice Status Unknown*\n\n\u2022 *Client/Vendor Contact Search (HubSpot):* `+{{ $('When WhatsApp Message Received').item.json.contacts[0].wa_id }}`\n\u2022 *Invoice Media Asset ID:* `{{ $('When WhatsApp Message Received').item.json.messages[0].document.id }}`\n\n\n*Invoice Details*\n\n\u2022 *Direction:* `{{ $('Clean and Parse JSON Response').item.json.invoice_direction }}`\n\u2022 *Status:* `{{ $('Clean and Parse JSON Response').item.json.invoice_status }}`\n\u2022 *Invoice ID:* `{{ $('Clean and Parse JSON Response').item.json.invoice_id }}`\n\u2022 *Invoice Number:* `{{ $('Clean and Parse JSON Response').item.json.invoice_number }}`\n\u2022 *Issuer Name:* `{{ $('Clean and Parse JSON Response').item.json.issuer_name }}`\n\u2022 *Billed To Name:* `{{ $('Clean and Parse JSON Response').item.json.billed_to_name }}`\n\u2022 *Date Issued:* `{{ $('Clean and Parse JSON Response').item.json.date_issued }}`\n\u2022 *Due Date:* `{{ $('Clean and Parse JSON Response').item.json.due_date }}`\n\u2022 *Total Amount:* `{{ $('Clean and Parse JSON Response').item.json.total_amount }}`\n\u2022 *Balance Due:* `{{ $('Clean and Parse JSON Response').item.json.balance_due }}`\n\u2022 *Currency:* `{{ $('Clean and Parse JSON Response').item.json.currency }}`\n\u2022 *Tax Amount:* `{{ $('Clean and Parse JSON Response').item.json.tax_amount }}`",
"select": "channel",
"channelId": {
"__rl": true,
"mode": "id",
"value": ""
},
"otherOptions": {
"mrkdwn": true,
"includeLinkToWorkflow": true
}
},
"credentials": {
"slackApi": {
"name": "<your credential>"
}
},
"typeVersion": 2.5
},
{
"id": "649fabc3-87c3-43a6-a718-b2d559c109b0",
"name": "If Valid Invoice",
"type": "n8n-nodes-base.if",
"position": [
2448,
1328
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "4d8596ed-f012-4e2f-b208-07583ff99130",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.is_invoice }}",
"rightValue": false
}
]
}
},
"typeVersion": 2.3
},
{
"id": "6c1f78a1-b741-48d1-bd4d-179ac1f60a10",
"name": "Post Task to Slack",
"type": "n8n-nodes-base.slack",
"position": [
4000,
960
],
"parameters": {
"text": "=Payment pending to our vendor:\n\n\u2022 *Client/Vendor phone number for Contact Search (HubSpot):* `+91000000000`\n\u2022 *Invoice Media Asset ID:* `{{ $('When WhatsApp Message Received').item.json.messages[0].document.id }}`\n\n\n*Invoice Details*\n\n\u2022 *Direction:* `{{ $('Clean and Parse JSON Response').item.json.invoice_direction }}`\n\u2022 *Status:* `{{ $('Clean and Parse JSON Response').item.json.invoice_status }}`\n\u2022 *Invoice ID:* `{{ $('Clean and Parse JSON Response').item.json.invoice_id }}`\n\u2022 *Invoice Number:* `{{ $('Clean and Parse JSON Response').item.json.invoice_number }}`\n\u2022 *Issuer Name:* `{{ $('Clean and Parse JSON Response').item.json.issuer_name }}`\n\u2022 *Billed To Name:* `{{ $('Clean and Parse JSON Response').item.json.billed_to_name }}`\n\u2022 *Date Issued:* `{{ $('Clean and Parse JSON Response').item.json.date_issued }}`\n\u2022 *Due Date:* `{{ $('Clean and Parse JSON Response').item.json.due_date }}`\n\u2022 *Total Amount:* `{{ $('Clean and Parse JSON Response').item.json.total_amount }}`\n\u2022 *Balance Due:* `{{ $('Clean and Parse JSON Response').item.json.balance_due }}`\n\u2022 *Currency:* `{{ $('Clean and Parse JSON Response').item.json.currency }}`\n\u2022 *Tax Amount:* `{{ $('Clean and Parse JSON Response').item.json.tax_amount }}`",
"select": "channel",
"channelId": {
"__rl": true,
"mode": "id",
"value": ""
},
"otherOptions": {}
},
"credentials": {
"slackApi": {
"name": "<your credential>"
}
},
"typeVersion": 2.5
},
{
"id": "86812183-13d0-40ce-9f4b-d8afd59d7754",
"name": "If",
"type": "n8n-nodes-base.if",
"position": [
3120,
976
],
"parameters": {
"options": {
"ignoreCase": true
},
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": false,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "b3718f12-2840-499b-b06f-5753b3d0ef08",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.invoice_status }}",
"rightValue": "paid"
}
]
}
},
"typeVersion": 2.3
},
{
"id": "4db15c52-0be6-45b9-8d29-6ac588974a6e",
"name": "Binary to base64",
"type": "n8n-nodes-base.extractFromFile",
"position": [
1712,
1328
],
"parameters": {
"options": {},
"operation": "binaryToPropery"
},
"typeVersion": 1.1
}
],
"active": true,
"settings": {
"binaryMode": "separate",
"executionOrder": "v1"
},
"versionId": "e2b1e670-4394-410f-ae0e-fceb8cb53077",
"nodeGroups": [],
"connections": {
"If": {
"main": [
[
{
"node": "Search HubSpot Contacts",
"type": "main",
"index": 0
}
]
]
},
"If Deal Found": {
"main": [
[
{
"node": "Update HubSpot Deal",
"type": "main",
"index": 0
}
],
[
{
"node": "Post Alert to Slack",
"type": "main",
"index": 0
}
]
]
},
"Binary to base64": {
"main": [
[
{
"node": "Parse Invoice with Gemini",
"type": "main",
"index": 0
}
]
]
},
"If Valid Invoice": {
"main": [
[
{
"node": "Route by Workflow Path",
"type": "main",
"index": 0
}
]
]
},
"Check Message Type": {
"main": [
[
{
"node": "Get WhatsApp Media Metadata",
"type": "main",
"index": 0
}
]
]
},
"Create HubSpot Task": {
"main": [
[
{
"node": "Send WhatsApp Task Confirm",
"type": "main",
"index": 0
}
]
]
},
"Update HubSpot Deal": {
"main": [
[
{
"node": "Send WhatsApp Deal Update",
"type": "main",
"index": 0
}
]
]
},
"Search HubSpot Deals": {
"main": [
[
{
"node": "Fetch HubSpot Deal Data",
"type": "main",
"index": 0
}
]
]
},
"Route by Workflow Path": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
],
[
{
"node": "Search HubSpot Deals",
"type": "main",
"index": 0
}
],
[
{
"node": "Post Update to Slack",
"type": "main",
"index": 0
}
]
]
},
"Download WhatsApp Media": {
"main": [
[
{
"node": "Binary to base64",
"type": "main",
"index": 0
}
]
]
},
"Fetch HubSpot Deal Data": {
"main": [
[
{
"node": "If Deal Found",
"type": "main",
"index": 0
}
]
]
},
"Search HubSpot Contacts": {
"main": [
[
{
"node": "Create HubSpot Task",
"type": "main",
"index": 0
}
]
]
},
"Parse Invoice with Gemini": {
"main": [
[
{
"node": "Clean and Parse JSON Response",
"type": "main",
"index": 0
}
]
]
},
"Send WhatsApp Task Confirm": {
"main": [
[
{
"node": "Post Task to Slack",
"type": "main",
"index": 0
}
]
]
},
"Get WhatsApp Media Metadata": {
"main": [
[
{
"node": "Download WhatsApp Media",
"type": "main",
"index": 0
}
]
]
},
"Clean and Parse JSON Response": {
"main": [
[
{
"node": "If Valid Invoice",
"type": "main",
"index": 0
}
]
]
},
"When WhatsApp Message Received": {
"main": [
[
{
"node": "Check Message Type",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
googlePalmApihubspotOAuth2ApislackApiwhatsAppApiwhatsAppTriggerApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow captures invoice images/documents from WhatsApp, extracts structured invoice data with Google Gemini, and syncs the result to HubSpot by creating vendor-payment tasks or closing matching deals, while sending confirmations back on WhatsApp and raising exceptions to…
Source: https://n8n.io/workflows/16214/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This workflow enables seamless, bidirectional communication between WhatsApp and Slack using n8n. It automates the reception, processing, and forwarding of messages (text, media, and documents) betwee
Worflow. Uses whatsAppTrigger, httpRequest, whatsApp. Event-driven trigger; 94 nodes.
This workflow automates the full company enrichment pipeline: Simply import CSV company lists to Slack and save time on enrichment and CRM maintenance. It processes uploaded files, extracts company do
This workflow is designed for **customer support teams, e-commerce founders, and operations managers** who want to handle thousands of customer queries seamlessly. Instead of building a brand-new chat
Triggers when a contact property changes in HubSpot (e.g., added to a sequence) Lusha enriches the contact with verified email, direct phone, and seniority A prospect record is built and validated — c