Brainstorming the best way to create a heartbeat sensor

Hi folks,
Just getting started with Temporal in the last few weeks, so pardon any misunderstandings on my part.

My use case: I’m starting to build out a system with temporal, and part of that system needs to query external servers to see if they’re available, every few minutes. We’re calling this a heartbeat sensor.
If the heartbeat activity fails some specified amount of times in a row, I want it to start another activity to notify an admin of the failure (and recovery, if it comes back up). Based on a novice’s reading of the Temporal docs, the best way to achieve this seems like a query on the workflow that ticks up or down based on success or failure of the activity: How to handle a Query in a Workflow in Go | Temporal Documentation
Does this seem like the proper way to go, or is there a better way to achieve what I’m looking to do?

I don’t think the query is the right approach here. Here is the post that explains how polling should be implemented.

I’ll give it a read - thank you!

Hey Maxim! Thank you for pointing me in the right direction, that methodology ended up being super simple to implement once I got my brain wrapped around it (we’re typically polling every 5 minutes, so that first option did the trick). Much appreciated, thanks for making such a great tool. I’m excited to get more involved with it in the coming weeks.

1 Like