FlowRunner
Features Pricing
Theme
Start Free

Carrier invoice checked against McLeod before it becomes a Xero bill

Carriers email invoices to your AP inbox. This flow checks each one against the agreed carrier pay in McLeod and enters a match as a Xero bill with the PDF attached.

The prompt

When a carrier emails an invoice to our AP inbox in Gmail, read the PDF and pull out the carrier, invoice number, load number, PRO, dates, total and each charge. Find the load in McLeod and the carrier in Xero by its exact name, and skip the invoice if that carrier already has a bill with the same invoice number. Compare the invoice with the load: same carrier, a total that matches the agreed carrier pay to the cent, and every accessorial on the invoice also in the carrier's extra pay. If it matches, enter it in Xero as a bill awaiting payment, with the load number as the reference, and attach the carrier's PDF to the bill. If it doesn't, ask the AP lead in Slack with Book it and Hold it buttons and wait for the answer. Tell AP in Slack when the load or the carrier can't be found.

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

The flow

Yes No No Yes No Yes No Yes Yes No Condition Carrier in Xero? Code Compare with theagreed carrier pay Condition Matches the agreedpay? Action Confirm theinvoice is held Action Save the invoicefile Condition Book it? Action Find the carrierin Xero Asks a person Ask the AP lead Action Tell AP it's arepeat Action Create the bill Asks a person Wait for the AP lead'sanswer Action Send unmatchedinvoice to AP Starts the flow New carrierinvoice email Action Look for the bill inXero Action Tell AP the carrieris missing Condition Already entered? AI agent Read the carrierinvoice Action Find the load inMcLeod Condition Load found? If a step fails No load number onthe invoice If a step fails PDF not attached Action Tell AP to attachthe PDF Action Attach the invoicePDF

Download the file, then in FlowRunner click + beside Flows, pick it under Import a Flow Version and click Create. How importing works

What each step does

  1. New carrier invoice email Checks the AP inbox in Gmail every 5 minutes for an email with an attachment and invoice in the subject.
  2. Read the carrier invoice An AI agent reads the saved PDF and pulls out the carrier, invoice number, load number, PRO, dates, total and every charge on it.
  3. Find the load in McLeod Looks the load up by load number, or by PRO when the invoice has no load number. When nothing matches, the invoice goes to AP in Slack and nothing is entered.
  4. Find the carrier in Xero Finds the Xero contact whose name is exactly the carrier name McLeod has on the load. A carrier Xero doesn't know goes to AP in Slack.
  5. Compare with the agreed carrier pay When Xero already has a bill from this carrier with the same invoice number, the resent invoice is skipped and AP is told. Otherwise it checks the carrier, the total to the cent, and each accessorial against the carrier's extra pay in McLeod.
  6. Create the bill A match becomes a Xero bill awaiting payment, with the carrier's invoice number, the McLeod load number as the reference, one line per charge, and the carrier's PDF attached. If the PDF can't be attached, AP is asked in Slack to attach it.
  7. Ask the AP lead A variance goes to the AP lead in Slack with both totals, what differs, a link to the invoice, and two buttons, Book it and Hold it.
  8. Wait for the AP lead's answer The run waits for the click. Book it enters the bill as the carrier billed it. Hold it keeps the invoice out of Xero and says so in the Slack thread.

Before you turn it on

  • Connect your Gmail, Xero and Slack accounts, and enter your McLeod server URL and API token.
  • Add your Anthropic key in the flow setting Anthropic key. Set Carrier pay account code to the Xero account your carrier bills are booked to, and Carrier payment terms (days) to the terms used when an invoice shows no due date.
  • Copy the URL of the block Wait for the AP lead's answer into the flow setting Answer link. The Slack buttons open it.
  • Pick your Slack channel in the six Slack steps, and narrow the Gmail search to your AP inbox if it shares a mailbox. Carriers are found by their exact name, so keep each carrier's Xero contact name the same as in McLeod.