Message on failling do deploy a embedded workflow

Hey everyone,

Is it possible to use the Losant API to detect when a deployment failure occurs for an embedded workflow?

For example, we are facing cases where the deployment of a WASM bundle fails due to exceeding the payload size limit. It would be very useful to be able to identify this error via the API so we can automate a solution.

I’ve noticed that the problem is resolved if we remove all the workflows and then deploy them one by one. We would like to create a script to automate this routine as soon as the failure is detected.

If you use the Embedded Deployments: Get API endpoint, you can ask for the specific embedded deployments for a device. On an individual embedded deployment item, there is a logs array, and if you look at the entries there is a possible error field. The logs are in the order of most recent first, so if you look at the error field on the first entry in the logs array, you should be able to detect this failure.

Hope that helps!