> For the complete documentation index, see [llms.txt](https://kb.theloops.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.theloops.io/digitalworkers/ifs-loops-digital-workers/digital-worker-guides/service-closure-manager/core-concepts/fundamentals.md).

# Fundamentals

## Overview&#x20;

The Service Closure Manager is an AI-powered Digital Worker that validates completed service work before it progresses to invoicing in IFS Cloud. It reviews the materials, returns, and time reported against a service request task, determines whether that work is ready for invoicing, and supports scope-level invoice preview creation and approval, all while keeping a person in control of the outcome.&#x20;

The worker processes individual service request tasks, running every applicable validation check before determining invoice readiness. At the request scope level, it validates every task within the scope and only creates an invoice preview once every task in that scope has passed the required checks. Validation outcomes, exceptions, invoice previews, and approval decisions are all routed through a configured communication channel for human review.&#x20;

## Key Benefits&#x20;

**Nothing reaches invoicing unchecked:** Every request task is validated against material, return, and time reporting checks before it can progress toward an invoice.&#x20;

**Consolidated readiness, not a single pass/fail:** Material, return, material usage, and time reporting results are consolidated into one invoice readiness assessment per task, and a successful result on one check never overrides a failure on another.&#x20;

**Nothing invoices with an unresolved task in the scope:** A scope-level invoice preview is only created once every request task within that scope has passed the required validations. One failing task holds the whole scope.&#x20;

**A person always approves the invoice:** The worker creates the invoice preview; explicit user approval is required before the service invoice progresses.&#x20;

**The underlying record is never altered automatically:** Validation failures do not modify or override the reported service information. The person responsible corrects the record where they normally would, in IFS.&#x20;

## The Challenge It Solves&#x20;

Completed service work commonly reaches invoicing without a consistent check on whether it was reported correctly. Materials used, returns expected, and time reported against a job can go unverified against what was actually planned, and inconsistencies are often only caught after an invoice has already gone out or been disputed.&#x20;

Checking this by hand, one task at a time, doesn’t scale with volume, and a request scope with even one incomplete or inconsistent task can still progress toward invoicing if nobody catches it. The result is unbilled work, inconsistent records, and invoice disputes that trace back to a task record that never should have been considered ready.&#x20;

## Before and After&#x20;

### Before&#x20;

Before the Service Closure Manager, validating a completed service request scope requires manual effort at every stage:&#x20;

{% stepper %}
{% step %}
Review each completed request task by hand, checking the description, performed work, actions, remarks, and service notes
{% endstep %}

{% step %}
Manually compare reported materials and returns against what was planned for the job
{% endstep %}

{% step %}
Manually compare reported personnel time against planned hours and the cost lines they generated
{% endstep %}

{% step %}
Judge, task by task, whether the work is ready to invoice
{% endstep %}

{% step %}
Check every task in the request scope before creating an invoice preview, since one incomplete task can otherwise slip through
{% endstep %}

{% step %}
Review and approve the invoice manually, with no consolidated record of what was checked
{% endstep %}
{% endstepper %}

### After&#x20;

With the Service Closure Manager, the same process runs automatically:&#x20;

{% stepper %}
{% step %}
A completed request task is retrieved along with its description, performed work, actions, remarks, and service notes
{% endstep %}

{% step %}
Material and return validation compares reported usage, quantities, and related cost lines against the completed work
{% endstep %}

{% step %}
Time reporting validation compares reported personnel hours against planned hours and the cost lines they generated
{% endstep %}

{% step %}
Material, return, and time reporting results are consolidated into an invoice readiness assessment for the task
{% endstep %}

{% step %}
Every task in the request scope is validated before an invoice preview is created; one failing task holds the whole scope
{% endstep %}

{% step %}
Once every task in scope passes, an invoice preview is created and a person reviews and explicitly approves it&#x20;
{% endstep %}
{% endstepper %}

## How It Works&#x20;

The Service Closure Manager follows a consistent sequence for every request task and the scope it belongs to.&#x20;

**Service Task Validation:** A completed request task is retrieved, along with its description, performed work, actions, remarks, and service notes. The worker assesses the task context to determine whether materials and returns are expected, then runs every applicable validation check before determining invoice readiness.&#x20;

**Material & Return Validation:** Planned and reported materials are compared against the completed service work. Material quantities and related cost lines are validated, and return records are checked where a return is expected. Missing or inconsistent material or return information is identified.&#x20;

**Time Reporting Validation:** Planned and reported personnel hours are compared, and reported time is validated against the cost lines it generated. Variances and mismatches are identified, and invoice readiness is prevented where time reporting does not meet the required validation criteria.&#x20;

**Invoice Readiness Validation:** Material, return, material usage, and time reporting results are consolidated into a final readiness assessment for the task. All applicable checks are processed even where an earlier check has already failed, and a task cannot progress to invoicing unless it passes every required validation.&#x20;

**Scope-Level Invoice Validation:** Every request task associated with the scope is retrieved and validated. An invoice preview is only created once every task in the scope has passed its required validations.&#x20;

**Invoice Preview & Approval:** An invoice preview is created at the request scope level for a successfully validated scope. The service invoice does not progress until a person explicitly approves it.&#x20;

**Exception & Human-in-the-Loop Review:** Validation failures are presented with the underlying reason through the configured communication channel, for a person to review and act on. Invoice approval always requires explicit user confirmation.&#x20;

## What Triggers the Service Closure Manager&#x20;

**A completed request task:** The worker processes individual service request tasks as they are completed, retrieving their details and running the applicable validation checks.&#x20;

**A request scope ready for invoice review:** Once every task in a scope has been validated, the scope is checked to determine whether an invoice preview can be created.&#x20;

**A failed validation:** Missing or inconsistent material, return, or time reporting information prevents a task from being considered ready for invoicing, and routes the outcome to a person for review.&#x20;

**An invoice preview awaiting approval:** Once a scope-level invoice preview has been created, it holds until a person gives explicit approval before the service invoice progresses.&#x20;
