---
title: automaticallySync
framework: cloudkit
role: symbol
role_heading: Instance Property
path: cloudkit/cksyncengine-5sie5/configuration/automaticallysync
---

# automaticallySync

A Boolean value that determines whether the engine syncs automatically.

## Declaration

```swift
var automaticallySync: Bool
```

## Discussion

Discussion By default, the sync engine uses the system scheduler to automatically schedule both send and fetch operations. If an operation fails due to a recoverable error, such as a network failure or when the server is enforcing request limits, the engine reschedules those operations as necessary. Unless you have a specific need, prefer to use the default behavior in your app. If you set this property’s value to false, use fetchChanges(_:) and sendChanges(_:) to invoke immediate sync operations, allowing for more control over when your app syncs its records. For example, you may want to sync at a specific time of day or deterministically simulate certain conditions in your unit tests. The default value is true.

## See Also

### Managing attributes

- [database](cloudkit/cksyncengine-5sie5/configuration/database.md)
- [subscriptionID](cloudkit/cksyncengine-5sie5/configuration/subscriptionid.md)
- [stateSerialization](cloudkit/cksyncengine-5sie5/configuration/stateserialization.md)
