> ## Documentation Index
> Fetch the complete documentation index at: https://domoinc-openapi-sync-dataflows.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync AppDB Only Once a Day

Since Domo doesn't currently allow you to specify sync intervals, AppDB can **only** be set to either 1) not sync at all or 2) sync every 15 minutes. If you would like to **conserve credits** on syncs, you can create a Workflow to **sync on your schedule**.

This guide leverages Workflows and Code Engine. Please make sure you are familiar with Workflows and Code Engine first.

<Note>
  **Links to documentation**

  * [Workflow Documentation](/s/article/000005108?language=en_US)
  * [Code Engine Documentation](/s/article/000005173?language=en_US)
</Note>

1. [Create a Workflow](/s/article/000005331?language=en_US) that runs at the time you want to sync the collection
2. Specify which collection you want to sync
   * You can [specify it as a variable](/s/article/000005331?language=en_US#add_a_variable) in the Workflow
3. [Create a Code Engine function](/s/article/000005173?language=en_US#create_custom_package) to execute a sync, which could be written like this:

```js theme={"dark"}
const codeengine = require('codeengine');

async function syncCollection(collectionId) {
  // gets the collection
  const collection = await codeengine.sendRequest(
    'get',
    `/api/datastores/v1/collections/${collectionId}`,
  );

  // enables collection sync
  const putBody = { id: collectionId, syncEnabled: true };
  await codeengine.sendRequest(
    'put',
    `/api/datastores/v1/collections/${collectionId}`,
    JSON.stringify(putBody),
  );

  // forces collection sync
  await codeengine.sendRequest(
    'post',
    `/api/datastores/v1/export/${collection.datastoreId}`,
    '',
  );

  // turns off collection sync
  await codeengine.sendRequest(
    'put',
    `/api/datastores/v1/collections/${collectionId}`,
    JSON.stringify({ ...putBody, syncEnabled: false }),
  );
}
```

4. Call the new Code Engine function in the Workflow with the collection id
