Quick Overview 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 Slack. How it works 1. Triggers when a new WhatsApp message is received. 2. Checks that the message contains an image or document, then fetches the media URL and downloads the attachment. 3. Converts the do

Quick Overview 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 Slack. How it works 1. Triggers when a new WhatsApp message is received. 2. Checks that the message contains an image or document, then fetches the media URL and downloads the attachment. 3. Converts the downloaded file to base64 and sends it to the Google Gemini API to extract structured invoice details as JSON. 4. Validates that the attachment is an invoice and routes it based on the extracted invoice direction and status. 5. For Payable invoices that are not marked as paid, searches HubSpot for a matching contact by WhatsApp phone number, creates a HubSpot task associated with that contact, sends a confirmation back via WhatsApp, and posts the invoice details to Slack. 6. For Receivable invoices, searches HubSpot for deals linked to the contact and matching the extracted invoiceid, then closes the deal as won and thanks the sender on WhatsApp when a match is found. 7. Posts alerts to Slack when the invoice status is unknown or when no HubSpot deal is found for a receivable invoice. Setup 1. Connect WhatsApp Business credentials for the WhatsApp Trigger and WhatsApp send actions, and set the correct phone number ID. 2. Add Google Gemini (Google PaLM) API credentials and update the prompt/company name (currently "blankarray") to match your business. 3. Connect HubSpot OAuth2 credentials and ensure your deals include an invoiceid property and your associations/contact phone fields support the workflow’s searches. 4. Connect Slack credentials and select the target channel IDs for the Slack notification steps.
Download the workflow JSON file after purchase.
Open n8n → click the menu → Import from File.
Select the downloaded JSON and import.
Set up credentials for each node that requires them.
Click Execute Workflow to test, then activate.
Setup guide included
Purchase to unlock the full step-by-step guide
No reviews yet
Be the first to buy and share your experience.
Leave a review
Sign in to share your experience with this workflow.
Create a free account to purchase workflows.
Need help setting this up?
Book a 3-hour live setup session with an Agility consultant.