Work snippet
ServiceM8 webhooks to HubSpot and Google Sheets
Concept DesignIllustrative integration walkthrough. Business details, figures and records are worked examples.
Sales live in HubSpot and the operations team runs from a Google Sheet. Signed webhooks from ServiceM8 now update the matching deal and write a single row to the log, so completed and cancelled jobs appear in both places without anyone re-entering them.
The problemSales cannot see job progress without asking operations.
What changesJob events update the deal and the log automatically, once each.
- Area
- Job events to CRM and operations log
- Tools
- ServiceM8 · HubSpot · Google Sheets · n8n
- Typical scope
- US$2,000-3,600
- Timeline
- About 4 weeks · fixed milestones
The problem
The pipeline and the morning meeting were a day behind ServiceM8, cancelled work stayed open in HubSpot, and a resent webhook had already put the same job in the sheet twice.
- Deals sit in Booked after the job is finished
- The operations sheet is overwritten or late
- Cancelled jobs still look like pipeline
- Unmapped staff names leave the deal with no owner
What discovery would examine
A review of ServiceM8 job events, the HubSpot pipeline used by sales, and a spreadsheet the operations lead updates by hand for a multi-crew service business.
| ID | Finding | Evidence | Risk if left |
|---|---|---|---|
| F1 | Sales hear that a job is finished only when someone remembers to update the deal | Deals still in "Booked" with completed ServiceM8 jobs | Follow-up and invoicing questions start from the wrong stage |
| F2 | The operations sheet is a day behind, and two rows were overwritten | Sheet history, and a missing job from Tuesday | The morning brief uses stale counts |
| F3 | ServiceM8 webhooks are not verified, and a test hook once posted twice | Two identical events, two sheet rows | Totals cannot be trusted |
| F4 | Cancelled jobs still appear as active in HubSpot | No cancel event mapped | Pipeline value is overstated |
| F5 | Staff names in ServiceM8 do not match HubSpot owner records | Five unmatched names in a week | The deal owner is left blank |
Approach
- Verify every webhook
Unsigned or stale events are refused.
- Map each event once
A written stage and a sheet row type, with the event id as the key.
- Write back in order
An older event cannot overwrite a later stage.
- Park what cannot be mapped
No deal, or an unknown staff name, waits for a person.
Current state and future state
Current state
Future state
Future-state modules
How it is built
- Module AWebhook verify
The signature is checked. An unsigned or stale event is refused and logged.
- Module BEvent map
Created, scheduled, on site, completed, cancelled and invoice-raised each have a HubSpot stage and a sheet row type.
- Module CHubSpot write-back
The deal is found by the stored deal id, or parked if no deal is linked.
- Module DSheets log
One append-only row per event, with the event id as the key, so a replay cannot add a second row.
- Module EStaff map
ServiceM8 staff names are mapped to HubSpot owners before go-live, and an unmapped name is parked.
Field mapping
| ServiceM8 event | HubSpot deal | Google Sheets row | Idempotency |
|---|---|---|---|
| Job created | Stage stays, job number written if already linked | Type: created, with source and site | event id |
| Job scheduled | Stage to Booked, window written | Type: scheduled, window and tech | event id |
| On site | Stage to On site | Type: on site, timestamp | event id |
| Completed | Stage to Done | Type: completed, timestamp | event id |
| Cancelled | Stage to Lost only if the written rule says so, otherwise a task for sales | Type: cancelled, reason | event id |
| Invoice raised in the job system | A property on the deal, not a new deal | Type: invoiced, amount | event id |
Worked exhibits
Exceptions and runbook
| Case | Rule | Who acts | First action |
|---|---|---|---|
| No HubSpot deal for the job | Park in a no-link queue, still append the sheet row | Sales admin | Link the deal, then replay the event |
| Unmapped staff name | Park the owner write, still update the stage | Operations | Add the map, then replay |
| Cancelled job | Follow the written rule: either Lost, or a task for sales to decide | Sales | Do not silently reopen a lost deal |
| Late or out-of-order event | Apply only if it is newer than the last applied timestamp for that job | Flow | An older "scheduled" event cannot overwrite "completed" |
| Signature fail | Refuse, alert | Operations | Check the webhook secret; do not process the body |
How to read the exhibits
- The weekly counts show webhook events and parked records.
- The two windows should share the same job number, deal id and completion time.
- The sheet is append-only: corrections are new rows, not silent edits.
Test plan
| ID | Check | Method | PASS when | FAIL when |
|---|---|---|---|---|
| T1 | Completion write-back | Fire a completed event for a linked deal | Stage is Done, sheet has one row | Stage unchanged, or two rows |
| T2 | Replay | Send the same event id twice | One sheet row, one HubSpot update | A second row |
| T3 | Out of order | Send completed, then an older scheduled event | Stage stays Done | Stage moves back to Booked |
| T4 | No deal | Fire an event with no deal id | Parked, sheet still appended | A new HubSpot deal is invented |
| T5 | Cancel rule | Cancel a booked job | The written rule is followed, and a sheet row is added | The deal is silently lost or left booked |
| T6 | Bad signature | Post an unsigned event | Refused and alerted | The deal or sheet is updated |
Scope
| Area | Included |
|---|---|
| Discovery | Current update path, a review of deals versus jobs, and webhook settings, with written findings |
| Webhook verify and event map | Signatures, event types and stage rules |
| HubSpot write-back | Deal match, owner map and ordering rule |
| Google Sheets log | Append-only rows keyed by event id |
| Exception queues | No-link and unmapped staff |
| Test plan | The PASS and FAIL checks in this write-up |
| Handover and support | SOPs, walkthrough, 14 days of fixes, optional monthly hour block |
| Not included | Building a full management pack, or changing how sales qualify deals |
Rollout, handover and monthly support
| Milestone | Deliverable | Timing | Share of fee |
|---|---|---|---|
| M1 Discovery and event map | Findings, stage rules and the staff map | Week 1 | 25% |
| M2 Fan-out in a copy | HubSpot and Sheets updated, replay safe | Week 2 | 35% |
| M3 Queues and tests | Parks live, all checks passed | Week 3 | 25% |
| M4 Handover | SOPs, 14 days of fixes | Week 4 | 15% |
Handover
- Written operating procedures for the happy path and each exception in the runbook
- A recorded walkthrough of the architecture, the queue and how to replay an item
- A credentials and ownership list, with every connection in your name
- Fourteen days of fixes after go-live, for defects in the agreed scope
Monthly support
A set block of hours each month, at US$35 per hour, agreed in writing before it starts. Typical use of the block: the no-link queue, new staff names, and any change to the cancel rule
- Review of the exception queue and the weekly digest
- Small mapping or rule changes, agreed before they are made
- A short written note on what was done and what is still open
Typical scope for this kind of project: US$2,000-3,600
About 4 weeks · fixed milestones. The systems health check (US$150, fixed) comes first and confirms the scope. Extra hourly work is US$35 per hour, agreed before it starts. After handover, a set block of hours each month is available at the same rate, agreed in writing, to watch the flows, handle changes and work the exception queue.
Discuss an engagement.
Outline the operational problem through the contact form. I respond with a recommended starting point, including whether the US$150 systems health check is the appropriate first step.