Browse the docs

Agent setup guide

Samsara HOS Violation Alert

Every new Hours of Service violation in Samsara reaches dispatch in Slack with the driver's phone, Samsara's rule and a plain-words first step.

Available About 8 min to set up

What it does

Every new Hours of Service violation in Samsara reaches dispatch in Slack with the driver's phone, Samsara's rule and a plain-words first step.

  • Starts on each new Hours of Service violation Samsara records (checked every few minutes).
  • Reads the driver's phone and username from Samsara.
  • AI explains the violation in plain words and picks the first step from your rules, without typing any times.
  • Posts Samsara's rule name, start time and minutes in violation with the explanation to your Slack channel.

What it needs

  • A paid plan (agents run live on paid plans).
  • An AI provider key (Settings → AI Providers).
  • Samsara (an API token with Read ELD Compliance Settings (US) and Read Drivers; HOS needs Telematics Essential Plus) and Slack, connected in Settings → Integrations.

What it doesn't do

  • It doesn't edit logs, contact the driver or tell anyone a violation is acceptable.
  • It doesn't give legal or regulatory advice.
  • One alert per violation; violations Samsara reports more than 48 hours late aren't picked up.

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 and Slack.
  • The app it watches, connected in Settings → Integrations (the agent starts from an app event).
  • About 8 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. Connect Slack

Connect the Slack workspace for the alerts (Settings → Integrations → Slack).

4. Pick the Samsara account

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

SettingWhat to enterIn step
Samsara accountYour Samsara connection. Pick your connected Samsara account.“New HOS violation in Samsara”
Samsara account (same one)The same Samsara connection. Pick your connected Samsara account.“Read the driver”

5. Describe your rules

Open “Explain the violation” and replace the placeholder.

SettingWhat to enterIn step
Your dispatch rulesReplace the placeholder with your fleet, who dispatches, what to do when a driver is in or near a violation, and who handles compliance. It starts as “[YOUR FLEET, WHO YOUR DISPATCHERS ARE, WHAT A DISPATCHER SHOULD DO WHEN A DRIVER IS IN OR NEAR AN HOS VIOLATION (E.G. CALL THE DRIVER, FIND RELIEF, TELL THE CUSTOMER) AND WHO HANDLES SAFETY / COMPLIANCE]” until you replace it.“Explain the violation”

6. Pick the Slack channel

Open “Alert dispatch” and pick the workspace and channel.

SettingWhat to enterIn step
Slack accountThe Slack workspace for the alerts. Pick your connected Slack account.“Alert dispatch”
Slack channelWhere dispatch sees alerts, e.g. #dispatch.“Alert dispatch”

7. Test it with Dry Run

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

8. 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 5 steps (1 AI step). You can open, edit and monitor it like any other workflow.

  • New HOS violation in Samsara — Starts on “New HOS violation” in Samsara (an app event). Starts a run for each new Hours of Service violation (Samsara checked every few minutes; violations of the last 48 hours are read).
  • Read the driver — Samsara: Get a driver. Reads the driver's phone and username from Samsara.
  • Explain the violation — AI step (runs on your AI provider key). AI explains Samsara's violation in plain words and picks the first step from your rules. It doesn't type times or hours: those come from Samsara.
  • Alert dispatch — Slack: Post a message. Posts the violation (Samsara's rule, start time and minutes) and the AI explanation to your dispatch channel.
  • Alert posted — Kept in the run history. The run history keeps every alert.

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

key, driver_id, driver_name, type, description, started_at, duration_minutes, day_start, day_end.

  • 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 change the driver's logs?

No. It only reads the violation and the driver's details, and posts to Slack. Log edits stay with the driver and your compliance team.

Which Samsara plan do I need?

Samsara's HOS data needs a Telematics Essential Plus license, and the token needs the Read ELD Compliance Settings (US) and Read Drivers scopes.

How quickly does the alert arrive?

Samsara is checked every few minutes on your plan's schedule, so alerts arrive within minutes of Samsara recording the violation.

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.
  • Slack says the app isn't in the channel: in Slack, type /invite @Fluxo Flow in that channel (always needed for private channels).
  • 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 .