Webinar: Automating Your Simpro AP with EzzyBills – Recording

Skip to main content

EzzyBills User Guide

📘 Guide: Implementing a Per-Line Approval Workflow Based on Supplier and Tracking Categories

Overview

This guide demonstrates how to configure a per-line approval workflow using AI Tasks based on specific business conditions. The use case involves dynamic approver assignment based on:

  1. Supplier (regardless of tracking category)
  2. Supplier + Tracking category combination
  3. Tracking category (regardless of supplier)

To achieve this, you’ll create two workflows:

  • A Main Workflow for invoice processing and per-line approval logic
  • An Approval Workflow where the designated approvers will review and approve assigned lines

🧠 Use Case Scenario

The client’s requirement is to automatically route invoice lines to the correct approvers based on:

  • The supplier (in isolation)
  • A specific combination of supplier and tracking category
  • The tracking category alone

🔧 Step-by-Step Setup

Step 1: Create the Custom AI Task

This AI Task will determine the correct approver per line based on rules from a CSV file.

  • Prompt logic: The AI Task must parse a CSV that lists approvers for specific suppliers, tracking categories, or combinations of both.
  • Details to include in your prompt:
    • How to parse the CSV structure
    • Fallback rules if both supplier and tracking don’t match
    • Clear logic path to determine precedence

Important: After creating the AI Task, configure it to reference the approver list CSV using the following JSON input (replace 37226497 with your actual document ID):

{
"state": 104922,
"keywords": [
{
"name": "approval_document",
"value": "37226497"
}
]
}

Step 2: Configure the Main Workflow

Structure the main workflow as follows:

Start ➝ Pre-Extract ➝ Extract ➝ Submit Approval ➝ Approved ➝ [Custom AI Task: Line Item Approval Setter] ➝ Switch ➝ Approve Each Line of the Invoice v2 ➝ Xero Export ➝ Finish

  • This is based on the standard per-line approval structure (see the main guide: Setting Up Per-Line Approval Workflow Using AI Tasks). Link: https://www.ezzybills.com/user-guide/line-approval-workflow-using-ai-tasks/
  • The only changes are:
    • A custom AI Task that sets approvers based on the CSV.
    • Replacing the basic per-line approval with “Approve Each Line of the Invoice v2”, which includes enhanced approval tracking.

Step 3: Build the Approval Workflow

This workflow defines how approvers review and act on their assigned lines.

Structure:

Start ➝ Submit Approval ➝ Approved ➝ Approve My Approval Lines ➝ Switch Workflow ➝ Finish

  • The Submit Approval task must include the approver’s email address.
  • The Switch Workflow task at the end must point back to the main workflow, using the following JSON setting:
{
"state": 390,
"keywords": [
{
"name": "changeWorkflow",
"value": "main_workflow"
}
]
}

🔄 Updating the Approver List

To update the CSV of approvers:

  1. Go to Advanced Upload ➝ Select Document Type: Blob Update
  2. Upload the new CSV file.
  3. Duplicate the existing approval workflow and rename it appropriately (e.g., James Bond).
  4. In the duplicated workflow:
    • Update the Submit Approval task with the correct approver’s email.
    • Rename the workflow if needed to reflect the new approver.

✅ Final Notes

This configuration enables dynamic, per-line approvals based on flexible and evolving business rules. By offloading the decision logic to an AI Task that references an external CSV, you gain a maintainable and scalable way to control approval flows.

Sections of Article