OpenClaw + n8n + ServiceM8: Build an AI Dispatch Assistant That Learns Your Preferences featured image
Integrations

OpenClaw + n8n + ServiceM8: Build an AI Dispatch Assistant That Learns Your Preferences

Build a self-hosted AI dispatch assistant using OpenClaw, n8n, and ServiceM8. It reads job requests, checks engineer availability, and learns your assignment …

TrainAR Team 1 day ago 13 min read

Quick Answer

Wire OpenClaw (a self-hosted AI agent) into n8n, pull live job and staff data from ServiceM8, and let the AI recommend the best engineer for every new job. The whole stack runs on a cheap VPS for under £30/month, learns your dispatch preferences over time, and replaces what ServiceTitan charges £200+ per technician for.

TrainAR Academy
TrainAR Academy Integration Guide · March 2026

What This Stack Does

OpenClaw logo OpenClaw
n8n logo n8n
ServiceM8 logo ServiceM8

Most field service businesses still dispatch jobs the old-fashioned way: someone checks the diary, rings around, and hopes the nearest available engineer picks up. It works until you have six engineers, fifteen jobs, and a customer chasing an emergency callback.

This integration connects three tools into an AI-powered dispatch pipeline. ServiceM8 holds your jobs, staff, and schedules. n8n handles the automation (webhook triggers, API calls, data routing). OpenClaw provides the AI brain that analyses job details against engineer availability and recommends the best assignment, learning from every decision you make.

The result: every time a new job lands in ServiceM8, your AI dispatch assistant checks who is free, who is closest, and who has the right skills. It suggests an engineer and books the allocation automatically. If you override the suggestion, it learns from that too. The more you use it, the better it gets.

Overhead view of dispatch planning tools including a tablet, paper schedule, and work orders on a desk
Modern dispatch planning combines digital tools with field experience
20-30%
Travel time saved with optimal dispatch
£30/mo
Total hosting cost (VPS + API calls)
180K+
GitHub stars for OpenClaw
11
Nodes in the dispatch workflow

Why Smart Dispatch Matters

Bad dispatch costs more than you think. Send an engineer from Bristol to a job in Bath when you have someone already finishing up in Bath, and you have just wasted an hour of billable time, burnt fuel, and frustrated a customer waiting longer than needed.

Commercial dispatch platforms like ServiceTitan solve this problem, but they charge £200+ per technician per month. For a team of ten, that is £24,000 a year just for dispatch intelligence. Most small and medium trades businesses cannot justify that spend, so they stick with whiteboards and gut feeling.

This stack gives you 80% of the intelligence at 2% of the cost. OpenClaw runs on a £5/month VPS, n8n self-hosted is free, and ServiceM8 starts at £29/month. The AI is not as polished as ServiceTitan's, but it learns your specific preferences: which engineers prefer which postcodes, who handles emergency callouts best, and which team members should never be sent to the same site together.

The Maths

A plumbing firm with 8 engineers averaging 4 jobs/day spends roughly 90 minutes per day on dispatch decisions. At £45/hour, that is £67.50/day or £16,875/year in admin time alone. Even a 50% reduction in dispatch time saves over £8,000 annually, before counting fuel savings from smarter routing.

Hand moving a magnet on a traditional dispatch planning board with engineer names and time slots
Manual dispatch boards work fine for small teams but fall apart at scale

How OpenClaw, n8n, and ServiceM8 Connect

The architecture is straightforward. ServiceM8 fires a webhook when a new job is created. n8n catches that webhook, pulls the job details and staff availability from the ServiceM8 API, formats everything into a prompt, and sends it to OpenClaw's AI agent. The agent returns a recommendation, n8n creates the job allocation in ServiceM8, and the assigned engineer gets a push notification on their phone. If you already use n8n with ServiceM8 for other automations, this workflow slots right into your existing setup.

1

ServiceM8 Webhook Fires

A new job is created or updated in ServiceM8. The webhook sends the job UUID to your n8n instance via HTTP POST.

2

n8n Fetches Context

n8n calls the ServiceM8 API three times in parallel: job details (/api_1.0/job/{uuid}.json), active staff list (/api_1.0/staff.json), and today's existing allocations (/api_1.0/joballocation.json).

3

Context Gets Prepared

A Code node combines all three API responses into a single dispatch prompt. It builds a summary of each engineer's current workload, lists their jobs for the day, and formats the new job details.

4

AI Agent Decides

The prompt goes to the AI Dispatch Agent (powered by Claude Sonnet 4.6). The agent has persistent memory via a Buffer Window node, so it remembers past assignments and any feedback you have given. It returns a JSON object with the recommended engineer and reasoning.

5

Allocation Created

n8n parses the AI response, extracts the staff_uuid, and creates a new job allocation in ServiceM8 via POST /api_1.0/joballocation.json. The engineer sees the job appear on their ServiceM8 mobile app immediately.

Why Claude, Not GPT?

This workflow uses Claude Sonnet 4.6 because it handles structured JSON output reliably and costs less per token than GPT-5. You can swap in any LLM that OpenClaw supports; just change the model name in the Claude Chat Model node. The dispatch prompt stays the same regardless of which model you use.

What You Need Before Starting

This integration requires some technical confidence. You do not need to be a developer, but you should be comfortable following terminal commands and editing JSON files. Businesses already running n8n automations for their trade business will find this a natural next step.

RequirementDetailsCost
ServiceM8 accountActive subscription with API access enabled. You need at least 2 staff members and existing jobs to test.£29+/mo
n8n instanceSelf-hosted (Docker) or n8n Cloud. Self-hosted is free; cloud starts at £20/mo.Free-£20/mo
OpenClaw / LLM API keyAnthropic API key for Claude Sonnet 4.6 (or OpenAI key for GPT-5). Typical dispatch prompt uses ~500 tokens.~£5/mo
VPS (if self-hosting)2GB RAM minimum. Hetzner CAX11 or similar ARM VPS. Runs both n8n and OpenClaw comfortably.£3-5/mo
ServiceM8 API keyGenerate from ServiceM8 Settings > Integrations > API Keys. Used in n8n HTTP Request nodes.Included
Interior of a trade van with sat nav showing route planning on the dashboard
Smart dispatch means less windscreen time and more billable hours

The n8n Workflow: Step by Step

Here is the complete dispatch workflow. It has 11 nodes: a webhook trigger, three parallel API calls to ServiceM8, a Code node that prepares the dispatch context, the AI agent with its language model and memory sub-nodes, a response parser, the allocation creator, and a webhook response node.

AI Dispatch Assistant Workflow

Get This Workflow

Download the complete AI Dispatch Assistant workflow JSON and import it into your n8n instance. You will need to configure your ServiceM8 API key and Anthropic API key after importing.

Download n8n Workflow JSON

How to Import This Workflow into n8n

Click "Download n8n Workflow JSON" above to save the workflow file. Then open your n8n instance, click the three-dot menu in the top right corner, and select "Import from File". Upload the JSON file, then configure your credentials (ServiceM8 API Key as HTTP Header Auth, Anthropic API Key). Test the workflow by clicking "Execute Workflow" and activate it when you are happy with the results.

Laptop screen showing abstract workflow diagram with connected nodes on a desk
The n8n workflow editor makes it easy to visualise and modify the dispatch logic

Each node in the workflow does one specific job. The webhook catches the ServiceM8 event. The three HTTP Request nodes pull data in parallel (staff, allocations, and the specific job). The Code node merges everything into a dispatch prompt. The AI agent processes the prompt with memory context. The parser extracts the JSON recommendation. And the final HTTP Request node creates the allocation back in ServiceM8.

Teaching the AI Your Preferences

The real power of this stack is not the initial dispatch recommendation. It is how the AI improves over time. The Buffer Window Memory node stores the last 20 dispatch conversations, so the AI remembers which engineers it recommended for recent jobs and what feedback it received.

Here is how the learning cycle works in practice:

Week 1: The AI dispatches based purely on workload balance. It picks the engineer with the fewest jobs that day. This is a sensible default but ignores your business knowledge.

Week 2-3: You start overriding suggestions. Maybe you always send Dave to commercial jobs because he has the right certifications. Or you never send the apprentice to emergency callouts. Each override goes through the same workflow, and the AI sees the pattern in its memory window.

Week 4+: The AI starts anticipating your preferences. It factors in the patterns it has seen: Dave gets commercial work, the apprentice gets supervised maintenance jobs, Sarah handles the high-value clients because she is great with people. You override less and less. Trades businesses that have tried AI agents for customer communication will recognise this same learning curve.

Memory Limitations

The Buffer Window stores the last 20 dispatch conversations, not your entire history. If you have seasonal patterns (more heating jobs in winter, more AC work in summer), the AI may need a few days to readjust at each season change. For longer-term memory, consider adding a Google Sheets node that logs every dispatch decision and feeds a summary back into the prompt.

Split comparison showing chaotic paper-based dispatch on the left and clean digital tablet dispatch on the right
Before and after: from paper chaos to AI-assisted dispatch

Cost Comparison: DIY vs Commercial

Here is what this stack actually costs compared to the commercial alternatives. These figures assume a team of 8 engineers processing around 30 jobs per day.

FeatureOpenClaw + n8n + ServiceM8ServiceTitan AI Dispatch
Monthly cost (8 engineers)£30-55/mo total£1,600+/mo
AI dispatch recommendationsYes (any LLM)Yes (proprietary)
Learns preferencesYes (memory buffer)Yes (ML model)
Self-hosted optionFully self-hostedCloud only
Customisable logicFull n8n workflow editorLimited settings
Setup complexity2-3 hours technical setupGuided onboarding
UK trades focusFully customisableUS market focus
Data ownership100% yoursVendor-hosted

The savings are dramatic for small businesses. If you are already paying for ServiceM8 and self-hosting n8n, the incremental cost of adding AI dispatch is just the LLM API calls, roughly £5/month for a busy team. Even if you use n8n Cloud and pay for a VPS, the total stays under £55/month. Businesses looking at other ways to cut costs through automation should check our guide to essential automation workflows for trades.

Monthly Cost Breakdown

£29/mo
Free
£5/mo
~£5/mo
£1,600+/mo

Video Tutorials

ServiceM8 Beginners Guide

ServiceM8 Beginners Guide to Field Service Management

ServiceM8

n8n Beginner Course

n8n Beginner Course: Automate Anything

n8n

Automating ServiceM8 with n8n

Automating ServiceM8 with n8n: My First Workflow

Hazel Whicher

Build AI Agents with n8n

How to EASILY Build AI Agents with n8n (Full Tutorial)

Tyler AI

Automate more with n8n ServiceM8

Automate More with n8n: ServiceM8 14

ServiceM8

n8n Course for Beginners

n8n Course for Beginners: Build Complex Workflows

freeCodeCamp.org

Automate a Plumbing Company

How I'd Automate a Plumbing Company in 15 Steps

Nick Saraev

OpenClaw AI Employee

OpenClaw on Mac Mini: The AI Employee for Business

Mark Loman

What the Community Thinks

Our Verdict

This stack is not for everyone. If you have three engineers and twenty jobs a week, a whiteboard works fine. But once you hit 6+ engineers and 15+ jobs a day, dispatch becomes a real bottleneck that costs you money in wasted travel, missed appointments, and admin overhead. The OpenClaw + n8n + ServiceM8 combination gives you AI-powered dispatch at a fraction of the cost of commercial alternatives, with full control over the logic and your data.

Best for: Growing trades businesses with 6-20 engineers who need smarter dispatch without enterprise pricing

Time saved: 45-90 minutes per day in dispatch admin, plus 20-30% less travel time per engineer

Money saved: £1,500+/month versus commercial AI dispatch platforms

Setup time: 2-3 hours for someone comfortable with n8n. Half a day if you are new to automation

The learning curve is steeper than a plug-and-play SaaS product. But the trade-off is complete ownership: you control the AI prompts, the dispatch rules, and every byte of data. For a UK-focused guide on whether switching FSM platforms is worth the effort, read our data-driven guide to the real cost of switching.

Frequently Asked Questions

Yes. The AI Dispatch Agent node in n8n supports multiple LLM providers. Swap the Claude Chat Model sub-node for an OpenAI Chat Model node, configure your OpenAI API key, and the rest of the workflow stays the same. GPT-5 works well for structured JSON output, though Claude tends to be slightly cheaper per token for this use case.

Reassign the job in ServiceM8 as you normally would. The AI's memory buffer stores the context of each dispatch, so over time it learns from your corrections. You can also add explicit rules to the system prompt (e.g., "Never send apprentices to emergency callouts") to prevent specific mistakes.

The dispatch logic and AI agent work with any FSM that has an API. You would need to replace the ServiceM8-specific HTTP Request nodes with equivalent calls to your FSM's API. Jobber uses GraphQL, Tradify has a REST API, and simPRO uses REST. The n8n workflow structure stays the same; only the API endpoints and field names change.

Each dispatch prompt uses roughly 500-800 tokens (input + output). With Claude Sonnet 4.6 pricing, that is approximately £0.002-0.004 per decision. A busy team processing 30 jobs per day would spend about £3-4 per month on API calls. Even with GPT-5 at slightly higher per-token rates, you would stay under £10/month.

Yes. Add a Google Maps Distance Matrix API call as an extra node between "Get Job Details" and "Prepare Dispatch Context". Fetch the distance from each engineer's last known location to the new job site. Include the distances in the dispatch prompt so the AI can factor in proximity alongside workload balance. The API costs are minimal for this use case.

Share this article

Ready to Transform Your Business?

Turn every engineer into your best engineer and solve recruitment bottlenecks

Join the TrainAR Waitlist

Stay Updated

Get weekly insights delivered to your inbox.

Recommended Articles

comments powered by Disqus