Accumulator processor - field reference
This topic describes the configuration fields of the Accumulator processor, available options, and how the release triggers behave.
General configuration
|
Field |
Description |
|---|---|
|
Name |
A user‑friendly name for the processor instance. Use a name that clearly indicates what is being accumulated (for example, "Hourly usage per account"). |
|
Operator ID |
An auto‑generated unique identifier for this processor. |
|
Partition By (Group By fields) |
Fields that define the grouping key for accumulation. Each unique combination of these fields creates a separate state bucket. Examples:
Choose grouping keys that reflect how you want to track counters or totals. High‑cardinality keys create many buckets and increase memory usage. |
Release trigger configuration
|
Timeout Type |
Controls which notion of time is used to decide when to emit accumulated results:
|
|
Timeout Duration |
Defines how long each accumulation period lasts before a release is eligible. Supported units typically include:
Duration is based on calendar time, not on "first event plus duration". For example:
|
|
Event Time Field and Time Format |
Only used when Timeout Type is Event Time Based.
|
Processing‑time triggers:
- Periods are defined purely by clock time on the Mediation platform.
- All events ingested during a given time interval (for example, 09:00–09:15) contribute to the state for that period.
- At the end of the interval (for example, 09:15), the Accumulator emits the accumulated values for each partition.
- Events that arrive after the boundary contribute to the next interval, even if their event timestamps indicate an earlier time.
Event‑time triggers:
- Periods are based on the timestamp within the event (for example, usageDate), not on arrival time.
- Events whose event times fall in the same period (for example, 10:00–11:00) contribute to the same window, regardless of when they arrive.
- Once a period is considered closed and emitted, late events with timestamps in that period are not retroactively added; they typically fall into a currently open window or must be handled by downstream correction logic.
- To avoid racing with very late events, the system may wait a short buffer (for example, a few minutes) after the nominal boundary before closing a window and emitting results.
Accumulate fields configuration
Defines which fields are accumulated and which operations are applied. For each field you can configure:
|
Field |
Description |
|---|---|
|
Source Field |
The numeric or comparable field from incoming events to track (for example, quantity, amount, duration). |
|
Operator |
The type of accumulation operation, such as:
|
|
Result Field |
The field name where the Accumulator stores the accumulated value. You can:
|
-
For each partition and period, the Accumulator typically outputs a single summary record containing the accumulated fields.
-
The original individual events are not all forwarded by this processor; instead, you receive one result row per partition per release.
-
When you use a new result field name, source fields may be dropped from the output if that is how the meter is configured.
Advanced accumulation configuration
Use this mode when built‑in field operations are not sufficient.
|
Field |
Description |
|---|---|
|
Language |
Choose JavaScript or Python for the custom logic. |
|
Script |
You provide a function that receives incoming events and current state, and returns an array of output events. For example:
|
-
Returning an empty array means "no output for this event."
-
The script is responsible for shaping the output schema; only include fields needed downstream.
-
Complex logic and large volumes can be resource‑intensive. If you expect very high event volumes with advanced accumulation, coordinate with Zuora Global Support.
Examples
Configuration:
-
Partition By: accountId
-
Timeout Type: Event Time Based
-
Timeout Duration: 1 hour
-
Event Time Field: usageDate
Incoming events (for example account A):
-
10:05 with quantity 3
-
10:42 with quantity 2
-
11:10 with quantity 5
Processing:
-
Window 10:00–11:00 (event time) accumulates events #1 and #2 → running total = 5.
-
At 11:00 event time, the node releases the current state for account A (total 5).
-
Event #3 has event time 11:10, so it belongs to the 11:00–12:00 window. That window will be released at 12:00 event time.
-
If an event for 10:15 arrives late (after 11:00 event time release), it is not included in the already released 10:00–11:00 output. It will accumulate in the current open window. If you need corrections, handle them downstream.
Configuration:
-
Partition By: subscriptionId
-
Timeout Type: Processing Time Based
-
Timeout Duration: 15 minutes
Incoming events (for example subscription S):
-
09:01 ingested → qty 4
-
09:05 ingested → qty 1
-
09:16 ingested → qty 2
Processing:
-
From 09:00 to 09:15 (processing time), the running total becomes 5.
-
At 09:15, the node releases the total = 5.
-
Event at 09:16 starts the next processing window; it will be included in the 09:15–09:30 output.
-
Out‑of‑order event times don't affect window boundaries under Processing Time; the release schedule follows the clock.
Example 3: Track running usage per account and emit hourly results by event time
Configuration:
-
Partition By: accountId
-
Accumulation: SUM quantity → totalQuantity
Release Trigger: Event Time Based
-
Duration: 1 hour
Event Time Field: usageDate
Incoming events (for example account Z):
-
13:04 (usageDate), qty 2
-
13:40, qty 5
-
14:05, qty 3
Processing:
-
13:00–14:00 window total grows to 7 (2 + 5).
-
At 14:00 (event time) → emit: { accountId: Z, totalQuantity: 7 }.
-
14:05 goes into the 14:00–15:00 window. At 15:00 event time, emit whatever the 14:00–15:00 total is.
-
The release aligns with the business time on events, which is ideal for billing cycles and audits.