Triggers
Overview
This tutorial explains three techniques for creating triggers:
Polling
: Periodically call endpoints to check for changes.Webhooks
: Listen to user events through a single URL.App Webhooks (Subscriptions)
: Use a developer app (using OAuth2) to receive all authorized user events at a single URL (Not Supported).
to create new trigger run following command,
Piece Folder Name
: This is the name associated with the folder where the trigger resides. It helps organize and categorize triggers within the piece.Trigger Display Name
: The name users see in the interface, conveying the trigger’s purpose clearly.Trigger Description
: A brief, informative text in the UI, guiding users about the trigger’s function and purpose.Trigger Technique
: Specifies the trigger type - either polling or webhook.
Trigger Structure
It’s important to note that the run
method returns an array. The reason for
this is that a single polling can contain multiple triggers, so each item in
the array will trigger the flow to run.
Context Object
The Context object contains multiple helpful pieces of information and tools that can be useful while developing.
App Webhooks (Not Supported)
Certain services, such as Slack
and Square
, only support webhooks at the developer app level.
This means that all authorized users for the app will be sent to the same endpoint. While this technique will be supported soon, for now, a workaround is to perform polling on the endpoint.