Google Cloud Functions can be associated with a specific trigger. The trigger type determines how and when your function executes. Cloud Functions supports the following native trigger mechanisms:
You can also integrate Cloud Functions with any other Google service that supports Cloud Pub/Sub, or any service that provides HTTP callbacks (webhooks). This is described in more detail in Additional Triggers, below.
Because Cloud Functions can be invoked by messages on a Cloud Pub/Sub topic, you can easily integrate Cloud Functions with any other Google service that supports Cloud Pub/Sub as an event bus. In addition by leveraging HTTP invocation you can also integrate with any service that provides HTTP callbacks (webhooks).
Google Cloud Logging events can be exported to a Cloud Pub/Sub topic from which they can then be consumed by a Cloud Functions. See the Cloud Logging documentation on exporting logs for more information.
Using the Gmail Push Notification API you can send Gmail events to a Cloud Pub/Sub topic and consume them with a Cloud Function.