Particle Cloud allows devices to expose custom functions through their Cloud so they can be triggered externally using an API call. With a Particle.function line, a specific code on the device can be run when requested from the cloud API.
You typically do this when you want to control something on your device, say a LCD display or a buzzer, or control features in your firmware from the cloud.
Now, together with Ubidots’ Events engine and Particle functions, it is possible to run code on demand based on complex variable’s conditions or in a time weekly basis, in your Devices
See a full example, from Particle device to Ubidots cloud, on how to use this feature: