Invoice anomaly check
ivy.agent.invoice-anomaly-check · v0.1.0
ivyx
Holds a list of invoices against each client's usual and names the ones far above it, before they go out. The gap IVYX Agency's "Invoice anomaly checker" change fills with Flows when no tool of the agency covers it: Agency posts the invoices (and the usual per client, when it knows one) to this flow's webhook, and the result goes back through the agency's intake as kind invoice-anomalies, where each one is an Approve output decision. No model, no side effect: a median and a percentage.
Steps
In the order the agent's file lists them, each with where its inputs come from and the values the file fixes. A branch or a loop is a step too.
- 01Ivy NodeHold each invoice against its client's usualivy.node.invoice-anomaly
Holds every invoice in a list against its client's usual (the median of the client's other invoices in the list, or the usual the caller gives per client) and names the ones above a threshold, with how far above.
- takes
invoicesfrom the agent's inputusualfrom the agent's inputthreshold_pctfrom the agent's input- set
threshold_pct30- returns
kind,checked,anomalies
Nodes it brings
Adding this agent in IVYX Studio adds these nodes with it. A node your workspace already has is kept as it is, even at another version.
What it touches
Collected from what each of its nodes declares, plus the model call when a step is a model turn. A declaration is the author's statement, and it is what policy rules select on.
Its nodes declare no side effects.
Inputs
| Field | Type | Description |
|---|---|---|
| invoicesrequired | array | The invoices to check: client, number, date, amount. |
| usual | object | The usual amount per client, when known. |
| threshold_pct | number | How far above the usual counts; 30 when not given. |
| change | object | The IVYX Agency change this run carries out (id, title), echoed for the record. |
Outputs
| Field | Type | Description |
|---|---|---|
| kindrequired | string | invoice-anomalies: what this output is, for a receiver that takes several kinds. |
| checkedrequired | integer | How many invoices had a usual to be held against. |
| anomaliesrequired | array | The invoices above the threshold, each with client, invoice, date, amount, usual, above_pct and a sentence. |
Tests
2 of 2 test cases passed on Oct 25, 2026, in the publisher's own environment, before this version was published. The registry keeps that record; it does not run the cases again.
Requires: python:3.9
- one-above
Three invoices of one client, one far above the other two, name that one with how far above.
- given
invoices[{"client":"Acme","number":"A1","amount":6500},{"client":"Acme","number":"A2","amount":6400},{"client":"Acme","number...- expects
kindequals invoice-anomaliescheckedequals 3anomalies.0.invoiceequals A3anomalies.0.above_pctequals 185
- nothing-unusual
Invoices near their client's usual name nothing.
- given
invoices[{"client":"Bluefin","number":"B1","amount":1050}]usual{"Bluefin":1000}- expects
kindequals invoice-anomaliescheckedequals 1anomaliesequals []