# Build a field service automation with waits, branches and approvals

> Field service automations are more than "when a job is booked, send a text". One rule can send the customer a sign-off link when a technician finishes, chase it for three days, branch on whether they signed, and pause for a manager before the job is invoiced. An AI assistant can write one from a plain-English request, prove it with a dry run, and leave it switched off until you say so.

Source: https://www.fieldproxy.ai/developers/guides/build-a-multi-step-automation

## What field service teams ask for

- Text the customer when the technician is on the way.
- Remind customers the day before and the morning of a visit.
- When a technician marks a no-show, text the customer a link to pick a new time and open a reschedule task.
- Assign a new job to the right technician by service zone.
- Start a response timer on an emergency work order and escalate if nobody is assigned in time.
- Check a technician in when they arrive on site, and tell the next customer they are on the way.
- Book a preventive maintenance visit every six months from the install date.
- Raise a purchase order when stock falls below its reorder level.

Each of those is a ready-made recipe in the platform's reference. The assistant starts from the recipe and fits it to your tables.

## 1. Ask for it

example request:

```text
When a technician marks a job completed, send the customer a link to sign it off.
Remind them every day for three days.
If they sign, mark the job signed off.
If they do not, ask a manager whether to invoice it anyway.
Show me a dry run on a real job before you turn it on.
```

## 2. The rule it writes

A rule is a trigger plus an ordered list of steps. This one passes Fieldproxy's own rule validator. Table and column names differ per workspace, so the assistant reads yours first, and `form_id` is the id of your own published sign-off form.

the rule:

```json
{
  "name": "Job sign-off, chased, then a manager decides",
  "description": "When a technician completes a job, sends the customer a sign-off link and reminds them daily for three days. Signed jobs are marked signed off; unsigned ones go to a manager before invoicing.",
  "category": "Job completion",
  "enabled": false,
  "trigger_type": "status_transition",
  "trigger_config": { "table": "jobs", "field": "status", "to": "completed" },
  "action_spec": {
    "steps": [
      { "type": "condition", "left": "{{trigger.row.customer_email}}", "op": "exists" },

      { "type": "sign_request", "form_id": 7, "record_id": "{{trigger.row.id}}",
        "to": "{{trigger.row.customer_email}}",
        "subject": "Please sign off job {{trigger.row.number}}",
        "body": "Hi {{trigger.row.customer_name}}, the work on job {{trigger.row.number}} is complete. Please review and sign here: {{link.url}}",
        "timeout": "72h", "remind_every": "24h", "max_reminders": 2,
        "reminder_body": "Still waiting on your sign-off for job {{trigger.row.number}}: {{link.url}}",
        "on_timeout": "continue",
        "as": "signature" },

      { "type": "branch",
        "if": { "left": "{{steps.1.signed}}", "op": "eq", "right": true },
        "then": [ { "type": "update_record", "table": "jobs",
                    "set": { "status": "signed_off", "signed_at": "{{steps.1.submission.received_at}}" },
                    "where": { "id": "{{trigger.row.id}}" } } ] },

      { "type": "condition", "left": "{{steps.1.signed}}", "op": "ne", "right": true },

      { "type": "approval_gate",
        "prompt": "Job {{trigger.row.number}} for {{trigger.row.customer_name}} was not signed off after three days. Invoice it anyway?",
        "approvers": { "role": "manager" },
        "timeout": "48h", "on_timeout": "halt" },
      { "type": "condition", "left": "{{steps.4.decision}}", "op": "eq", "right": "approved" },

      { "type": "update_record", "table": "jobs",
        "set": { "status": "ready_to_invoice" },
        "where": { "id": "{{trigger.row.id}}" } }
    ]
  }
}
```

## How to read it

- **Trigger.** `status_transition` fires once, when the technician's update moves the job to `completed`, and hands the steps the full job. There are 15 trigger types, including a schedule, an inbound webhook, a job sitting in a state too long, a date coming up, a technician arriving at or leaving a site, a phone going quiet, a double booking and a total crossing a threshold.
- **Sign-off, chased.** `sign_request` sends the customer a link to your sign-off form, waits up to 72 hours and reminds them every 24 hours, twice. The wait survives restarts, and a re-run never messages the customer twice.
- **Branch.** `branch` runs its steps only when the customer signed. It does not stop the rule.
- **Stop if signed.** The `condition` after it ends the run cleanly for signed jobs, so only unsigned ones reach the manager.
- **Approval.** `approval_gate` parks the run until a manager decides in the approvals inbox, or the timeout passes. The next step reads the decision, and the job moves to invoicing only if it was approved.

## 3. How it gets switched on

- `get_automation_docs` first: the rule anatomy, every trigger and the data it provides, the step library, and 24 complete working recipes for field service.
- `validate_automation` checks the rule without saving it.
- `save_automation` saves it. A new rule is always saved switched off.
- `simulate_automation` runs the real program against a real job with every outward effect replaced by a preview. Nothing is written, sent or called, and you see what each step would have done.
- `set_automation_enabled` turns it on, once you have seen the dry run.

## After it is live

- `list_automation_runs` and `list_failed_runs` show what ran and what failed; `retry_automation_run` retries a failure.
- `list_pending_approvals` and `decide_approval` handle the approval steps.
- Every change to a rule is kept: `list_automation_versions` and `restore_automation_version` put an earlier version back.
- A rule that fails five runs in a row is switched off automatically and its administrators are alerted.

> Steps cover dispatch (assign, find a free slot, book it, optimise a route, check a geofence), records (create, update, query, aggregate), control (condition, branch, for-each, delay, wait until a time, wait for a record to match, approval, rate limit, de-duplicate), customer messages (email, SMS, push, chat, outbound calls, payment links, signature requests), documents (PDFs and Word templates, stamping and merging), AI (extract, classify, summarise, generate, translate) and integrations (HTTP calls, signed webhooks, accounting and database sync). Secrets come from the workspace vault, never from the rule.

## Questions

### Can an AI assistant build a field service automation in Fieldproxy?

Yes. Through the MCP server an assistant can write a rule with waits, branches, loops and manager approvals, for work such as appointment reminders, no-show recovery or sign-off chasing. It validates the rule, dry-runs it against a real job and saves it switched off for a person to enable.

### Can Fieldproxy chase a customer's sign-off automatically after a job?

Yes. One step sends the customer a link to sign, waits, and reminds them at the interval you set. The rule can then mark the job signed off, or route an unsigned job to a manager.

### Can a field service automation wait for a manager's approval?

Yes. An approval step parks the run until a manager approves or rejects it in the approvals inbox, or a timeout passes, and the following steps act on the decision.

### How do I test an automation without texting a customer?

Dry-run it. A simulation runs the rule against a real job and shows what every step would do; nothing is written, sent or called.

### How many trigger types do Fieldproxy automations have?

Fifteen, including job and record changes, a status change, a schedule, an inbound webhook, time spent in a state, a date coming up, entering a service zone, a technician arriving at a site and a total crossing a threshold.

## This is one way, not the only way

This guide shows one common way to do it. A Fieldproxy workspace can be reached from every side, and anything in it can be read, changed or automated:

- REST API: read, insert, update and delete on any table the key allows ([REST API reference](https://www.fieldproxy.ai/developers/docs/rest-api)).
- MCP server: 170+ tools for Claude, ChatGPT, Copilot, Cursor and your own agents, including read-only SQL, proposed writes, automations and app building ([MCP tools](https://www.fieldproxy.ai/developers/docs/mcp-tools)).
- Automations: 15 trigger types and about 50 step types, with webhooks in and signed webhooks and HTTP calls out ([Webhooks and automations](https://www.fieldproxy.ai/developers/docs/webhooks-automations)).
- Public forms, record links and customer portals for people outside the company ([Public forms and links](https://www.fieldproxy.ai/developers/docs/public-forms)).
- Apps as JSON: new screens, fields, tables and workflows ([Apps as JSON](https://www.fieldproxy.ai/developers/docs/apps-as-json)).
- Voice and text agents that work from the same data ([Voice and text agents](https://www.fieldproxy.ai/developers/docs/agents)).
- Not listed here? Fieldproxy's team builds integrations with the other systems you use as part of setting up your workspace. [Tell us what you need](https://www.fieldproxy.ai/book-demo?source=dev-guides).

More: [REST API reference](https://www.fieldproxy.ai/developers/docs/rest-api) · [OpenAPI](https://www.fieldproxy.ai/developers/openapi.json) · [All guides](https://www.fieldproxy.ai/developers/guides)