---
title: "Detention past free time approved in Teams, then billed and paid in McLeod | FlowRunner flow"
description: "When a McLeod load delivers, this flow checks each stop's arrival and departure against free time and asks your ops manager in Teams before it bills the customer and pays the carrier."
url: https://flowrunner.ai/flows/microsoft-teams-detention-past-free-time-approved
date_published: 2026-11-27
date_modified: 2026-11-28T11:55:38-08:00
---

# Detention past free time approved in Teams, then billed and paid in McLeod

When a McLeod load delivers, this flow checks each stop's arrival and departure against free time and asks your ops manager in Teams before it bills the customer and pays the carrier.

## The prompt

When a load is delivered in McLeod, look at each stop's actual arrival and departure. Start the clock when the appointment window opens if the truck was early, take off our 2 free hours, and count nothing at a stop the truck reached after its window closed. If there's detention left and the load doesn't already have a detention charge or detention pay, post a card to our ops channel in Microsoft Teams with the stop times, the hours, what we'd bill the customer and what we'd pay the carrier, with Add detention and No detention buttons, and wait for the ops manager. If they approve, add the detention to the carrier's extra pay and to the customer's charges on the load in McLeod, and confirm in the Teams thread.

FlowRunner Prompt to Flow built this flow from that request. Here it is as it opens in the editor.

## The flow

[Import this flow](https://flowrunner.ai/downloads/prompt-to-flow/microsoft-teams-detention-past-free-time-approved.json)

-   [Microsoft Teams](https://flowrunner.ai/integrations/microsoft-teams)
-   [McLeod LoadMaster](https://flowrunner.ai/integrations/mcleod-loadmaster)

Download the file, then in FlowRunner click + beside Flows, pick it under Import a Flow Version and click Create. [How importing works](https://docs.flowrunner.ai/manage/flows#importing-a-flow)

## What each step does

1.  Load delivered in McLeod Checks McLeod every 5 minutes for loads that just moved to Delivered.
2.  Get the stop times from McLeod Reads the load's stops with their appointment windows and actual arrival and departure, the customer charges, the carrier and the carrier's extra pay.
3.  Work out detention at each stop Counts the time on site at each stop from arrival, or from when the window opens if the truck was early, takes off your free time and rounds up to the quarter hour. A truck that arrived after its window gets nothing at that stop.
4.  Detention past free time? A load with no detention past free time, or one that already carries a detention charge or detention pay, stops here.
5.  Ask the ops manager Posts an Adaptive Card to your ops channel in Teams with every stop's times, the billable hours, the customer charge and the carrier pay, and two buttons, Add detention and No detention.
6.  Wait for the ops manager's answer The run waits for the click. No detention leaves the load as it is and says so in the Teams thread.
7.  Pay the carrier detention Adds the hours at your carrier rate to the carrier's extra pay on the movement in McLeod.
8.  Bill the customer detention Adds the hours at your customer rate to the load's charges under your detention charge code, then confirms both amounts in the Teams thread.

## We can build this for you.

It's custom work, built around how you do things by our implementation team at Midnight Flow, in your own FlowRunner workspace.

-   Every carrier invoice matched to its rate confirmation and POD, extra charges sent to you, and billing released
    
    Built and tested by our team. Runs on your FlowRunner plan.
    
    [Have us build this](https://midnightflow.ai/packages/carrier-invoice-matching?utm_source=flowrunner.ai&utm_medium=referral&utm_campaign=freight-brokers&utm_content=flows.aside&utm_term=microsoft-teams-detention-past-free-time-approved)

## Before you turn it on

-   Enter your McLeod server address and API token, or a user name and password, in the McLeod LoadMaster settings, and connect your Microsoft Teams account. The card is posted as that account, so it must be a member of the ops channel.
-   In Teams, open your ops channel's menu and choose Get link to channel. Put the groupId value from the link in the flow setting Teams team ID, and the part after /channel/ in Teams channel ID, written as 19:...@thread.tacv2 (%3a is a colon and %40 is @).
-   Set Customer detention rate per hour and Carrier detention rate per hour to your terms, and change Free time hours (2), Detention charge code (DET) and Detention pay code (DET) if yours differ.
-   Copy the URL of the block Wait for the ops manager's answer into the flow setting Answer link. The card's buttons open it.

[Everything FlowRunner does with Microsoft Teams](https://flowrunner.ai/integrations/microsoft-teams)

---
Markdown version of https://flowrunner.ai/flows/microsoft-teams-detention-past-free-time-approved. Site index: https://flowrunner.ai/llms.txt
