Skip to main content
This article explains how to sync an AppDB collection to its Domo DataSet on a custom schedule, using a scheduled Workflow and a Code Engine function to force a sync on demand instead of on AppDB’s fixed 15-minute cadence.
When sync is enabled, a collection syncs every 15 minutes — Domo doesn’t expose a configurable interval — and each sync consumes credits. To sync less often, schedule a Workflow that runs a Code Engine function which turns the collection’s sync on, forces one export, then turns it back off. For how AppDB collections map to DataSets, see the App DB API overview.

Prerequisites

This guide assumes you’re comfortable with Workflows and Code Engine, and that you can create both. You’ll also need the target collection’s ID — a UUID. Find it in the AppDB Admin User Interface, in your app’s manifest.json under collectionsMapping[].id, or with a List Collections call. This is the Product API’s collection ID, not the collection name used by the App Framework proxy.

Sync a collection on a schedule

Begin in Domo Workflows.
  1. Create a Workflow with a scheduled (timer) trigger set to the time you want the collection to sync — for example, once a day.
  2. Add the collection’s ID as a Workflow variable so the same function works for any collection.
  3. Create a custom Code Engine package containing a function like the one below. It uses codeengine.sendRequest to call the App DB API — reading the collection to find its datastore, enabling sync, forcing an export, then disabling sync. It always disables sync at the end (even if the export fails) and returns { success, message } so the Workflow can branch on the outcome:
Note: A collection returns 423 Locked while a sync is already running, so the function retries the export every RETRY_DELAY_SECONDS (10 seconds by default), up to MAX_SYNC_ATTEMPTS (5) times. If it’s still locked after the final attempt, the lock is likely permanent — contact your Domo account team to open a support ticket. Keep RETRY_DELAY_SECONDS × MAX_SYNC_ATTEMPTS comfortably under Code Engine’s 5-minute runtime limit.
  1. Call the function from the Workflow, mapping your collection-ID variable to the function’s collectionId parameter. The function returns success (Boolean) and message (Text): branch on success to react to a failed sync — for example, send a notification — and surface message for the reason. Because sync is turned back off even on failure, a failed run won’t leave the collection syncing on the 15-minute cadence, unless message reports that sync itself couldn’t be disabled, which needs manual follow-up.