Digest Step Output

Regular Digest

amount
number
required

This combined with the unit field determines the amount of time to digest events for.

unit
Enum: 'seconds', 'minutes', 'hours', 'days', 'weeks', 'months'
required

The measurement unit for the amount field.

digestKey
string

This key is used to group events for the digest engine, if not provided all events will be digested together on the subscriber level. When provided, events will be grouped by the subscriberId and the digestKey.

The digest key must match the payloadSchema key provided on the workflow.

lookbackWindow
LookBackWindow

An example of a parameter field

Scheduled Digest

cron
string
required

The cron expression to schedule the digest on a repeating basis.

@novu/framework SDK exports a utility enum called CronExpression to help you build cron expressions.

import { CronExpression } from '@novu/framework';

await step.digest('digest', async (controls) => {
    return {
        cron: CronExpression.EVERY_DAY_AT_1AM
    }
});
digestKey
string

This key is used to group events for the digest engine, if not provided all events will be digested together on the subscriber level. When provided, events will be grouped by the subscriberId and the digestKey.

Digest Step Result

events
array

An array of triggers that have been digested.