OpenFaaS functions can be triggered easily by any kind of event. The most common use-case is HTTP which acts as a lingua franca between internet-connected systems.
Connectors map one or more topics, subjects or queues from a stateful messaging system or event-source to a number of functions in your cluster.
You can execute a function or microservice asynchronously by replacing /function/ with /async-function/ when accessing the endpoint via the OpenFaaS gateway.
With the connector patterns, you can trigger functions from any event-source or messaging system, without having to add SDKs or subscription code to each of your functions.
This means a function can be triggered by Apache Kafka, AWS SNS and Cron, without having any direct coupling to of these systems. As functions scale, there is no additional load generated on the underlying event sources.
Pictured: Event-connector pattern. Each topic, subject or queue can be broadcast to one or many functions.
Trigger functions based upon Postgres events including: insert, update and delete. The default mode uses the efficient Write Ahead Log (WAL) that is also used by Postgres for replication.
Trigger OpenFaaS functions based upon many different types of events generated in AWS using an AWS SNS subscription. Events are sent by AWS via HTTPS and the connector will require as public endpoint to be accessible. Events are verified using the AWS public key and TLS ensures encryption of messages.
If you are unable to expose a public endpoint for any reason, and still need events from AWS, we recommend using the SQS connector instead.
The cron-connector can be used to trigger functions on a timed schedule. It uses traditional cron expressions.
When using the Community Edition (CE) of the connector, functions can only be invoked by the cron connector, however OpenFaaS Pro customers can set up a function to be invoked by Cron and any other connectors that they need.
The MQTT Connector can be used in conjunction with an MQTT broker such as emitter.io or similar to respond to events from IoT devices and MQTT message producers.
The vcenter-connector by OpenFaaS is an event connector built to consume events from VMware's vCenter product.
With this project your functions can subscribe to events generated by the changes in your vCenter installation - for instance a VM being created, turned on or deleted. By using the connector you can extend the behaviours and functionality of vCenter and create custom workflows for your platform.
You can trigger OpenFaaS functions using webhooks sent via the (if this, then that) service.
An example may be triggering a function which forwards Tweets about your brand or project to a given Slack channel. For this combination use the "Twitter search" Applet and have it trigger the "Make a web request" Applet giving the public URL of your OpenFaaS gateway and the receiver function such as https://gw.my-company.com/function/slack-forwarder
See an example of a function built to forward Tweets from IFTTTT to Slack using Golang: filter-tweets.