Component Specification
Trigger
The trigger definition is used to specify the properties of a trigger. Below is an explanation of each method that can be used in the trigger definition:
trigger(String name)- Builds newModifiableTriggerDefinitionwith the specified name. The name defines the trigger key (backend ID).description(String description)- Provides a short description of the trigger.output- Defines the output of the trigger.properties(P... properties)- Lists the properties that the trigger needs to perform its task. Properties will be shown in the Properties tab. For more information, refer to the Property.title(String title)- Sets the name of the trigger that will be displayed in the UI. Use Chicago Style.type(TriggerType type)- Sets the type of the trigger. Possible types areDYNAMIC_WEBHOOK,HYBRID,LISTENER,POLLINGandSTATIC_WEBHOOK.poll(PollFunction poll)- Required forPOLLINGtriggers. This method is called at specified intervals to check for new data.webhookEnable(WebhookEnableFunction webhookEnable)- Required forDYNAMIC_WEBHOOKtriggers. This method is called when the trigger is enabled to register the webhook with the third-party service.webhookDisable(WebhookDisableConsumer webhookDisable)- Required forDYNAMIC_WEBHOOKtriggers. This method is called when the trigger is disabled to unregister the webhook from the third-party service.webhookRequest(WebhookRequestFunction webhookRequest)- Required forDYNAMIC_WEBHOOKandSTATIC_WEBHOOKtriggers. This method is called when a webhook request is received to process the incoming data.listenerEnable(ListenerEnableConsumer listenerEnable)- Required forLISTENERtriggers. This method is called when the trigger is enabled to start listening for events.listenerDisable(ListenerDisableConsumer listenerDisable)- Required forLISTENERtriggers. This method is called when the trigger is disabled to stop listening for events.webhookValidate(WebhookValidateFunction webhookValidate)- Optional for webhook triggers. Used to validate the incoming webhook request (e.g., checking signatures).
Trigger Type
- DYNAMIC_WEBHOOK: A trigger that listens for incoming HTTP requests at a dynamically generated URL.
- HYBRID: Combines features of both polling and webhook triggers. It can listen for events via webhooks and also poll for updates, providing flexibility in handling different event sources.
- LISTENER: A trigger that continuously listens for specific events or messages from a source, such as a message queue or event stream, and activates when those events occur.
- POLLING: Regularly checks a data source at specified intervals to detect changes or new data. This type is suitable for systems that do not support webhooks or real-time notifications.
- STATIC_WEBHOOK: A trigger that listens for incoming HTTP requests at a fixed URL. This type is ideal for scenarios where the endpoint URL does not change and can be predefined.
How is this guide?
Last updated on