Triggers

Triggers are the starting-point to an Automation, capable of executing an Automation lifecycle based on any kind of logic.

Booting

Triggers are able to asynchronously boot before being ready to execute. This is useful for fetching external data or establishing WebSocket connections as an example.

async mounted() {
    await super.mounted();

    // Establish a WebSocket connection, start longpolling, etc.
}

Execution

When a Trigger decides an Automation should run, e.g. a new Twitch Subscriber event has come in, it calls the trigger function to inform the App that it should begin executing the Automation.

Triggers can also pass an output object that is based on the I/O Schema to give information to the Cards executed after the Trigger.

async mounted() {
    await super.mounted();

    setInterval(() => {
        // See I/O Documentation for schema specification.
        this.trigger({
            meta: {
                date: (new Date()).getTime(),
            },
        });
    }, 5000);
}