# Setup Internal Tasks

[Internal Tasks](https://docs.othentic.xyz/main/learn/advanced-concepts/internal-tasks) are consensus-based modules for ongoing maintenance of the AVS network.

This guide will walk you through configuring and running the following Internal Tasks:

1. [Voting Power Sync](https://docs.othentic.xyz/main/learn/advanced-concepts/internal-tasks#id-1.-sync-voting-power)
2. [Voting Power Sync Per Task Definition](https://docs.othentic.xyz/main/learn/advanced-concepts/internal-tasks#id-2.-voting-power-sync-per-task-definition)

## Prerequisites

* [Othentic CLI installed](https://docs.othentic.xyz/main/welcome/getting-started/install-othentic-cli)

{% stepper %}
{% step %}

#### Start the Aggregator Node with Internal Tasks Enabled

Run the Aggregator node using the `--internal-tasks` flag:

```bash
otnode run aggregator --internal-tasks
```

{% endstep %}

{% step %}

#### Configure Internal Task Frequency

Set the `INTERNAL_TASKS` environment variable with a JSON array that defines the execution interval for each internal task.

**Example Configuration:**

```bash
INTERNAL_TASKS='[
  { "name": "VOTING_POWER_SYNC", "interval": 3600000 },
  { "name": "VOTING_POWER_PER_TASK_DEFINITION_SYNC", "interval": 3900000 }
]'
```

* **Default interval**: `3600000` ms (1 hour)
* **Minimum allowed interval**: `60000` ms (1 minute)
  {% endstep %}

{% step %}

#### Monitor Internal Task Execution

To verify that internal tasks are running successfully:

* Check  `submitTask` transactions on the **Attestation Center** contract.
* Look for the following **Task Definition IDs**:
  * `10001` – `VOTING_POWER_SYNC`
  * `10002` – `VOTING_POWER_PER_TASK_DEFINITION_SYNC`
    {% endstep %}

{% step %}

#### Setup [Restricted Operator Set](https://docs.othentic.xyz/main/learn/core-concepts/tasks/task-definitions#restricted-operator-set)

Enforce successful Internal Tasks execution by specifying a set of trusted Operators.

Set this using:

```bash
otcli network set-restricted-attesters
```

Run above for all the Internal tasks.
{% endstep %}
{% endstepper %}
