Notifiers
Notifiers allow you to create a named list of notification targets, linking message and input steps to integrations. Like integration, notifier blocks are installation-level configuration items, defined in .fpc files (typically, in ~/.flowpipe/config/flowpipe.fpc).
Each notifier contains a list of integrations and related settings used to send and receive data to one or more integrations when an input step executes.
You can have many named notifier instances that use the same integration but override specific values, to route input requests to different people or channels:
Arguments
Argument | Type | Optional? | Description |
---|---|---|---|
notify | Block | Required | one of more notify blocks to send the request to. |
Notify Block
Arguments
Argument | Type | Optional? | Description |
---|---|---|---|
integration | Integration Reference | Required | The integration to send the request to. |
cc | List<String> | Optional | The email addresses to send to. This only applies to email integrations. |
bcc | List<String> | Optional | The email addresses to send to. This only applies to email integrations. |
channel | String | Optional | The channel to send the request to. This only applies to slack integrations. |
description | String | Optional | A description of the notifier. |
subject | String | Optional | The email subject. This only applies to email integrations. |
title | String | Optional | Display title for the notifier. |
to | List<String> | Optional | The email addresses to send to. This only applies to email integrations. |
Overriding arguments
There are some settings, such as channel, to, cc, bcc, and subject that can be set in integration, the notifier, or the input or message step:
- The argument passed to the step has the highest priority
- The argument passed to the integration has the lowest priority.
This allows you to set default message routing parameters in the integration but override them in the notifier and step. Consider the following example:
When the change_request pipeline is run, the input will send the approval email to admins@bluthenterprises.com and will CC michael@bluthenterprises.com.
Default Notifier
By default, Flowpipe will include a default notifier group that only includes the HTTP integration and thus works out of the box. It is equivalent to:
Note that you can override the default notifier by creating a notifier named default. This allows you to route messages and inputs to Slack, email, etc by default.
Using Notifiers in Mods
Notifiers are defined in config files (not mod files), but Flowpipe makes them available to mods using the notifier variable. This special variable is a map of all notifiers by name, so you can reference them with standard HCL syntax: notifier.name or notifier[name].
You can reference them directly in a mod:
Generally, Mods that use input and message steps should allow passing a notifier name as a parameter, but default to the default notifier:
This approach allows the mod to work the box, but also allows users of your mod to specify a notifier specific to them if they desire: