# EPL interaction with Cumulocity API - Maximum Page size

**URL:** https://community.cumulocity.com/t/epl-interaction-with-cumulocity-api-maximum-page-size/14150
**Category:** Forum
**Tags:** cumulocity, analytics
**Created:** [December 19, 2025, 11:57am UTC](https://community.cumulocity.com/t/epl-interaction-with-cumulocity-api-maximum-page-size/14150 "2025-12-19T11:57:13Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![bdm](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/bdm/32/11919_2.png) [@bdm](https://community.cumulocity.com/u/bdm)
#### Post date: [December 19, 2025, 11:57am UTC](https://community.cumulocity.com/t/epl-interaction-with-cumulocity-api-maximum-page-size/14150/1 "2025-12-19T11:57:13Z")

</div>

Hello,  
what I know from postman is that I can get from Cumulocity 2000 managed objects maximum in the same page. Going back to EPL, it seems that the limit is 1000, is it correct? thats the first question. The 2nd question is: should I handle pagination within EPL by writing the corresponding code? or EPL handles the pagination automatically?

my initial code before adding pagination:

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/e/1/e123e4d142a1f0dce15c944ac5338416d0583457.png)

![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/f/4/f4e5826898c57b42576a05f45275c5f5b5022617.png)

Code snippet after adding pagination but still not seeing pagination working:

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/3/0/3077304a5e4e453b153f6e9a6e640c2d933225db.png)

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/c/6/c69d80df04675ad1ff4170381bba95241f2b2aff.png)

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/4/0/409f5a21920761e5652998611709df0dc65850ed.png)

note: as you can see generating the reqID again is commented in the last attempt, I was suspecting that maybe the handler is not updating to new reqID so I tested commenting it but I tested both generating a new reqID for findmanagedobject11 and using the old one, both options didn’t succeed in fetching all the expected pages

---

<div class="post-metadata">

### Author: ![Harald\_Meyer](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/harald_meyer/32/1959_2.png) [@Harald\_Meyer](https://community.cumulocity.com/u/Harald_Meyer)
#### Post date: [December 22, 2025, 7:35am UTC](https://community.cumulocity.com/t/epl-interaction-with-cumulocity-api-maximum-page-size/14150/2 "2025-12-22T07:35:07Z")

</div>

Hi,

in most cases you should not be doing pagination yourself. Here you can find an explanation of the parameters:

> **[Querying for managed objects - The Cumulocity Transport Connectivity Plug-in -...](https://cumulocity.com/apama/docs/latest/standard-connectivity-plugins/the-cumulocity-iot-transport-connectivity-plug-in/#querying-for-managed-objects)**
>
> During application initialization (onApplicationInitialized), if the requestAllDevices configuration option is enabled, the adapter sends all device/asset related information using the com.apama.cumulocity.ManagedObject event on the...

If you do not provide pageSize and currentPage, Apama will automatically do the pagination for you with a pageSize of 1000. You can modify the pageSize to up to 2000 but that will not change the behavior you observe but will only lead to fewer request.

If you provide a current page, only that page will be fetched, but there are very few use cases for that.

Also, it does not look like you are listening to the right events. You have to listen for the Response to get the actual managed objects and for the ResponseAck to detect when you received the last event.

Typically the pattern should look like this:

```auto
		FindManagedObject findManagedObject := new FindManagedObject;
		findManagedObject.reqId := Util.generateReqId();
		findManagedObject.params.add("fragmentType", configurationFragmentName);

		monitor.subscribe(FindManagedObjectResponse.SUBSCRIBE_CHANNEL);
		on all FindManagedObjectResponse(reqId=findManagedObject.reqId) as resp and not FindManagedObjectResponseAck(reqId=findManagedObject.reqId) {
			// Process existing managed objects
		}

		on FindManagedObjectResponseAck(reqId=findManagedObject.reqId) {
			monitor.unsubscribe(FindManagedObjectResponse.SUBSCRIBE_CHANNEL);
		}

		send findManagedObject to FindManagedObject.SEND_CHANNEL;

```

---

<div class="post-metadata">

### Author: ![bdm](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/bdm/32/11919_2.png) [@bdm](https://community.cumulocity.com/u/bdm)
#### Post date: [December 22, 2025, 3:57pm UTC](https://community.cumulocity.com/t/epl-interaction-with-cumulocity-api-maximum-page-size/14150/3 "2025-12-22T15:57:21Z")

</div>

In reality pagination was not occurring automatically and we were receiving only 1000 managed objects. We had to do the pagination inside the EPL by sending a new API request under “on FindManagedObjectResponseAck” and removing reID=fmoReqId from both “FindManagedObjectResponse” and “on all FindManagedObjectResponseAck” because ReqID should change for each page while the handler is setup for only the 1st ReqID of the 1st page (now ReqID part is moved using an if inside “on all”

---

<div class="post-metadata">

### Author: ![Sandeep\_Komarneni](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/sandeep_komarneni/32/18273_2.png) [@Sandeep\_Komarneni](https://community.cumulocity.com/u/Sandeep_Komarneni)
#### Post date: [December 22, 2025, 4:30pm UTC](https://community.cumulocity.com/t/epl-interaction-with-cumulocity-api-maximum-page-size/14150/4 "2025-12-22T16:30:31Z")

</div>

can you please try **without** the “currentPage” query param?

---

<div class="post-metadata">

### Author: ![bdm](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/bdm/32/11919_2.png) [@bdm](https://community.cumulocity.com/u/bdm)
#### Post date: [December 23, 2025, 8:40am UTC](https://community.cumulocity.com/t/epl-interaction-with-cumulocity-api-maximum-page-size/14150/5 "2025-12-23T08:40:09Z")

</div>

> [@Harald\_Meyer](#):
>
> [The Cumulocity Transport Connectivity Plug-in - Apama](https://cumulocity.com/apama/docs/latest/standard-connectivity-plugins/the-cumulocity-iot-transport-connectivity-plug-in/#querying-for-managed-objects)

the initial code didn’t include current page, this was the initial one:

```
FindManagedObject findManagedObject := new FindManagedObject;
findManagedObject.reqId := Util.generateReqId();
findManagedObject.params.add("pageSize", "2000");

```

/\* construct query to get all workers\*/  
// individual workers query =\> filter c8y\_IsDevice  
findManagedObject.params.add(“query”, “$filter=(has(c8y\_IsDevice))”);  
send findManagedObject to FindManagedObject.SEND\_CHANNEL;

```auto
/* subscribe for query response*/
 /* receive response and get all workers*/

	monitor.subscribe(FindManagedObjectResponse.SUBSCRIBE_CHANNEL);
	//why do we need "on all" here? it should be "on"

	on all FindManagedObjectResponse(reqId=findManagedObject.reqId) as fmo and not FindManagedObjectResponseAck(reqId=findManagedObject.reqId) {

```

---

<div class="post-metadata">

### Author: ![Harald\_Meyer](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/harald_meyer/32/1959_2.png) [@Harald\_Meyer](https://community.cumulocity.com/u/Harald_Meyer)
#### Post date: [December 23, 2025, 8:41am UTC](https://community.cumulocity.com/t/epl-interaction-with-cumulocity-api-maximum-page-size/14150/6 "2025-12-23T08:41:11Z")

</div>

If you are still using currentPage, please remove it as suggested by @Sandeep_Komarneni. The documentation I linked to above clearly states that if it is provided no pagination takes place.

I did a quick test and the below code returns all 1201 matching devices on my tenant:

```auto
	action onload() {
		FindManagedObject findManagedObject := new FindManagedObject;
		findManagedObject.reqId := Util.generateReqId();
		findManagedObject.params.add("fragmentType", "c8y_TestDevice");

		sequence<string> ids := new sequence<string>;

		monitor.subscribe(FindManagedObjectResponse.SUBSCRIBE_CHANNEL);
		on all FindManagedObjectResponse(reqId=findManagedObject.reqId) as resp and not FindManagedObjectResponseAck(reqId=findManagedObject.reqId) {
			ids.append(resp.managedObject.id);
		}

		on FindManagedObjectResponseAck(reqId=findManagedObject.reqId) {
			monitor.unsubscribe(FindManagedObjectResponse.SUBSCRIBE_CHANNEL);
			log "Count: " + ids.size() at INFO;
		}

		send findManagedObject to FindManagedObject.SEND_CHANNEL;
	}

```

---

<div class="post-metadata">

### Author: ![Harald\_Meyer](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/harald_meyer/32/1959_2.png) [@Harald\_Meyer](https://community.cumulocity.com/u/Harald_Meyer)
#### Post date: [December 23, 2025, 8:45am UTC](https://community.cumulocity.com/t/epl-interaction-with-cumulocity-api-maximum-page-size/14150/7 "2025-12-23T08:45:15Z")

</div>

> [@bdm](#):
>
> findManagedObject.params.add(“query”, “$filter=(has(c8y\_IsDevice))”);  
> send findManagedObject to FindManagedObject.SEND\_CHANNEL;

Two observations:

- use “fragment” instead of “query” will be faster
- you should only do the “send” after you have established the listener like you can see in my example as you otherwise might get responses before you have a listener reacting to them.

---

<div class="post-metadata">

### Author: ![bdm](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/bdm/32/11919_2.png) [@bdm](https://community.cumulocity.com/u/bdm)
#### Post date: [December 23, 2025, 9:05am UTC](https://community.cumulocity.com/t/epl-interaction-with-cumulocity-api-maximum-page-size/14150/8 "2025-12-23T09:05:28Z")

</div>

ok thanks, I will test that. So conclusion : in EPL to get more than 3000+ managed objects there is no need for pageSize and Pagination (currentPage) params in order to get the full response, Pagination happens automatically?  
unlike API calls for example from postman or python (where maximum page size is 2000 managed objects) correct?

Initially we thought that the 2000 managed objects limit applies to EPL just like how it applies to inventory API, but the initial search (which might have been missleading) indicated that API calls to Inventory REST API directly have a limit of 2000 managed object per page, while Apama is going through the Cumulocity Java SDK / Microservice layer which enforces a 1000-item cap.

---

<div class="post-metadata">

### Author: ![Harald\_Meyer](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/harald_meyer/32/1959_2.png) [@Harald\_Meyer](https://community.cumulocity.com/u/Harald_Meyer)
#### Post date: [December 23, 2025, 9:19am UTC](https://community.cumulocity.com/t/epl-interaction-with-cumulocity-api-maximum-page-size/14150/9 "2025-12-23T09:19:47Z")

</div>

Correct, no need to do anything with pageSize or currentPage (in most cases).

EPL like the JavaSDK are still bound to the 2000 item page size limit of Cumulocity but they provide abstractions on top of it that mean you do not have to care about it yourself.

The 1000 item limit use by EPL is compromise to efficiently load many items once but not going to the 2000 item page limit of the API, which could actually be less efficient when processing in EPL.

---

<div class="post-metadata">

### Author: ![bdm](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/bdm/32/11919_2.png) [@bdm](https://community.cumulocity.com/u/bdm)
#### Post date: [December 23, 2025, 9:48am UTC](https://community.cumulocity.com/t/epl-interaction-with-cumulocity-api-maximum-page-size/14150/10 "2025-12-23T09:48:39Z")

</div>

> [@Harald\_Meyer](#):
>
> `fragmentType`

ok, could “query“ param be the tricky reason for automatic pagination issue? and maybe simply replacing it by “fragmentType“ solves pagination?

---

<div class="post-metadata">

### Author: ![Harald\_Meyer](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/harald_meyer/32/1959_2.png) [@Harald\_Meyer](https://community.cumulocity.com/u/Harald_Meyer)
#### Post date: [December 23, 2025, 10:21am UTC](https://community.cumulocity.com/t/epl-interaction-with-cumulocity-api-maximum-page-size/14150/11 "2025-12-23T10:21:21Z")

</div>

I tested with both and both worked for me correctly.

---

<div class="post-metadata">

### Author: ![bdm](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/bdm/32/11919_2.png) [@bdm](https://community.cumulocity.com/u/bdm)
#### Post date: [January 5, 2026, 2:58pm UTC](https://community.cumulocity.com/t/epl-interaction-with-cumulocity-api-maximum-page-size/14150/12 "2026-01-05T14:58:14Z")

</div>

ok thanks, from your perspective, what was the reason why my initial code before pagination didn’t get all the managed objects?

could it be because pagesize was defined?  
my code: pagesize defined to 2000, while it seems EPL supports only 1000 in one page

![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/d/f/df3d6a6a602f94cd85d92da1be464283a9ac9539.png)

your code: no explicit page size, could it be the reason? and what would be the pagesize here? default 5 like postman? while pagination happens automatically

![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/b/a/ba2a7a36c0457d859f9ad237dbf34f33ab38deb6.png)

---

<div class="post-metadata">

### Author: ![Harald\_Meyer](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/harald_meyer/32/1959_2.png) [@Harald\_Meyer](https://community.cumulocity.com/u/Harald_Meyer)
#### Post date: [January 5, 2026, 3:34pm UTC](https://community.cumulocity.com/t/epl-interaction-with-cumulocity-api-maximum-page-size/14150/13 "2026-01-05T15:34:36Z")

</div>

It should have worked with pageSize=2000. I did a test and I received all 2000 matching objects. Are you sure

- you did not also provide a “currentPage” as well?
- other filter parameters that may have reduced the number of matching objects?
- or established the listener after you did the “send” of the FindManagedObject request?

If you do not provide a pageSize, a page size of 1000 is used, which is a good compromise for most use cases.

---

<div class="post-metadata">

### Author: ![bdm](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/bdm/32/11919_2.png) [@bdm](https://community.cumulocity.com/u/bdm)
#### Post date: [January 7, 2026, 5:08pm UTC](https://community.cumulocity.com/t/epl-interaction-with-cumulocity-api-maximum-page-size/14150/14 "2026-01-07T17:08:32Z")

</div>

in our case now the expected Managed objects are greater than 2000, we are receiving now 3125 managed objects and this number will increase daily, does it change anything in the previous feedback? or you already tested a number greater than 2000 ?

---

<div class="post-metadata">

### Author: ![Harald\_Meyer](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/harald_meyer/32/1959_2.png) [@Harald\_Meyer](https://community.cumulocity.com/u/Harald_Meyer)
#### Post date: [January 8, 2026, 6:39am UTC](https://community.cumulocity.com/t/epl-interaction-with-cumulocity-api-maximum-page-size/14150/15 "2026-01-08T06:39:06Z")

</div>

I tested with around 2100 managed objects not providing a page size, so the default of 1000 was used. I received all expected managed objects in my EPL App.
