Quick overview
This workflow listens for Workspace369 invoice.paid webhooks, verifies the invoice and payment via the Workspace369 API, logs the payment to Google Sheets only once, and emails your team a paid-invoice notice or an alert on errors.
How it works
- Receives a POST webhook from Workspace369 and immediately responds, then keeps only events where event_type equals invoice.paid.
- Fetches the invoice details and the invoice’s payment list from the Workspace369 API using a Bearer token, retrying failed calls up to three times.
- Confirms the invoice is fully paid and (if provided) the referenced payment exists on the invoice, then builds a Google Sheets row and an email message from the API data.
- Searches Google Sheets for the webhook ID to prevent duplicate logging.
- If the webhook ID is not found, appends the payment row to the sheet and sends an invoice-paid email via Gmail.
- If the API check fails, the payment cannot be confirmed, or Google Sheets operations fail, sends an alert email via Gmail instead of writing anything to the sheet.
Setup
- In Workspace369, enable AI connections and create a personal access token with invoices:read permission, then add it to n8n as an HTTP Bearer Auth credential.
- Create a Google Sheet with a tab matching the workflow’s tab name (default: Payments) and a header row that includes a “Webhook ID” column for de-duplication.
- Connect Google Sheets and Gmail credentials in n8n, then set the Google Sheet URL, tab name, and recipient email address in the Settings step.
- Copy the n8n production webhook URL and register it in Workspace369 Webhooks for the invoice.paid event.