Browse the docs

Agent setup guide

Samsara DVIR Defect to Work Order

Each defect a driver reports on a Samsara DVIR becomes a clear work order emailed to your shop, prioritized by your rules.

Available About 7 min to set up

What it does

Each defect a driver reports on a Samsara DVIR becomes a clear work order emailed to your shop, prioritized by your rules.

  • Starts on each new open defect reported on a Samsara DVIR (checked every few minutes).
  • Reads the vehicle's name, VIN and plate from Samsara.
  • AI writes the work order with the driver's words quoted and a priority from your rules; it doesn't diagnose.
  • Code checks the work order, then it's emailed to your shop.

What it needs

  • A paid plan (agents run live on paid plans).
  • An AI provider key (Settings → AI Providers).
  • Samsara (Read Defects and Read Vehicles scopes; DVIRs need Telematics Essential), connected in Settings → Integrations.

What it doesn't do

  • It doesn't resolve the defect in Samsara or book the repair.
  • It doesn't diagnose causes or order parts.
  • Trailer defects are sent with the trailer ID only.

Availability and plans

Available

Its workflow is built and tested, and every app it needs is live. You can get it and set it up now.

Included free on the Enterprise plan; on other paid plans it's a one-time purchase per workspace (the price is on the Agents page). The Agents page in the app always shows its current status.

Before you start

  • A paid plan: agents run live, and the Free plan only runs Dry Runs.
  • An AI provider key (OpenAI, Anthropic, Google and more) in Settings → AI Providers. AI usage is billed by your provider.
  • These apps, connected in Settings → Integrations: Samsara.
  • The app it watches, connected in Settings → Integrations (the agent starts from an app event).
  • About 7 minutes.

Set it up step by step

Get the agent first (buy it, or it's already yours when your plan includes it), then in Agents → My agents press “Set up this agent”. That creates the agent's workflow in your workspace (it counts towards your plan's workflow limit) and opens the canvas with a setup checklist above it. Each item links to the exact place to go and ticks itself off when it's done.

1. Connect your AI provider

The AI steps run on your own key (OpenAI, Anthropic, Google and more). Add one in Settings → AI Providers.

2. Connect Samsara

Connect Samsara with your own API token (Settings → Integrations → Samsara lists the read scopes each step needs).

3. Pick the Samsara account

Open the trigger and “Read the vehicle” and pick your Samsara connection.

SettingWhat to enterIn step
Samsara accountYour Samsara connection. Pick your connected Samsara account.“New DVIR defect in Samsara”
Samsara account (same one)The same Samsara connection. Pick your connected Samsara account.“Read the vehicle”

4. Describe your shop

Open “Write the work order” and replace the placeholder.

SettingWhat to enterIn step
Your shop and prioritiesReplace the placeholder with your shop, how urgent each kind of defect is and how you write work orders. It starts as “[YOUR SHOP OR MAINTENANCE VENDOR, HOW URGENT EACH KIND OF DEFECT IS FOR YOU (E.G. BRAKES, LIGHTS, TIRES = OUT OF SERVICE UNTIL FIXED), WHO APPROVES REPAIRS AND HOW YOUR WORK ORDERS ARE WRITTEN]” until you replace it.“Write the work order”

5. Where work orders go

Open “Email the shop” and enter the address.

SettingWhat to enterIn step
Shop emailThe shop or maintenance inbox that gets work orders. It starts as “shop@your-company.example” until you replace it.“Email the shop”

6. Test it with Dry Run

Press Dry Run: the agent runs on sample data with no messages sent and nothing written to your apps.

7. Switch the trigger on

Open the trigger and click “Activate app trigger”: Samsara is checked every few minutes.

How it works

The agent is a normal workflow with 8 steps (1 AI step). You can open, edit and monitor it like any other workflow.

  • New DVIR defect in Samsara — Starts on “New DVIR defect” in Samsara (an app event). Starts a run for each new open defect reported on a Samsara DVIR (checked every few minutes).
  • Read the vehicle — Samsara: Get a vehicle. Reads the vehicle's name, VIN and plate from Samsara.
  • Write the work order — AI step (runs on your AI provider key). AI turns the driver's defect report into a clear work order for your shop, with a priority from your rules. It copies the driver's words and doesn't diagnose.
  • Check the work order — Step. In code: a title and a body, no leftover placeholders, a known priority.
  • Passed the checks? — Decision: picks the branch to follow. Passed: the work order is emailed. Otherwise it's kept in the run history.
  • Held: work order not sent — Kept in the run history. Branch: Held. The draft was blank or still had a placeholder; check the run history.
  • Email the shop — Sends an email from your workspace's sender. Branch: Send. Emails the work order to your shop or maintenance inbox.
  • Work order sent — Kept in the run history. The run history keeps every work order.

Test it with Dry Run

Press Dry Run in the canvas. The agent runs on the sample data stored on its trigger (the “Sample data for Dry Run” box), so you can check every step's output before anything is live. The sample has the same shape as a real event from the app.

Sample data fields

id, dvir_id, comment, safety_status, defect_type_id, created_at, vehicle_id, trailer_id.

  • Nothing is sent or written: app actions, emails and Slack posts are simulated, and AI steps don't call your AI provider.

Go live

  • Open the trigger and click “Activate app trigger”: Samsara is checked every few minutes.
  • Activating the app trigger needs the trigger's connected account. The first check only remembers what's already there, so older items don't start runs; the same item never starts two runs.
  • The setup checklist adds a “paid plan” item before activation: live runs need a paid plan (the Free plan only runs Dry Runs).
  • When every checklist item is done and the trigger is on, the checklist says “Live — this agent is running”. Follow its runs in the workflow's History tab and in Analytics → Agents.

Questions

Does it decide if a truck is safe?

No. The driver's safe / unsafe call and your own rules set the priority; your mechanic decides. Anything the driver marked unsafe is sent as out of service.

Does it close the defect in Samsara?

No. Resolve it in Samsara once the work is done (the Samsara connector has a “Resolve a DVIR defect” step if you want to add it).

Which Samsara plan do I need?

DVIRs and defects need Samsara's Telematics Essential license and the Read Defects and Read Vehicles scopes.

Troubleshooting

  • “No AI provider connected” or a rejected key: connect or fix the key in Settings → AI Providers, then press Test there.
  • A checklist item stays unticked: the setting is still empty or still contains its placeholder text. Open the step from the checklist and fill it in.
  • An app step fails with “Needs reconnect”: the account's access was revoked or expired. Reconnect it in Settings → Integrations.
  • No runs start: activate the app trigger with a connected account. Only items created after activation start runs.
  • A step failed: open the run in History and check that step in the Trace tab for the error and what it received.

Generated from the agent's own workflow, so it always matches what the agent does. Last updated .