# Start new worker and shut it down after every Activity execution

**URL:** <https://community.temporal.io/t/start-new-worker-and-shut-it-down-after-every-activity-execution/3687>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [January 4, 2022, 3:07pm UTC](https://community.temporal.io/t/start-new-worker-and-shut-it-down-after-every-activity-execution/3687 "2022-01-04T15:07:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![walak89](https://avatars.discourse-cdn.com/v4/letter/w/7cd45c/32.png) [@walak89](https://community.temporal.io/u/walak89)\
**Post date:** [January 4, 2022, 3:07pm UTC](https://community.temporal.io/t/start-new-worker-and-shut-it-down-after-every-activity-execution/3687/1 "2022-01-04T15:07:51Z")

</div>

Hi all,

I have a use case which requires to spin a new Worker on every Activity execution.  
Is there any recommended pattern to do so?

My idea was to start an activity which sets up the worker and then call another Activity to run on it. Once the activity is completed the worker is closed.

---

<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:** [January 4, 2022, 3:09pm UTC](https://community.temporal.io/t/start-new-worker-and-shut-it-down-after-every-activity-execution/3687/2 "2022-01-04T15:09:40Z")

</div>

This should work fine. You want to have a separate task queue for that specific worker. If you describe your use case in more detail we might provide more concrete feedback.

---

<div class="post-metadata">

**Author:** ![walak89](https://avatars.discourse-cdn.com/v4/letter/w/7cd45c/32.png) [@walak89](https://community.temporal.io/u/walak89)\
**Post date:** [January 4, 2022, 3:29pm UTC](https://community.temporal.io/t/start-new-worker-and-shut-it-down-after-every-activity-execution/3687/3 "2022-01-04T15:29:15Z")

</div>

In the use case I run a bunch of activities from one Workflow. The Workflow may be run for different inputs which require separated configuration in that one ActivityWorker which I need to start and shutdown.  
Everything runs on K8S cluster and Workers are executed as separated pods.

Let me know if you need more details.

---

<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:** [January 4, 2022, 3:57pm UTC](https://community.temporal.io/t/start-new-worker-and-shut-it-down-after-every-activity-execution/3687/4 "2022-01-04T15:57:27Z")

</div>

Sorry, I still don’t understand why you need a separate worker just for one specific activity. What is the business need for this?
