Although balenaCloud has a comprehensive API, we currently have no means of exposing events and allowing users to capture and react to them. One way we could achieve this is by implementing webhooks.
Would be nice if one could filter for certain types of events and to have multiple webhooks. For example: Webhook A only receives an event when a device has been added to a fleet while Webhook B receives an event when a device variable has been changed (plus the respective value).
Thomas Cahill (tacLog): Hey,
I would like to ask the people that are upvoting to share their use cases. We want to understand what values are currently accessible with the API via polling that people could use Webhooks for instead. Or what changes aren’t possible to detect currently that people would like to detect?
Harald (balena): Hello,
I’d like to understand if webhooks as it’s a technical implementation detail is the necessary implementation?
Would also providing such events on a message bus that a user can subscribe to sufficient?
Would like to understand the consumer part of these events.
Thanks a lot!
Hello
In my case, we have multiple users interacting with our fleets, and it would be nice if we could detect when a certain user changes a variable, pin a release, reboot a device, etc.
Rahul: I think this will also enable users to then connect to a service like https://zapier.com/ or https://n8n.io/ and unlock more interesting use cases via the connectors that already exist on those platforms
This is a requirement for us in order to notify user of an ongoing upgrade. But in this case we don’t have to be notified from webhook… on the web, but just locally. We want the supervisor to our app “A new release has been downloaded and is ready to be installed, do you want to proceed ?”. If no user is currently using our device, then we would answer “Yes” and start update, otherwise we would answer “No”, maybe with a “Try again in…” response.
This feature will let us display a message on screen to user, saying that “An new release is being installed, please wait…”. Which means we also need to be notified once update is terminated. Because the component watching for notifications could be killed & restarted during update, it would help to be able to get “missed notification”, or notification from a few seconds in the past, something like that.
Not sure about proper implementation, but I think you get the point
We currently poll the API for identifying when a new device appears for the first time.
We also try to trigger actions when a release receives tags, or a device receives tags is useful for us simply because we use tags to take custom actions such as sync’ing. (Devices Cohort Pinned to Automatically Track Release Tag - #4 by louisburton)
When a new release is available would perhaps also be useful.
The way we have gotten around this is by mandating some of these interactions come through an interface on top of the Balena API, such that we are aware of these actions and can do what’s needed at Balena and also action what is not captured at Balena. The downside here is that we’re needing to engineer too much and lose the benefit of the dashboard.
A message bus would be awesome - Im polling for device location, but would plug all kinds of info from the api (last heartbeat, device temp, etc) into my frontend if there was a source of events
Given the variety of tools these days, I’d prefer to have webhooks sooner and optimize with buses as the next step. Not everyone’s requirements will allow for vendor buses, and webhooks get us all started awhile.
Should buses be your goal, I would need Azure (Compare Azure messaging services - Azure Service Bus | Microsoft Learn).
My use case: events on/off help me to be able to proactively detect failures, this allows me to provide better services to my customers.
A “post-update” hook would be useful for our application. Our application requires a device reboot after updating. We have to do this manually at the moment after each update. Our device count is manageable at the moment, but having a hook that triggers after an update of the application for a fleet would be very useful.
Generic webhooks with a list of input event types from the platform would be amazing
I have 2 use cases:
- For production we once a device comes on line the first time we want to automatically update some device specific environment variables.
- To notify a user if an update has succeeded
Jasmine Gilbert: Thanks for the suggestions and additional detail everyone. This is definitely on our radar and something we’re keen to implement, we just need to figure out the right approach and a timeline. We’ll keep you updated!
We would like to receive some notification in the code that is running inside the device when a new version of the system has been pinned or even when the device is going to restart, so that before the restart, we can show a message to the user. This will help inform the system operator that it was not a system crash, but rather a procedure that was performed by one of our technicians, for example.
Hi,
We’d like to keep track of devices that have been deleted in our internal systems. What is the progress on the webhook implementation.
Thanks