# Continue-as-new Vs Child workflow

**URL:** <https://community.temporal.io/t/continue-as-new-vs-child-workflow/16690>\
**Category:** Community Support\
**Tags:** java-sdk, child-workflow, continue-as-new\
**Created:** [March 5, 2025, 8:39pm UTC](https://community.temporal.io/t/continue-as-new-vs-child-workflow/16690 "2025-03-05T20:39:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebin](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@sebin](https://community.temporal.io/u/sebin)\
**Post date:** [March 5, 2025, 8:39pm UTC](https://community.temporal.io/t/continue-as-new-vs-child-workflow/16690/1 "2025-03-05T20:39:23Z")

</div>

Hi,  
We have a parent workflow that basically performs a long running iterative process. Something like lets say fetch 10k ids from database, and process each id.  
In order to prevent event history growing beyond the limit, we thought of 2 approaches

1. Have batches of 1k ids, for each id start a child workflow and then continue as new when this batch is processed.
2. Have batches of 1k ids, for each id start a child workflow, and then start the next batch as a child workflow  
In both cases the event history will not grow by a lot so whats the best strategy.

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [March 5, 2025, 11:04pm UTC](https://community.temporal.io/t/continue-as-new-vs-child-workflow/16690/2 "2025-03-05T23:04:51Z")

</div>

Both would work. I prefer (1) as it works for unlimited dataset size.

---

<div class="post-metadata">

**Author:** ![sebin](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@sebin](https://community.temporal.io/u/sebin)\
**Post date:** [March 6, 2025, 6:27am UTC](https://community.temporal.io/t/continue-as-new-vs-child-workflow/16690/3 "2025-03-06T06:27:30Z")

</div>

Thanks Maxim!
