This example demonstrates how the AppBlocks Cloud and its Workflows feature can be used to be notified on LINE when some event occurs on a device connected to the cloud.
Here we assume you have set up a LINE Official Account via the LINE API, generated the channel access token in the Messaging API settings and added the account as a friend from a regular LINE user. Head over to the LINE Messaging API website to get started.
Before you run the project provided with this example on your device, you need to associate the device with an AppBlocks Cloud Device. You can simply do this in the AppBlocks Designer by clicking on the 'Create' button in the prompt showing at the bottom right corner of the screen when you open the designer. Toggle the Cloud feature to Disabled then back to Enabled in the Features => AppBlocks Cloud section of the designer if you do not see the prompt.

Once the device is created, the Designer should have filled the Device ID and Device Password for you.

You can now run the project on your device. In another browser tab, head over to the Devices section of the AppBlocks Cloud. You should see your device listed there, with the green status icon indicating that it is online and connected.

Moving on to the Workflows section, create a new workflow and give it a name. You should now see a blank canvas similar to the the AppBlocks section of the AppBlocksDesigner. Workflows are simpler in that they only consist of one trigger and a chain of actions executed linearly.

In edit mode, set the trigger to Device Event. Our workflow will indeed be triggered when our device adds an entry to its Event Log.

To receive the message on LINE, we will use the HTTP Request action. The parameters are straightforward if you are familiar with HTTP requests. In this case, we want to send a POST request that sends a broadcast (one-to-many) message to the account's friends list. Note that to make the request work, you need to replace the **Access Token** placeholders with your account's access token. You can find more information and messaging types in the LINE API documentation.

Before saving, we will move to the Settings tab to both enable the workflow and allow it to be triggered more than once.

Once the worklow is saved, let's finally add an entry to the device's Event Log by pressing the MD button on the device and see the magic happen:

Last, the Runs section of the workflow can also be used to see the history of the workflow runs and to get useful information about the actions and the device state when the workflow was executed.
