> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hightouch.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Trigger syncs with Prefect

> Learn how to trigger syncs with Prefect's Hightouch Tasks.

## Overview

Prefect provides native **tasks** to interact with Hightouch. Check out the [Git repository](https://github.com/PrefectHQ/prefect-hightouch) for examples and [Prefect's API reference](https://docs-v1.prefect.io/api/latest/tasks/hightouch.html#hightouchrunsync) for usage details.

## Setup

To use Prefect's tasks you need:

* A Hightouch API key
* The sync IDs of the syncs you want to trigger using Prefect

### Create an API key

The first step is to create a Hightouch API key in your Hightouch workspace settings.

1. From the [**API keys** tab](https://app.hightouch.com/settings/api-keys?from=docs) on the **Settings** page, click **Add API key**.
2. Enter a descriptive **Name** for your key.
3. Under **User group**, select the group whose permissions the key should have in this workspace, or select **All of the creator's groups** to give the key the same permissions as you.
4. Copy your **API key** and store it in a safe location. The key is only displayed once.
5. Click **Create API key**.

> [!WARNING]
>
> Your API key provides read/write access to sensitive Hightouch resources and should be kept secure. If you believe your API key may have been compromised, [revoke it](https://docs.hightouch.com/developer-tools/api-guide.md#revoke-an-api-key) immediately.

### Set sync schedule type

For the Prefect extension to trigger syncs via the Hightouch API, you must set the syncs' [schedules](https://docs.hightouch.com/syncs/schedule-sync-ui.md) to **Manual**.

You can do this by going to the [**Syncs** overview page](https://app.hightouch.com/syncs), selecting the particular sync you want to trigger with Prefect, and opening the **Schedule** tab. Here, make sure the **Schedule type** is set to **Manual**. You should do this for each sync you want to trigger with Prefect.

![Manual sync Hightouch UI](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/syncs/manual-schedule.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=760a7361e91e628d1a7d3ab6c7d1d7d1)

You can also find the sync ID on this page, which you need for scheduling syncs in the next step.

![A sync ID in the Hightouch UI](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/syncs/sync-id.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=e20f6ca1ba141dee298ec3010739eb83)

## Usage

Refer to Prefect's [Hightouch Git repository](https://github.com/PrefectHQ/prefect-hightouch) for the most up-to-date examples and instructions.
