DynamicTrigger
DynamicTrigger: Overview
DynamicTrigger
allows you to define a trigger that can be configured dynamically at runtime.
These are the docs for Trigger.dev v2 which will be deprecated on January 31st, 2025. You probably want the v3 docs.
Sometimes you want to subscribe to a webhook but you don’t know the exact configuration until runtime.
Constructor
DynamicTrigger()
Creates a new DynamicTrigger
instance. You should use the TriggerClient.defineDynamicTrigger
method instead of calling this directly.
Instance methods
register()
Use this method to register a new schedule with the DynamicTrigger.
unregister()
Use this method to unregister a schedule from the DynamicTrigger, using the id you used when registering it.
Example use cases:
Subscribe to new GitHub issues for all your repos
- Create a
DynamicTrigger
with the onIssueOpened event. - Loop through all of your repos add them to it.
- Use an onNewRepository trigger and add them to the
DynamicTrigger
.