Get Involved
Edit on GitHub

Triggers

Triggers are used to execute a pipeline when an event occurs. They are defined in the mod and are based on a schedule, webhook or other event.

Triggers are only instantiated when Flowpipe is running in server mode - you must start the server with flowpipe server for triggers to run.

Only triggers defined in the top-level mod are created, not dependencies.

You can use a schedule trigger to run a pipeline at regular intervals:

trigger "schedule" "daily_3pm" {
pipeline = pipeline.learn_flowpipe
schedule = "* 15 * * *"
}

An http trigger allows you to run a pipeline whenever someone posts to a webhook. You can pass the request body or headers to the pipeline.

trigger "http" "my_webhook" {
pipeline = pipeline.learn_flowpipe
args = {
event = self.request_body
}
}

Flowpipe will create a webhook endpoint for each http trigger.

You can run flowpipe trigger show to get the URL:

flowpipe trigger show http.my_webhook --host local
Name: http.my_webhook
Type: http
URL: http://localhost:7103/api/latest/hook/local.trigger.http.my_webhook/ce13a948872f14f116051310d3151a2cca09b5b9e6d0b82cb32253a423078d80
Pipeline:
Post: learn_flowpipe