Skip to main content

Building Aggregations

A guide to Alloy's Aggregations feature: what it is, how it works, and how to build rules with it.

Overview

Aggregations let you make decisions based on patterns across data over time — not just the single application or event in front of you. Instead of asking "is this transaction over $10,000?", Aggregations let you ask questions like "how many ACH transactions has this entity made in the last 7 days?" or "how many distinct IP addresses has this person logged in from this month?"

You configure Aggregations directly in the Workflow Editor, alongside your other rules — no engineering ticket or custom metric request required. Once configured, an aggregation produces a number (a count, a sum, an average, etc.) that you can compare against a threshold and use to drive your workflow decision in real time.

Aggregations are Alloy's modern, self-serve replacement for velocity-style rules. They give you the flexibility to build your own velocity and behavioral checks over any supported data object, using both Alloy's standard fields and your own custom attributes.

Why use Aggregations

Aggregations are designed for any decision that depends on history or volume rather than a single data point:

  • Velocity rules — "Count of ACH transactions in the last 7 days > 5" without filing a request for a new metric.

  • Account-takeover and login-anomaly detection — "Count of logins for this entity in the last 24 hours > 10", or "distinct count of IP addresses per entity in the last 30 days."

  • Custom KPI and threshold monitoring — track a bespoke business metric (e.g. total deposit amount in the last 30 days) as a workflow input.

  • Behavioral risk signals — spot structuring, sudden spikes in activity, or unusual patterns across an entity's history.

  • Self-serve ownership — build and tune the logic yourself in the Workflow Editor, and change it whenever your risk posture changes.

Key concepts

An aggregation is built from a small number of pieces.

1. Data object

The data object is what you are counting or measuring over. Each object corresponds to a kind of record Alloy stores for you:

Object

What it represents

Availability

Entity

A person or business you evaluate

Generally available

Transaction

A financial transaction record

Generally available

Login

A login / authentication event

Generally available

Account

An account record

In progress

Device

A device record

In progress

When you build an aggregation, you first choose the object you want to aggregate over.

2. Attribute

The attribute is the specific field you're measuring or filtering on. Aggregations support:

  • Standard attributes — fields that are part of Alloy's built-in schema for each object (for example, a transaction's amount or state, or a login's IP address, device alias, or status).

  • Custom attributes (Published Attributes) — fields you define and populate yourself, so you can aggregate over data that is specific to your business.

3. Aggregation function

The function is the calculation you want to run. Aggregations currently support:

Function

What it returns

Count

How many matching records there are

Count Distinct

How many unique values there are (e.g. distinct IP addresses)

Sum

The total of a numeric field

Average

The average of a numeric field

Min

The smallest value

Max

The largest value

An aggregation always produces exactly one function result, which you then compare against a threshold in your rule.

4. Filters

Filters narrow down which records are included in the calculation. Each filter becomes a condition — for example, "only ACH transactions", "only failed logins", or "only where the published attribute income is greater than 0." You can add as many filters as you need; they combine to define the exact population you're aggregating over.

Filters support the common comparison operators — equals, does-not-equal, greater/less-than (and their or-equal variants), IN (matches any value in a list), and BETWEEN (a range). A filter's value can be:

  • Static — a fixed value you type into the rule (e.g. transaction_type = ACH).

  • Dynamic — pulled from the application being evaluated right now. This is how you write "…where the email matches this applicant's email" or "…where the device matches this login's device." Dynamic filters are what make an aggregation about the person in front of you rather than everyone. If a required dynamic value is missing from the incoming data, Alloy skips that aggregation rather than running it with an unintended scope.

Two especially common controls are really just convenient, purpose-built filters:

  • Scope controls whose data is included — for example, the current entity, or a group of related entities.

  • Timeframe (lookback window) controls the time range — for example, the last 7 days, last 30 days, or last 90 days.

The mental model: an aggregation is one function applied to a population defined by N filters (with Scope and Timeframe being two especially useful filters).

5. Threshold / rule

The single number your aggregation produces becomes an input to a rule. You compare it against a threshold (>, <, =, etc.) just like any other value in your workflow, and the result contributes to your decision (approve, deny, review, and so on).

How it works

At evaluation time, Alloy runs your aggregation against the relevant history and returns the result to your workflow, where it's compared against your threshold. A few important properties:

  • Real-time. Aggregations run as part of the evaluation, so decisions reflect the latest data.

  • Includes the current evaluation. The record you're evaluating right now is included in the calculation alongside historical data. If someone is making their 6th transaction today, that 6th transaction counts toward the total — you don't have to wait for it to be "written down" first.

  • Powered by a purpose-built analytics store. Aggregations are backed by an analytics database designed for fast counting and summing across large volumes of history, so the vast majority of aggregation queries are fast and inexpensive to run.

  • Historical depth. Aggregations evaluate against your stored history, currently up to a lookback window of one year (see Limits below).

Example rules

Here are representative rules you can build today:

Entity

  • Average risk score across entities in a group over the last 30 days is above a threshold.

  • Count of distinct entities that have a given attribute set in the last 90 days.

Transaction

  • Count of ACH transactions for this entity in the last 7 days > 5.

  • Sum of transaction amounts for this entity in the last 30 days > a limit.

Login

  • Count of logins for this entity in the last 7 days > 3.

  • Count of logins from this device in the last 24 hours > 10.

  • Distinct count of IP addresses used by this entity in the last 30 days.

  • Count of failed logins over a time period (filter on login status).

Behaviors worth understanding

Aggregations are powerful, and a few behaviors are worth knowing so your rules do exactly what you intend.

"Latest value" semantics for entity attributes

Some attributes describe a state that is true over a period of time rather than a distinct event. Consider an entity's reported income or a risk score: the same value may be recorded multiple times without actually changing.

To avoid over-counting, aggregations over these entity attributes use the most recent value per entity. For example, if you take the average risk score across a group of entities, Alloy uses each entity's latest risk score and then averages across entities — so an entity that happened to have its score recorded many times doesn't skew the result.

This differs from transactions, where each transaction is a distinct event and is counted on its own. Summing transaction amounts across an entity sums across all the entity's transactions, as you'd expect.

If you're ever unsure how a specific aggregation will behave for your data, your Alloy team can help you validate it before you rely on it in production.

Transaction amounts are in cents

In the Workflow Editor, transaction amounts for Aggregations are represented in cents. A $10.00 transaction is 1000. Keep this in mind when setting thresholds on transaction amount sums or averages.

Deduplication

Aggregations are designed to count meaningful occurrences, not incidental duplicate records. For state-like attributes, values are de-duplicated per entity as described above so repeated identical readings don't inflate a sum or count.

Limits and current scope

Aggregations are actively evolving. As of now:

  • Objects: Entity and Transaction are generally available; Login is newly available and rolling out. Account and Device are on the roadmap.

  • Lookback window: up to one year (365 days). Longer windows are not currently offered in the standard configuration.

  • Data must exist to be decisioned: Aggregations can only measure data Alloy stores for you. If a particular data point isn't captured, or isn't captured in the shape your use case needs, it can't be aggregated until that data is modeled — talk to your Alloy team about new use cases.

  • Parity with legacy velocity rules: a few capabilities are still reaching full parity — see Migrating from velocity rules and identity-element checks below.

  • Entity Group Aggregations: Aggregations for all entities belonging to a group can only be reliably used in Group Workflows and Reconciliation Workflows.

Migrating from velocity rules and identity-element checks

If you've used Alloy for a while, Aggregations are the successor to earlier velocity-style capabilities — previously configured as Multi-Level Aggregations (MLAs) and identity-element velocity checks. Aggregations cover the same use cases with a more flexible, self-serve model, and are the recommended path going forward.

What's better

  • Self-serve. You configure new aggregations yourself in the Workflow Editor. Previously, adding a new velocity metric or decisioning on a new kind of data typically required an Alloy engineering change; now it's a configuration you own.

  • Broader coverage. Aggregations work across multiple data objects (Entity, Transaction, Login, with more coming) and over both Alloy's standard fields and your own custom attributes.

  • Simpler, more consistent model. Every aggregation is one function plus a set of filters. There are fewer special cases than the older rules, so behavior is easier to reason about — though it also means an older rule won't always map one-to-one onto a single new aggregation.

  • Flexible time windows and scope. Lookback windows and scope are ordinary filters, so you can express a wide range of velocity and behavioral checks without bespoke logic.

How familiar concepts translate

If you're used to…

In Aggregations you…

A named velocity metric (e.g. "ACH count 7d")

Build it directly: choose the object, a Count function, and a Timeframe filter of the last 7 days.

Selecting which PII element a check keys on (identity-element checks)

Use filters to define the population. Filters are to Aggregations what element selection was to identity-element checks.

Stacking multiple identifiers in one check (e.g. SSN and DOB)

Express each condition as a filter within a single aggregation.

Reviewing why a velocity rule fired

Use Rule Explainability, which shows how the aggregation contributed to the decision, presented consistently with the existing velocity-rule experience.

Parity notes and current gaps

A few capabilities from the older rules are still being brought to full parity. Worth knowing before you migrate a rule:

  • One identifier per aggregation. An aggregation is keyed on a single identifier for its object (for example, the entity). Where an identity-element check let you stack several independent identifiers, you achieve the equivalent with filters rather than multiple keys.

  • Entity "workflow scope." A dedicated per-workflow scope that exists for some legacy entity checks isn't offered in entity Aggregations today.

  • Portfolio Evaluations. Aggregations aren't yet available inside Portfolio Evaluations, so rules that must run there may still rely on the older mechanism for now.

  • Evidence drill-down. Rule Explainability is designed to match the legacy velocity-rule experience, and evidence (the row-level "why") continues to improve. If evidence fidelity is critical for a specific rule, confirm the current behavior with your Alloy team.

If you're planning to move a set of existing velocity or identity-element rules over, your Alloy team can review them with you to flag any of the above before you switch.

Getting started

Aggregations appear as a service in the Workflow Editor once enabled for your account. To build your first rule:

  1. Add the Aggregations service to your workflow.

  2. Choose the data object you want to aggregate over (Entity, Transaction, or Login).

  3. Pick an aggregation function and the attribute it applies to.

  4. Add filters, including Scope (whose data) and Timeframe (how far back).

  5. Use the result as an input to a threshold in your rule.

  6. Test the workflow with sample evaluations to confirm the behavior matches your intent.

If you'd like Aggregations enabled for your account, or want help designing a specific rule, reach out to your Alloy contact.

Did this answer your question?