Workflow timing out for device

could it possibly be a race condition for these messages, i have them both coming up at around the same time. It seems that the device is only left with attributes from the second message



Potentially a race condition, but difficult to know. I recommend inspecting the debug output for wherever is setting that second set of attributes. You can mute all other debug nodes to reduce the output. Want to first rule out the logic before assuming a race condition.

1 Like

Maybe is a race condition, the second round of values coming in only shows the device having one attribute, not all of the others that were assigned in the first batch of new data

especially since the devices that didnt have their attriubtes wiped arent suffering from this issue, since they dont need to add new attributes they are preforming fine?

I doubt a race condition. Looks like the device only had the connected attribute before the update. As far as I can tell, that attribute is only set in the Check Connection workflow and does not use the Payload Path option. When you use Individual Fields, the update is atomic (no race condition). This means that device’s attributes were completely removed and then the Check Connection workflow ran at some point and added back the one attribute.

1 Like

Backing up a little, an alternative implementation could be to use a Loop and individual Device: Update Nodes for each attribute you’re adding. This would eliminate any issues with maintaining the existing attributes and eliminate any race conditions.

I would recommend wrapping it up in a Custom Node so that all your other logic doesn’t really have to change. Inside the Custom Node, you loop over every attribute and invoke a Device: Update Node for each one individually using the Individual Fields option. If the device already has the matching attribute name and data type, the update is ignored.

If you replace everywhere in your app using the Device: Update Node with the Payload Path option with this custom node, you should no longer have disappearing attribute issues.

And just to confirm the update calls aren’t billable payloads? which be the incentive to merge into vs have separate

Invoking the Device: Update Node does not result in any billable payloads.

1 Like