# Active Contract Set Service returns a Stream Arrays/List: how big can the arrays/List be per event in the stream?

**URL:** <https://forum.canton.network/t/active-contract-set-service-returns-a-stream-arrays-list-how-big-can-the-arrays-list-be-per-event-in-the-stream/4738>\
**Category:** App Development\
**Tags:** ledger-api\
**Created:** [June 15, 2022, 2:32pm UTC](https://forum.canton.network/t/active-contract-set-service-returns-a-stream-arrays-list-how-big-can-the-arrays-list-be-per-event-in-the-stream/4738 "2022-06-15T14:32:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![StephenOTT](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stephenott/32/3953_2.png) [@StephenOTT](https://forum.canton.network/u/StephenOTT)\
**Post date:** [June 15, 2022, 2:32pm UTC](https://forum.canton.network/t/active-contract-set-service-returns-a-stream-arrays-list-how-big-can-the-arrays-list-be-per-event-in-the-stream/4738/1 "2022-06-15T14:32:54Z")

</div>

Continuation of [Java Bindings: ledgerClient.activeContractSetClient.getActiveContracts returns flowable but is it actually a stream? - #8 by Stephen](https://discuss.daml.com/t/java-bindings-ledgerclient-activecontractsetclient-getactivecontracts-returns-flowable-but-is-it-actually-a-stream/4732/8)

The ACS API returns a list of contracts in each event in the stream: [Ledger API Reference — Daml SDK 2.2.0 documentation](https://docs.daml.com/app-dev/grpc/proto-docs.html#getactivecontractsresponse)

But how big can each list be? What is the max number of contracts that will be returned per event?

---

<div class="post-metadata">

**Author:** ![gerolf](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gerolf/32/358_2.png) [@gerolf](https://forum.canton.network/u/gerolf)\
**Post date:** [June 16, 2022, 12:02pm UTC](https://forum.canton.network/t/active-contract-set-service-returns-a-stream-arrays-list-how-big-can-the-arrays-list-be-per-event-in-the-stream/4738/2 "2022-06-16T12:02:51Z")

</div>

Hi @StephenOTT,

Considering this sentence from the documentation you linked to:

> The list of contracts that were introduced by the workflow with `workflow_id`

While the Ledger API _ **does not guarantee this** _, in practice this means that each individual response message contains the number of `CreatedEvent`s of a transaction, that were still active at the time of the request. So the maximum number of contracts in this list is the same as the number of contracts created in a transaction, that haven’t been archived yet.

Update: Keep in mind that the specific Ledger API implementation is also free to send one `CreatedEvent` per GetActiveContractsResponse. The comment above is about the upper bound of the list.

---

<div class="post-metadata">

**Author:** ![StephenOTT](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stephenott/32/3953_2.png) [@StephenOTT](https://forum.canton.network/u/StephenOTT)\
**Post date:** [June 17, 2022, 2:34am UTC](https://forum.canton.network/t/active-contract-set-service-returns-a-stream-arrays-list-how-big-can-the-arrays-list-be-per-event-in-the-stream/4738/3 "2022-06-17T02:34:00Z")

</div>

@gerolf thanks for that details. WorkflowID == transactionId ?

---

<div class="post-metadata">

**Author:** ![gerolf](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gerolf/32/358_2.png) [@gerolf](https://forum.canton.network/u/gerolf)\
**Post date:** [June 20, 2022, 8:07am UTC](https://forum.canton.network/t/active-contract-set-service-returns-a-stream-arrays-list-how-big-can-the-arrays-list-be-per-event-in-the-stream/4738/4 "2022-06-20T08:07:57Z")

</div>

No, the workflowID can be used to associate multiple transactions to the same business workflow. This is a user/application provided field in the [`Commands`](https://docs.daml.com/app-dev/grpc/proto-docs.html#commands) message.

---

<div class="post-metadata">

**Author:** ![StephenOTT](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stephenott/32/3953_2.png) [@StephenOTT](https://forum.canton.network/u/StephenOTT)\
**Post date:** [June 20, 2022, 1:34pm UTC](https://forum.canton.network/t/active-contract-set-service-returns-a-stream-arrays-list-how-big-can-the-arrays-list-be-per-event-in-the-stream/4738/5 "2022-06-20T13:34:11Z")

</div>

@gerolf so based on your previous two comments:

1. If workflow id was used /provided then the api call returns the contracts associated with that id (across multiple transactions)

2. If workflow id was not provided then the api returns contracts per transaction

?

---

<div class="post-metadata">

**Author:** ![gerolf](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gerolf/32/358_2.png) [@gerolf](https://forum.canton.network/u/gerolf)\
**Post date:** [June 20, 2022, 1:56pm UTC](https://forum.canton.network/t/active-contract-set-service-returns-a-stream-arrays-list-how-big-can-the-arrays-list-be-per-event-in-the-stream/4738/6 "2022-06-20T13:56:41Z")

</div>

In practice across recent releases of the Daml SDK, you will actually always get a single contract in each `GetActiveContractsResponse`.

---

<div class="post-metadata">

**Author:** ![StephenOTT](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stephenott/32/3953_2.png) [@StephenOTT](https://forum.canton.network/u/StephenOTT)\
**Post date:** [June 20, 2022, 3:31pm UTC](https://forum.canton.network/t/active-contract-set-service-returns-a-stream-arrays-list-how-big-can-the-arrays-list-be-per-event-in-the-stream/4738/7 "2022-06-20T15:31:09Z")

</div>

@gerolf thanks!
