> 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/architecture-and-capabilities.md).

# Architecture & capabilities

## Overview&#x20;

The Service Closure Manager is built on five capabilities that together take a completed service request task from initial review through to an approved invoice: Service Task Validation, Material & Return Validation, Time Reporting Validation, Invoice Readiness & Scope-Level Validation, and Invoice Preview & Approval. This article covers those capabilities, the validation workflow they share, integration points, and how the system keeps a person in control of every invoice approval decision.&#x20;

## Agentic Skills&#x20;

#### Service Task Validation&#x20;

Reviews a completed request task and coordinates the required validation checks before the work can progress to invoicing. Retrieves the task’s description, performed work, actions, remarks, and service notes, and assesses the task context to determine whether materials and returns are expected. Every applicable check is executed before invoice readiness is determined, and detailed validation results are produced for each task processed.&#x20;

#### Material & Return Validation&#x20;

Validates planned and reported material usage against the completed service work, comparing quantities and related cost lines. Return records are validated where a return is expected based on the task context. Missing or inconsistent material or return information is identified, and material and return expectations are evaluated using the available task descriptions, performed work, remarks, service notes, and related transaction data.&#x20;

#### Time Reporting Validation&#x20;

Compares planned and reported personnel time and validates the corresponding cost lines, identifying missing or inconsistent time reporting. Time variances and mismatches are surfaced directly, and invoice readiness is prevented where time reporting does not meet the required validation criteria.&#x20;

#### Invoice Readiness & Scope-Level Validation&#x20;

Consolidates material, return, material usage, and time reporting results into a final readiness assessment for each task. All required validation checks are processed even where an earlier check has already failed, since a successful result from one validation never overrides a failure from another. At the request scope level, every associated task is retrieved and validated, and invoice progression is prevented whenever one or more tasks in the scope do not meet the required criteria.&#x20;

#### Invoice Preview & Approval&#x20;

Creates an invoice preview for a request scope once every task within it has passed validation, at the scope level rather than the individual task level. The service invoice does not progress until a person gives explicit approval following their review.&#x20;

### Validation Workflow&#x20;

The following table outlines the process from a completed task through to an approved invoice.&#x20;

| Stage                        | What the System Does                                                                           | Action / Output                                                | Channel               |
| ---------------------------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | --------------------- |
| Task Retrieved               | Retrieves the completed task’s description, performed work, actions, remarks and service notes | Task context assessed for material and return expectations     | IFS Cloud             |
| Material & Return Checked    | Compares reported material usage and returns against the completed work                        | Missing or inconsistent material/return information identified | IFS Cloud             |
| Time Reporting Checked       | Compares reported personnel hours against planned hours and cost lines                         | Time variances and mismatches identified                       | IFS Cloud             |
| Invoice Readiness Determined | Consolidates material, return and time reporting results                                       | Task marked ready or not ready for invoicing                   | IFS Cloud             |
| Scope Validated              | Validates every task associated with the request scope                                         | Invoice preview creation allowed only if every task passed     | IFS Cloud             |
| Invoice Preview Created      | Creates a scope-level invoice preview for a fully validated scope                              | Preview presented for review                                   | Communication Channel |
| Approved                     | A person reviews and explicitly approves the preview                                           | Service invoice progresses                                     | IFS Cloud             |

**Exception path:** When a task fails one or more required validations, the failure is presented with its underlying reason through the configured communication channel. The worker does not modify or override the reported service information; the person responsible corrects the record in IFS, and the task is validated again.&#x20;

## Integration Points&#x20;

**IFS Cloud:** The system of record for service requests, request tasks, cost and sales lines, and service invoicing. The Service Closure Manager reads task descriptions, performed work, remarks, service notes, planned and reported material and time data, and cost and sales lines, and supports invoice preview creation and approval within IFS Cloud’s invoicing process.&#x20;

**Configured communication channel:** Used for human-in-the-loop interactions: validation outcomes, exceptions, invoice previews, and approval actions are all routed through it for review.&#x20;

## Human-in-the-Loop Design&#x20;

The Service Closure Manager is designed so that validation runs automatically across every task and scope, while the decisions that matter, correcting a failed record and approving an invoice, stay with a person.&#x20;

The system flags for review when:&#x20;

* A task fails material, return, or time reporting validation, with the underlying reason shown&#x20;
* One or more tasks in a request scope fail to meet the required validation criteria, holding invoice preview creation for the whole scope&#x20;

A person acts when:&#x20;

* A validation failure needs the underlying service record corrected in IFS, since the worker never modifies or overrides reported information automatically&#x20;
* An invoice preview has been created and is awaiting review, since the service invoice cannot progress without explicit user approval&#x20;

## Feedback and Continuous Improvement&#x20;

Validation checks are deterministic: the same data produces the same result every time a task is evaluated, so a corrected record produces a consistent, repeatable outcome once it is re-checked. Because the worker never modifies the underlying reported service information itself, the person responsible for the record makes the correction exactly where they normally would in IFS, and the task is evaluated again against the same checks. This keeps the validation logic consistent and predictable across every task and every request scope.
