# How to create a worker that just pools for new tasks?

**URL:** https://community.temporal.io/t/how-to-create-a-worker-that-just-pools-for-new-tasks/6458
**Category:** Community Support
**Tags:** worker
**Created:** [November 11, 2022, 2:47pm UTC](https://community.temporal.io/t/how-to-create-a-worker-that-just-pools-for-new-tasks/6458 "2022-11-11T14:47:12Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![outerlook](https://avatars.discourse-cdn.com/v4/letter/o/c57346/32.png) [@outerlook](https://community.temporal.io/u/outerlook)
#### Post date: [November 11, 2022, 2:47pm UTC](https://community.temporal.io/t/how-to-create-a-worker-that-just-pools-for-new-tasks/6458/1 "2022-11-11T14:47:12Z")

</div>

Hi! I’m trying to figure out how to build an aws serverless worker program.

The reason for it is I would like to pay less upfront, while the costs of a full fargate deployment for each of my environments wouldn’t be so feasible right now.

I thought of an architecture which uses SNS/SQS and lambda (and temporal cloud).

Maybe creating a lambda scheduled to happen each 5 minutes only responsible getting `pendingWorkflows`, then getting something like “pendingTasks” by executing this current pending workflows.

If it finds pending tasks, it sends SNS/SQS for this pending tasks which is handled in other lambda that handles activities.

PS. the reason I would like to separate this, is because some of my activities uses resources that maybe more compute intensive (would require more memory) or need more costly connections (prisma.connect for example). Then a pooling separated from that may be better

My question is, I didn’t really find something in the docs that says this kind of architecture would be feasible, or if I could build it with primitive temporal api’s.

Is it feasible, or there’s something I missed while reading the docs?  
Thank you for your time helping me! =)

---

<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: [November 11, 2022, 6:45pm UTC](https://community.temporal.io/t/how-to-create-a-worker-that-just-pools-for-new-tasks/6458/2 "2022-11-11T18:45:26Z")

</div>

Such architecture should be possible. But I’m not sure if it is worth the complexity. What are the workflow/activity execution rates you are targeting?

---

<div class="post-metadata">

### Author: ![outerlook](https://avatars.discourse-cdn.com/v4/letter/o/c57346/32.png) [@outerlook](https://community.temporal.io/u/outerlook)
#### Post date: [November 11, 2022, 7:20pm UTC](https://community.temporal.io/t/how-to-create-a-worker-that-just-pools-for-new-tasks/6458/3 "2022-11-11T19:20:53Z")

</div>

Well, for some time about 10 workflows started per day, which will execute like 6 activities in a period of 7 days.

Basically a structured chat bot with some internal assignments and notification system… and would be nice to cheaply deploy some test environments that wouldn’t be used on a day to day basis.

Thanks, and I appreciate your thoughts, @maxim

---

<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: [November 11, 2022, 8:10pm UTC](https://community.temporal.io/t/how-to-create-a-worker-that-just-pools-for-new-tasks/6458/4 "2022-11-11T20:10:37Z")

</div>

You could fit all of that in a single small VM, which wouldn’t be that expensive. But it wouldn’t require any of the complexity.

---

<div class="post-metadata">

### Author: ![outerlook](https://avatars.discourse-cdn.com/v4/letter/o/c57346/32.png) [@outerlook](https://community.temporal.io/u/outerlook)
#### Post date: [November 11, 2022, 8:18pm UTC](https://community.temporal.io/t/how-to-create-a-worker-that-just-pools-for-new-tasks/6458/5 "2022-11-11T20:18:08Z")

</div>

Alright! Will listen to your advice.

If it wasn’t complex it would fit my per-environment cdk deployment flow, but I understand and trust it wouldn’t be worth then.

Thanks!
