Every fall, we get new graduates at Appfarm. Once they get comfortable with Appfarm Create, I ask them all the same question: “What is your favorite Action node?” Most of them are caught completely off guard and need time to think. So I fill the awkward silence by talking about my favorite Action node: Aggregate data.
I usually spend some time talking about dashboards: how we used to grab a coffee while one was loading, and how you could spend weeks building an optimal setup for displaying large amounts of data. And it would still take time to load.
This article is the written version of that monologue. With screenshots, a benchmark, and no awkward silence.
The short version: the best way to build a live dashboard in Appfarm Create today is to let the database do the math. Use the Aggregate data Action node, write the results to a runtime-only data source, and bind your charts, texts, or other components to that.
It wasn’t always this way. If you’ve built dashboards in Appfarm Create for a few years, you probably remember waiting minutes for one to load (long enough to grab a coffee), running into timeouts, and writing functions to calculate sums and averages, because most of the heavy lifting was done on the client. This article walks through how our practices have changed, why the old patterns hurt, and how to set up the pattern we recommend now. Further down there’s a short video of a dashboard built this way.
How big is the difference? In our test, a single sum grouped by pickup zone over 840,000 records took more than three and a half minutes the old way. Aggregate data did it in under a second.
How we used to build dashboards (a brief history of waiting)
Before October 2024, a dashboard in Appfarm Create was built using one of two approaches:
- Using database-connected data sources that reloaded instantly whenever a filter changed.
- Reading into runtime-only data sources in an Action.
Calculations like sum, min, max, and average lived in runtime properties, or were calculated and updated on runtime objects in Actions. Common to both approaches was that the work had to be done client-side, and it was often heavy and inefficient. Many teams ended up building dedicated services to pre-compute and store aggregated data in their own data structure to make certain types of dashboards faster. This came at the cost of having dashboard data that was not necessarily up to date.
Filters were set directly on the database-connected data source, or in the Action that read objects into a runtime-only data source. Until conditional filters on Read objects arrived in early 2025, letting users filter dynamically meant building decision trees of Read objects Action nodes, often one branch per filter combination.
Put together, client-side calculations, incremental reads, and complex filter logic meant a dashboard could take minutes to load. In solutions that still use the old pattern, it probably still does. If that sounds familiar, don’t worry: this story has a happy ending.
Why was this a bad pattern?
- Heavy load on the data service. Users opening and re-filtering dashboards could slow things down for everyone else using the app.
- Complex to build. At least if you wanted it to be efficient.
- Hard to maintain. The complexity piled up quickly.
- Too many approaches. Teams often solved it differently, which led to many different kinds of performance issues.

What changed: enter the Aggregate data Action node
In October 2024 we introduced the Aggregate data Action node. Instead of reading records into the app and calculating there, it uses MongoDB’s built-in aggregation pipelines, so the work happens in the database. For the dashboard community in Appfarm this was a huge milestone: we could suddenly aggregate far larger datasets than ever before. It has kept improving since, which is a big part of why it’s my favorite.
Best practice today
For dashboards on large datasets in Appfarm Create, the recommendation will surprise no one who has read this far: let the database do the work with the Aggregate data Action node.
The pattern looks like this:
- Aggregate data reads from the database, filters, groups, and calculates. Only the results come back.
- A runtime-only data source holds those results. Nothing is persisted and nothing stays connected to the database.
- A chart component binds to the runtime-only data source or a simple text component for displaying a key performance indicator (KPI).
Run aggregations in parallel. One Aggregate data node can calculate several KPIs at once, such as a count, a sum, and an average, as long as they share the same filters and group by. You need a separate node when the filters or the group by differ. A dashboard usually needs a few of those, so put them in blocks in parallel mode so they run at the same time instead of one after another.
Know when you need the Data Aggregation Service. Aggregate data works on every plan. If your aggregations are heavy or you need nested group bys, the Data Aggregation Service gives you more room. More on that below.
The Data Aggregation Service
Aggregate data works on all plans, and for many dashboards that’s all you need. The Data Aggregation Service is an add-on: a dedicated data service for data aggregation, GraphQL, and conditional permissions. Aggregation traffic then runs separately from the data service your other users depend on.
It makes a difference in two situations. The first is when your aggregations run into the timeout. Each plan limits how long an aggregation query can run, and the Data Aggregation Service raises that limit to 30 seconds:
| Plan | Aggregation timeout |
|---|---|
| Essential | 3,000 ms |
| Professional | 4,000 ms |
| Dedicated | 5,000 ms |
| With Data Aggregation Service | 30,000 ms |
The second is when you need nested group bys with deep data bindings, which come with the Data Aggregation Service. That lets you group by properties on related objects, for example trips per taxi company where the taxi company is a property on the taxi driver, and not on the taxi trip itself.
What if an aggregation times out? You have two options. Reduce the aggregation, for example with tighter filters, fewer groups, or a shorter date range, reduce the amount of data, or move to a plan or add-on with a higher timeout. It’s worth trying the first before the latter.
Setting it up in Appfarm Create
Time to get our hands dirty. As an example, we’ll build a chart showing taxi trips per pickup zone. The same steps apply to any KPI or chart. For reference, our data model is roughly something like this.
-
Create a data connector data source for the object class you want to aggregate. The data aggregation needs to know what type of data (that is, the object class) it is going to aggregate. For this, we need a data connector data source. We can either set a filter or read all objects.
-
Create a runtime-only target data source. We can either use the same object class as the one we are going to aggregate (adding runtime properties if necessary), or build a custom object class specifically for the aggregations.
The latter option can be useful where our initial target object class for aggregation has a lot of unnecessary object class properties, or is missing the necessary properties for the aggregations we want to perform. Keep in mind that if the aggregations are done in runtime properties, they cannot be transferred from a Flow to the client or between Actions. In this case, a custom object class targeted for aggregations is the solution.
-
Create an app variable for holding a filter property. We add a Taxi Zone as a multi-reference app variable to let users filter which taxi zones to include in the aggregation. This will be available in the UI.
-
Create an Action for our aggregation and add an Aggregate data Action node. First we select the data connector and map it to our data connector data source and the right object class. Then we choose All objects, or set up a Filtered selection based on our needs. Finally, we set our target data source to be the runtime-only data source we added previously.
-
Add filters. Use runtime-enabled conditional filters so the dashboard’s own filters, such as date ranges or taxi companies, feed straight into the query. For our case, we want to let the user select which zones the customer was picked up in, so we add the app variable as a conditional filter.
-
Group by. Group by pickup zone. Each unique group becomes one result object. With nested group bys we can also group by a property on a related object. For example the Borough property on the Taxi Zone object class.
-
Add aggregations. We select what field we want to aggregate, the operator (Sum in our case) and map it to a property in our target data source.
-
Finally, we call the Action and plug the results into our UI. For our demo app, we have let Appfarm AI build a dashboard for KPIs and pickup zones. The dashboard refresh is built into both the On View Loaded event handler and a separate refresh dashboard button. The reason we use the On View Loaded event handler is that we want to present the (empty) dashboard and instantly enter a loading state afterwards for the user to wait while we perform the initial aggregations.
Appfarm AI doesn’t just build UI. It can also set up data aggregation for you. Building a flexible aggregation Action with a lot of conditional filters, grouping options, and aggregations can be repetitive work, and putting Appfarm AI to the task will save you time.
See it in action
Here’s a video of a larger dashboard built on exactly this pattern.
The dataset behind it has roughly 840,000 records and performs six different aggregations in parallel before presenting the charts.
The filters are app variables for this demo case, all of them added as conditional filters to the Aggregate data Action node.
How big is the difference?
To put a number on it, we ran one simple aggregation both ways: the sum of total amount, grouped by pickup zone, across all 840,000 records. The old way read the records incrementally, 10,000 at a time, and accumulated the results in variables. We didn’t try loading the full dashboard the old way, since that would have taken far longer.
Aggregate data took about 800 ms. The old way took about 222,000 ms, or 3 min 42 s. That’s roughly 280 times faster, or about the difference between refilling your coffee and blinking. And the old approach keeps the data service busy for those three and a half minutes, every time the aggregation runs. A full dashboard needs several of them.
Beyond dashboards: more ways to use Aggregate data
This is where my favorite Action node really earns its title. Data aggregation doesn’t have to end in a dashboard in an Appfarm app. Anywhere you need a number, a count, or a summary, the same rule applies: let the database do the work. Here are some ideas to get you started.
Let your agents talk to your data
The new Agent Action node (currently in beta) has built-in support for giving the agent aggregation capabilities. If you build an agent for “talking to your data” or processing data, add the data source as a tool and select the Aggregate operation. The agent can then count, sum, average, and group directly in the database, without loading anything into the data source.
Ask it “How many trips started in each pickup zone last week, compared to the week before?” and it answers with a database-level aggregation instead of reading thousands of records into its context. That’s faster, uses fewer tokens, and is more reliable than asking a language model to count rows.
Expose aggregations through MCP
Another possibility is to build an MCP server (Model Context Protocol, the standard AI assistants use to connect to tools and data) with an aggregation tool, so AI clients outside Appfarm can retrieve aggregated data sets. In Appfarm, an MCP server exposes its Actions as tools, and an Action can run Aggregate data and return the result.
Connect it to Claude, ChatGPT, or similar, and you can build dashboards on top of your Appfarm Create data, or ask ad-hoc questions without building a single screen.
Other ideas
- KPI snapshots on a schedule. A scheduled Flow aggregates yesterday’s numbers every night and stores them in a KPI history object class. Trend charts then read a few hundred snapshot rows instead of millions of raw records, and the history survives even if old data is archived.
- Digests and alerts. A scheduled Flow sums up the week and sends it by email or Slack, or raises an alert when a number crosses a threshold, for example when cancellations double compared to last week.
- API endpoints for other systems. Return totals and counts from an API endpoint Flow, so business intelligence (BI) tools, partner systems, or a public website can show live figures without pulling raw data.
- Business rules and limits. Count before you allow: max bookings per user, capacity per time slot, or a usage quota per customer. One aggregation replaces reading every related record.
- Data quality checks. Group by a key field and count to find duplicates, or count records with missing values, and flag them for cleanup.
- Usage-based billing. Sum usage per customer per month and feed it straight into invoicing.
- Counters and badges in the UI. Open tasks, unread messages, or items awaiting approval in a menu badge, without loading the records behind the number.
Key takeaways
- Let the database do the work. Use the Aggregate data Action node, write the results to a runtime-only data source, and bind your charts and KPIs to that.
- The difference is huge. Summing 840,000 records by pickup zone, Aggregate data took ~800 ms. The old pattern took about 3 minutes and 42 seconds.
- Run aggregations in parallel. Put them in blocks in parallel mode so several charts load at once.
- Reach for the Data Aggregation Service when you need it. It gives you longer timeouts and nested group bys. If you hit a timeout, try narrowing the aggregation first.
- Think beyond dashboards. Agents, MCP servers, scheduled snapshots, alerts, and business rules all benefit from the same pattern.
Read more in the Aggregate data documentation and Understand charts.
Over to you
We’d love to see what you build. Share a screenshot of your dashboard, a clever aggregation setup, or a use case we didn’t cover. And if you’re moving an old dashboard over to Aggregate data, tell us how many minutes you shave off.
Oh, and by now our graduates have usually picked favorites of their own, both Action nodes and UI components. Aggregate data is a popular choice, along with Update objects, Web request, and the brand-new Agent Action node. What’s yours? Let us know in the comments below.




