Walkthroughs
6) Signals
Signals are defined in the “signals'' array in the doflo.jsonc file. An example can be found here:https://github.com/doflo-elements/flow-element-jira/blob/main/doflo.jsonc#L95If credentials are required for the signal configuration it should also contain the “credentials” block. This will ensure the user selects a credential during element setup.
Additionally, a list of properties should be configured in the same file if they are required by the signal implementation.
Webhooks
Webhooks make signals work and are used by third party services as event triggers to the doFlo platform.Dynamic configuration
Webhooks are usually configured by the element (if their API supports it) and are part of the signal definition. This means the doFlo element is responsible for all webhook creation/deletion. First, a webhook endpoint should be defined in the doflo.jsonc file. This will allow us to create a webhook handler. An example of the endpoint definition can be found here: https://github.com/doflo-elements/flow-element-jira/blob/main/doflo.jsonc#L13Implementation of the webhook handler:https://github.com/doflo-elements/flow-element-slack/blob/main/remote/src/connect/static.tsDefining a dynamic signal:https://github.com/doflo-elements/flow-element-jira/blob/main/doflo.jsonc#L291The implementation of a dynamic webhook handles all creation and deletion of webhooks on the third party service. An example of this can be found here:https://github.com/doflo-elements/flow-element-jira/blob/main/remote/src/JiraSignal.ts#L19Static configuration
If a third party service does not support dynamic webhook creation (through their API) it is still possible to use static signals. This means the end user has to manually set up the webhook configuration in the third party service and point it to a static webhook endpoint on the doFlo platform. An example of this is Slack.An example of defining a static webhook endpoint in the doflo.jsonc file:https://github.com/doflo-elements/flow-element-slack/blob/main/doflo.jsonc#L40Implementation of the webhook handler:https://github.com/doflo-elements/flow-element-slack/blob/main/remote/src/connect/static.tsDefining a static signal:https://github.com/doflo-elements/flow-element-slack/blob/main/doflo.jsonc#L96Implementation of a static signal:https://github.com/doflo-elements/flow-element-slack/blob/main/remote/src/SlackSignal.ts#L104