Triggerflow is a scalable, extensible and serverless in design platform for event-based orchestration of serverless workflows.
Triggerflow follows an Event-Condition-Action architecture with stateful triggers to aggregate, filter, process and route incoming events from a variety of event sources.
Thanks to Triggerflow's extensibility provided by its fully programmable trigger condition and action functions, combining and chaining multiple triggers, we can orchestrate different serverless workflow abstractions such as DAGs (Apache Airflow), State Machines (Amazon Step Functions), and Workflow as Code (Azure Durable Functions), or any other specialized workflow.
Triggerflow has been implemented using Open-Source Cloud Native projects like CloudEvents and KEDA or Knative. When Triggerflow is deployed using KEDA or Knative, the trigger processing service runs only when there are incoming events so that it can be scaled down to zero when it is not used, which results in a pay-per-use serverless model.
You can read more about Triggerflow architecture and features in the Triggerflow: Trigger-based Orchestration of Serverless Workflows article, presented and accepted at the ACM Distributed and Event Based Systems 2020 conference.
from triggerflow import Triggerflow
from triggerflow.functions import PythonCallable
from triggerflow.eventsources.rabbit import RabbitMQEventSource
from triggerflow.libs.cloudevents.sdk.event.v1 import Event
tf_client = Triggerflow()
rabbitmq_source = RabbitMQEventSource(amqp_url='amqp://guest:[email protected]/', queue='My-Queue')
tf_client.create_workspace(workspace_name='test', event_source=rabbitmq_source)
def my_action(context, event):
context['message'] += 'World!'
activation_event = Event().SetEventType('test.event.type').SetSubject('Test')
tf_client.add_trigger(trigger_id='MyTrigger',
event=activation_event,
action=PythonCallable(my_action),
context={'message': 'Hello '})
rabbitmq_source.publish_cloudevent(activation_event)
trg = tf_client.get_trigger('MyTrigger')
print(trg['context']['message']) # Prints 'Hello World!'