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.packages/pieces/community/gelato/src/lib/triggers
named new-flavor-created.ts
.
Inside this file, paste the following code:
Run
:The run method executes every 5 minutes, fetching data from the endpoint within a specified timestamp range or continuing until it identifies the last item ID. It then returns the new items as an array. In this example, the httpClient.sendRequest method is utilized to retrieve new flavors, which are subsequently stored in the store along with a timestamp.
packages/server/api/.env
and include “gelato” in the AP_DEV_PIECES
.
For more details, check out the Piece Development section.
Once you edit the environment variable, restart the backend. The piece will be rebuilt. After this process, you’ll need to refresh the frontend to see the changes.
To test the trigger, use the load sample data from flow builder in Activepieces. It should function as shown in the screenshot.