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’smanifest.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.- Create a Workflow with a scheduled (timer) trigger set to the time you want the collection to sync — for example, once a day.
- Add the collection’s ID as a Workflow variable so the same function works for any collection.
- Create a custom Code Engine package containing a function like the one below. It uses
codeengine.sendRequestto 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.- Call the function from the Workflow, mapping your collection-ID variable to the function’s
collectionIdparameter. The function returnssuccess(Boolean) andmessage(Text): branch onsuccessto react to a failed sync — for example, send a notification — and surfacemessagefor 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, unlessmessagereports that sync itself couldn’t be disabled, which needs manual follow-up.