# Triggers

A trigger is an external event that initiates a task, or sequence of tasks, in an integration.
You can think of a trigger as an entry point to your integration and the event tied to the trigger causes the
tasks associated with the trigger to run.

You can add multiple triggers to your integration. However, when an event occurs, only the trigger
associated with the event begins executing its tasks. For more information, see [Adding multiple triggers in an integration](https://docs.cloud.google.com/application-integration/docs/triggers#multi-trigger).

For the list of all the available out-of-the-box triggers, see [All triggers](https://docs.cloud.google.com/application-integration/docs/all-triggers-tasks).

## Connector Event triggers


Connector Event triggers are specialized triggers that let you invoke an integration based on the [event subscription](https://docs.cloud.google.com/integration-connectors/docs/eventsubscription) created in various business applications using [Integration Connectors](https://docs.cloud.google.com/integration-connectors/docs).

For the list of all the available Connector Event triggers, see [Connector Event triggers](https://docs.cloud.google.com/application-integration/docs/all-triggers-tasks#event_triggers). For more information about event subscriptions in Integration Connectors, see [Event subscriptions](https://docs.cloud.google.com/integration-connectors/docs/eventsubscription).

## Adding multiple triggers in an integration

You can add one or more triggers in an integration where each trigger is associated with a different task. The integration starts from the trigger for which the event occurs. For example, consider your integration has two triggers where `Trigger-1` is associated with `Task-1`, and `Trigger-2` is associated with a downstream task `Task-5`. Now suppose an event triggers `Trigger-2`, the integration runs from `Task-5` onwards.


If multiple triggers run at the same time, each trigger runs its copy of the integration. In the
preceding example, if both `Trigger-1` and `Trigger-2` run simultaneously,
`Trigger-1` runs the integration from `Task-1` onwards, and `Trigger-2`
runs a separate copy of the integration from `Task-5` onwards. There is no overlap between the execution flows of the two integrations.

## Execution modes

Based on the trigger, your integration is executed in either synchronous or asynchronous mode:

- **Synchronous executions:** In synchronous mode, the execution result of the integration is available soon after the integration runs. Synchronous mode is helpful in scenarios where you want the execution result immediately after the integration runs. Triggers execute the integration in the synchronous mode include the following:
  - [Test or publish an integration](https://docs.cloud.google.com/application-integration/docs/test-publish-integrations)
  - Call the [`projects.locations.integrations.execute`](https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.integrations/execute) API
  - Call the integration from a [sub-integration in the synchronous mode](https://docs.cloud.google.com/application-integration/docs/configure-call-integration-task)
- **Asynchronous executions:** Asynchronous executions use the fire and forget model. Asynchronous mode is helpful in scenarios where integrations can take a long time to run, or the execution result is not required immediately after the integration runs. Triggers that execute the integration in the asynchronous mode include the following:
  - All execution that are not synchronous are executed in asynchronous mode. Some of the common asynchronous mode includes, but is not limited to:
    - [Schedule trigger](https://docs.cloud.google.com/application-integration/docs/configure-schedule-trigger)
    - [Cloud Scheduler trigger](https://docs.cloud.google.com/application-integration/docs/configure-cloud-scheduler-trigger)
    - [Cloud Pub/Sub trigger](https://docs.cloud.google.com/application-integration/docs/configure-pubsub-trigger)
    - [Salesforce trigger](https://docs.cloud.google.com/application-integration/docs/configure-salesforce-trigger)
    - Call the [`projects.locations.integrations.schedule`](https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.integrations/schedule) API
  - Executions that are resumed from a suspension or a approval task are also executed in aynchronous mode, even if the initial execution was is synchronous mode.

## Quotas and limits

For information about quotas and limits, see [Quotas and limits](https://docs.cloud.google.com/application-integration/docs/quotas).

## What's next

- Learn about [all tasks and triggers](https://docs.cloud.google.com/application-integration/docs/all-triggers-tasks).
- Learn how to [test and publish an integration](https://docs.cloud.google.com/application-integration/docs/test-publish-integrations).

- Learn about [error handling](https://docs.cloud.google.com/application-integration/docs/error-handling-strategy).
- Learn about [integration execution logs](https://docs.cloud.google.com/application-integration/docs/introduction-logs).