Manaz Afzal Book a consultation

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.

Findings from the review
IDFindingEvidenceRisk if left
F1Sales hear that a job is finished only when someone remembers to update the dealDeals still in "Booked" with completed ServiceM8 jobsFollow-up and invoicing questions start from the wrong stage
F2The operations sheet is a day behind, and two rows were overwrittenSheet history, and a missing job from TuesdayThe morning brief uses stale counts
F3ServiceM8 webhooks are not verified, and a test hook once posted twiceTwo identical events, two sheet rowsTotals cannot be trusted
F4Cancelled jobs still appear as active in HubSpotNo cancel event mappedPipeline value is overstated
F5Staff names in ServiceM8 do not match HubSpot owner recordsFive unmatched names in a weekThe deal owner is left blank

Approach

  1. Verify every webhook

    Unsigned or stale events are refused.

  2. Map each event once

    A written stage and a sheet row type, with the event id as the key.

  3. Write back in order

    An older event cannot overwrite a later stage.

  4. Park what cannot be mapped

    No deal, or an unknown staff name, waits for a person.

Current state and future state

Event fan-out, current and future

Current state

ServiceM8Job changes
Someone noticesOr not
HubSpotUpdated later
SheetKeyed, often late

Future state

ServiceM8 webhookSigned event
n8nVerify, map, fan-out
HubSpot dealStage write-back
Google SheetsAppend-only log

Future-state modules

ServiceM8Signed webhookn8nVerify, map, keyHubSpotDeal stage and job no.Google SheetsAppend-only log

How it is built

Module-level build
  1. Module AWebhook verify

    The signature is checked. An unsigned or stale event is refused and logged.

  2. Module BEvent map

    Created, scheduled, on site, completed, cancelled and invoice-raised each have a HubSpot stage and a sheet row type.

  3. Module CHubSpot write-back

    The deal is found by the stored deal id, or parked if no deal is linked.

  4. Module DSheets log

    One append-only row per event, with the event id as the key, so a replay cannot add a second row.

  5. Module EStaff map

    ServiceM8 staff names are mapped to HubSpot owners before go-live, and an unmapped name is parked.

Field mapping

Event map, ServiceM8 to HubSpot and Sheets
ServiceM8 eventHubSpot dealGoogle Sheets rowIdempotency
Job createdStage stays, job number written if already linkedType: created, with source and siteevent id
Job scheduledStage to Booked, window writtenType: scheduled, window and techevent id
On siteStage to On siteType: on site, timestampevent id
CompletedStage to DoneType: completed, timestampevent id
CancelledStage to Lost only if the written rule says so, otherwise a task for salesType: cancelled, reasonevent id
Invoice raised in the job systemA property on the deal, not a new dealType: invoiced, amountevent id

Worked exhibits

One week of events, walkthrough figures
Webhook events1,086
Written to HubSpot1,042deals found
Parked, no deal link27for a person to match
Parked, unmapped staff6
Duplicate events blocked11same event id
The deal and the log after a completion event
HubSpot · deal D-4410
JobJOB-17620
StageDone
WindowWed 13:00-15:00
OwnerMapped staff record
Last eventCompleted, 14:16
Google Sheets · events log
event_ids8-evt-99012
job17620
dealD-4410
typecompleted
at14:16
rowAppended once

Exceptions and runbook

Exception runbook
CaseRuleWho actsFirst action
No HubSpot deal for the jobPark in a no-link queue, still append the sheet rowSales adminLink the deal, then replay the event
Unmapped staff namePark the owner write, still update the stageOperationsAdd the map, then replay
Cancelled jobFollow the written rule: either Lost, or a task for sales to decideSalesDo not silently reopen a lost deal
Late or out-of-order eventApply only if it is newer than the last applied timestamp for that jobFlowAn older "scheduled" event cannot overwrite "completed"
Signature failRefuse, alertOperationsCheck the webhook secret; do not process the body

How to read the exhibits

  1. The weekly counts show webhook events and parked records.
  2. The two windows should share the same job number, deal id and completion time.
  3. The sheet is append-only: corrections are new rows, not silent edits.

Test plan

PASS / FAIL checks
IDCheckMethodPASS whenFAIL when
T1Completion write-backFire a completed event for a linked dealStage is Done, sheet has one rowStage unchanged, or two rows
T2ReplaySend the same event id twiceOne sheet row, one HubSpot updateA second row
T3Out of orderSend completed, then an older scheduled eventStage stays DoneStage moves back to Booked
T4No dealFire an event with no deal idParked, sheet still appendedA new HubSpot deal is invented
T5Cancel ruleCancel a booked jobThe written rule is followed, and a sheet row is addedThe deal is silently lost or left booked
T6Bad signaturePost an unsigned eventRefused and alertedThe deal or sheet is updated

Scope

AreaIncluded
DiscoveryCurrent update path, a review of deals versus jobs, and webhook settings, with written findings
Webhook verify and event mapSignatures, event types and stage rules
HubSpot write-backDeal match, owner map and ordering rule
Google Sheets logAppend-only rows keyed by event id
Exception queuesNo-link and unmapped staff
Test planThe PASS and FAIL checks in this write-up
Handover and supportSOPs, walkthrough, 14 days of fixes, optional monthly hour block
Not includedBuilding a full management pack, or changing how sales qualify deals

Rollout, handover and monthly support

MilestoneDeliverableTimingShare of fee
M1 Discovery and event mapFindings, stage rules and the staff mapWeek 125%
M2 Fan-out in a copyHubSpot and Sheets updated, replay safeWeek 235%
M3 Queues and testsParks live, all checks passedWeek 325%
M4 HandoverSOPs, 14 days of fixesWeek 415%
Handover and monthly support

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.

Related work snippets

Next step

Bring me the work that repeats.

I scope it in writing, test it against your current process on your own data and hand over everything I build.

Book a consultation