# Timer task

The **Timer** task lets you add a time delay to the
integration execution flow.

During an integration execution, when the control reaches the Timer task, execution is paused for the specified time limit, and all tasks after the Timer task are suspended. This task supports only automatic resumption of an integration. The integration execution automatically resumes after the expiry of the suspension time limit. For example, if you set the timer task to 180 seconds, the execution is paused for 3 minutes before resuming automatically.
**Note:** If you set the timer task to less than 60 seconds, the suspend state will be consistent as synchronous execution mode. Otherwise, the suspend state is consistent with the asynchronous execution mode.

## Compare Approval task, Suspend task, and Timer task

All the three ([Approval](https://docs.cloud.google.com/application-integration/docs/approval-task),
[Suspend](https://docs.cloud.google.com/application-integration/docs/run-suspend-task),
and [Timer](https://docs.cloud.google.com/application-integration/docs/run-timer-task)) tasks perform a similar
function of pausing and resuming an integration. However, there are subtle differences
among them. The following table describes the differences amongst the three tasks.

| Approval task | Suspend task | Timer task |
|---|---|---|
| Resumes when a user approves or rejects the request in the Integrations UI or by using the API. | Supports both manual and automatic resumption of an integration. If there is no manual intervention to revoke the suspension, the integration will automatically resume execution after the expiry of the suspension time limit. | Supports only automatic resumption of an integration. The integration execution automatically resumes after the exipry of the suspension time limit. |
| Can resume an integration from the Integrations UI or by calling the [`suspensions.resolve`](https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.integrations.executions.suspensions/resolve.md.txt) method. See [Approve or reject using the API](https://docs.cloud.google.com/application-integration/docs/configure-approval-task.md.txt#approve-reject-api). | Can resume an integration by calling the [`suspensions.lift`](https://docs.cloud.google.com/application-integration/docs/reference/rest/v1/projects.locations.integrations.executions.suspensions/lift.md.txt) method. | Supports only automatic resumption of an integration. |
| Users receive notification when an integration pauses (suspended). | Users don't receive any notification when an integration pauses (suspended). | Users don't receive any notification when an integration pauses (suspended). |
| Supports a output variable (boolean), which allows you to perform conditional checks before resuming an integration. However, the output variable can only have the value as either `true` or `false`. | Supports a output variable (string), which allows you to perform conditional checks before resuming an integration. You can set any value to the output variable. | Doesn't support any output variables. |

## Configure the Timer task

To configure the **Timer** task:

1. In the Google Cloud console, go to the **Application Integration** page.

   [Go to Application Integration](https://console.cloud.google.com/integrations)
2. In the navigation menu, click **Integrations** .


   The **Integrations** page appears listing all the integrations available in the Google Cloud project.
3. Select an existing integration or click **Create integration** to create a new one.


   If you are creating a new integration:
   1. Enter a name and description in the **Create Integration** pane.
   2. Select a region for the integration.

      > [!NOTE]
      > **Note:** The **Regions** dropdown only lists the regions provisioned in your Google Cloud project. To provision a new region, click **Enable Region** . See [Enable new region](https://docs.cloud.google.com/application-integration/docs/enable-new-region.md.txt) for more information.

   3. Select a service account for the integration. You can change or update the service account details of an integration any time from the **Integration summary** pane in the integration toolbar.

      > [!NOTE]
      > **Note:** The option to select a service account is displayed only if you have enabled integration governance for the selected region.

   4. Click **Create** . The newly created integration opens in the *integration editor*.


4. In the *integration editor* navigation bar, click **Tasks** to view the list of available tasks and connectors.
5. Click and place the **Timer** task element in the integration editor.
6. Click the **Timer** task element on the designer to view the **Timer** task configuration pane.
7. Configure the remaining fields using the [Configuration properties](https://docs.cloud.google.com/application-integration/docs/configure-timer-task.md.txt#params) for the task. For example, if you set **Timeout after** to `180` and **Time unit** to `Seconds`, the execution is paused for 3 minutes before resuming automatically.
8. Changes to the properties are saved automatically.

## Configuration properties


The following table describes the configuration properties of the Timer task.

|---|---|---|
| **Property** | **Data type** | **Description** |
| `Timeout after` | Integer | Time till which the integration execution must be paused. Integration automatically resumes the execution of the next downstream task after the expiry of the time limit. **Default value:**120 seconds (2 minutes). **Maximum time limit allowed:**44640 minutes (31 days). |
| `Time unit` | Seconds, Minutes, Hours, Days | Time unit for the **Timeout after** property. |

## Error handling strategy


An error handling strategy for a task specifies the action to take if the task fails due to a [temporary error](https://docs.cloud.google.com/application-integration/docs/error-handling.md.txt). For information about how to use an error handling strategy, and to know about the different types of error handling strategies, see [Error handling strategies](https://docs.cloud.google.com/application-integration/docs/error-handling-strategy.md.txt).

## Quotas and limits

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

## What's next

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

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