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

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! =)

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?

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

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.

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!