A trigger is a step in the automation that responds to a specific event and initiates the execution of the automation scenario. It is always the first step in the automation, and there can only be one trigger in a single automation.
Triggers can be of two types: Webhook and API.
After the automation starts, the system awaits an HTTP request to a specific URL (specified in the connection) with certain data. Each trigger has its internal filter (hidden and not configurable by the user) that determines which request should activate the trigger.
For instance, if we have a New Deal trigger, the automation will only be initiated upon receiving a request to the webhook indicating that it's a New Deal event. The trigger can also make additional API requests to gather more detailed data (in which case the trigger might encounter an error).
The execution of the automation begins at the moment the request is received. If multiple webhook requests arrive simultaneously, they are executed sequentially in the order they are queued.
This trigger independently accesses the system's API on a schedule and requests a list of new or modified entities. The search typically occurs based on the Creation Date and Modification Date parameters. We usually request data from the past hour, but in some cases, this interval can be extended.
The standard schedule for the API trigger involves a request every five minutes, but this can be adjusted through the Automation Launch Schedule.
Upon activation, the trigger makes a request, indicating a date equal to the current time minus one hour (or more in some exceptions), and receives an array of data in response. Each entity is processed separately. For example, if the trigger received 5 deals in response, the automation will be initiated 5 times. The automation remembers the IDs of the received entities, and upon a repeated request, they do not trigger the automation again. If the trigger tracks changes, the modification date of the entity is also added to the ID. If a repeated request brings the same ID but a different modification date, the automation will be re-initiated for that entity.
If there are no new data, the log will have an entry No new data. The trigger can also encounter an error in case of connection issues or problems connecting to an external server, in which case the system will return the error text.