notifly
Use casesWorkflow stepUpdated

Digest notifications: one message for a burst of events.

Ten comments in ten minutes should not mean ten emails. A digest step in a Notifly workflow collects the events a subscriber receives over a window and sends one message about all of them.

This page covers how the step decides what to hold and when to send, the three kinds of window the workflow editor offers, and a complete example: the workflow, the trigger your backend sends, and the email the subscriber gets.

What a digest step does

A digest step sits in a workflow between the trigger and the channel steps. The first event for a subscriber opens a digest. Events that arrive for the same subscriber, in the same workflow, while it is open join it instead of running the rest of the workflow themselves. When the window ends, the steps after the digest run once, with every collected event available to their templates.

  • steps.<step id>.events: the collected events, oldest first. Each has an id, a time and the payload its trigger sent.
  • steps.<step id>.eventCount: how many events the digest holds.
  • The toSentence and pluralize Liquid filters turn those into copy. The editor's variable picker offers them as sentenceSummary and countSummary.

Every step after the digest sees the same events: an email, an in-app message, an SMS, a push or a chat message can each summarise the batch in its own words.

Regular, look-back and scheduled windows

In the workflow editor, a digest step's Digest window has two tabs, Regular and Scheduled. A look-back digest is a Regular digest with its Start digest option changed.

RegularDigest events for an amount of seconds, minutes, hours, days, weeks or months, with Start digest left on Immediately.When that time has passed since the event that opened the digest.
Look-backA Regular digest with Start digest set to When events repeat within 5 minutes, 30 minutes or a custom time.Straight away, on its own, unless an earlier event for the same subscriber and group arrived within that time and has already gone out. Then the event opens a digest, or joins the one already open, sent when the Digest events for time has passed since it opened.
ScheduledEvery minute, hour, day, week or month, at a chosen hour and minute, on chosen days for weekly and monthly schedules.At the next scheduled time, evaluated in the subscriber's timezone: the timezone on their subscriber profile, which a trigger can set in to.

An earlier event has gone out once it was sent on its own, or once the digest it opened was sent. Events still waiting in an open digest don't count, and neither do events that joined one.

Look-back suits alerts where the first one matters: a quiet user gets the first comment immediately, and only a burst is batched. Scheduled suits a daily or weekly summary that should arrive at the same local time for everyone.

Group events by a key

Events are always digested per subscriber. Group events by adds one payload variable to that key, stored as {{payload.<name>}}, so one subscriber gets a separate digest per post, project or ticket instead of one digest for everything.

The example below groups by {{payload.postId}}: comments on two different posts produce two emails, each about its own post.

A worked example: comment notifications

The workflow comment-activity has two steps: a digest step with the step id digest-step, a Regular window of 30 minutes grouped by {{payload.postId}}, then an email step. Your backend triggers the workflow once per comment:

Node.js · @notiflyio/api@0.1.26
// npm install @notiflyio/api@0.1.26
import { Notifly } from "@notiflyio/api";

const notifly = new Notifly({ security: { secretKey: process.env.NOTIFLY_SECRET_KEY } });

// One trigger per comment. The digest step decides what the post's owner receives.
await notifly.trigger({
  workflowId: "comment-activity",
  to: { subscriberId: "user_123", email: "owner@example.com" },
  payload: { postId: "post_42", authorName: "Ada" },
});

The email step's subject and body read the digest's outputs through the two filters:

Email step · Liquid
Subject: {{steps.digest-step.events | toSentence: 'payload.authorName', 2, 'other'}} commented on your post

You have {{steps.digest-step.eventCount | pluralize: 'new comment', 'new comments'}}.

Ada, Grace and Linus comment on the same post at 09:00, 09:10 and 09:20. With the Regular 30-minute window, Ada's comment opens the digest and the other two join it. The post's owner receives one email:

  • 09:30: subject "Ada, Grace, and 1 other commented on your post", body "You have 3 new comments."

Switch Start digest to When events repeat within 30 minutes and the same three comments arrive differently. Ada's comment has no earlier one, so it is sent at once. Grace's arrives within 30 minutes of Ada's, which has gone out, so it opens a digest. Linus's comes 20 minutes after Ada's and joins that digest, sent 30 minutes after Grace's:

  • 09:00: subject "Ada commented on your post", body "You have 1 new comment."
  • 09:40: subject "Grace and Linus commented on your post", body "You have 2 new comments."

Timing matters. Had Linus commented at 09:35 instead, Ada's comment would be more than 30 minutes old and Grace's still waiting in its digest, so neither would count, and Linus's comment would go out on its own:

  • 09:00: subject "Ada commented on your post", body "You have 1 new comment."
  • 09:35: subject "Linus commented on your post", body "You have 1 new comment."
  • 09:40: subject "Grace commented on your post", body "You have 1 new comment."

How long a digest can wait, by plan

The longest window a digest step can hold events for depends on the plan. It is checked when you save the workflow, and for a scheduled digest it covers the gap between two runs.

PlanLongest digest window
Free24 hours
Pro7 days
Team90 days
EnterpriseCustom

Each trigger counts as one event on your plan, whether or not a digest folds it into another message: a digest reduces the messages your subscribers receive, not the events you send. The pricing page lists each plan's monthly events.

Go deeper in the docs

  • Workflows: how workflows are built in the editor and triggered with one API call.
  • In-app inbox: the feed a digest can write one summary to instead of many messages.
  • REST API: triggering workflows over plain HTTP, with authentication and errors.

Frequently asked questions

What is a digest notification?

One message that summarises several events. Instead of sending a notification per event, a digest step collects the events a subscriber receives over a window and runs the rest of the workflow once, so the subscriber gets, for example, one email about three comments instead of three emails.

What is the difference between a regular and a scheduled digest?

A regular digest opens when an event arrives and is sent once its window, such as 30 minutes, has passed since that event. A scheduled digest is sent at fixed times: its first event waits for the next one, such as every day at 09:00 in the subscriber's timezone, and the events that arrive before then join it.

What does a look-back window do?

It sends an event straight away unless it repeats one that has already gone out. With Start digest set to When events repeat within 30 minutes, an event is delivered on its own unless an earlier event for the same subscriber and group arrived in the last 30 minutes and was already sent, on its own or in a digest it opened; then the new event opens a digest, or joins the one already open. Events still waiting in an open digest don't count as earlier events.

Can one subscriber get a separate digest per post or project?

Yes. Group events by adds a payload variable, such as payload.postId, to the digest key, which always includes the subscriber. Events with different values go into different digests, so each post gets its own summary.

How long can a digest window be?

It depends on the plan: up to 24 hours on Free, 7 days on Pro and 90 days on Team, with a custom limit on Enterprise. The limit is checked when the workflow is saved, and for a scheduled digest it applies to the time between two runs.

Does a digest lower the number of events I am billed for?

No. Every trigger counts as one event on your plan, including the ones a digest folds into another message. What a digest reduces is the number of messages your subscribers receive.

Which channels can send a digest?

Any step after the digest step. Email, in-app, SMS, push and chat steps all see the collected events and the event count, so each channel can summarise the batch in its own template.

One workflow for in-app, email, SMS, push and chat.

The free plan includes 10,000 events per month, no card needed.

Get started freeSee pricing