Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(data-warehouse): floor schema sync frequency at 5 minutes (#74915)

Daniel RC76655e300bd5
diff --git a/products/data_warehouse/backend/management/commands/migrate_sub_5min_sync_frequencies.py b/products/data_warehouse/backend/management/commands/migrate_sub_5min_sync_frequencies.py
new file mode 100644
index 000000000000..2214c13fdbb0
--- /dev/null
+++ b/products/data_warehouse/backend/management/commands/migrate_sub_5min_sync_frequencies.py
@@ -0,0 +1,134 @@
+import logging
+from datetime import timedelta
+from typing import Any
+
+from django.conf import settings
+from django.core.management.base import BaseCommand, CommandParser
+
+import structlog
+
+from products.data_warehouse.backend.logic.data_load.service import (
+ bulk_update_external_data_job_schedules,
+ sync_cdc_extraction_schedule,
+)
+from products.warehouse_sources.backend.facade.models import ExternalDataSchema
+
+logger = structlog.get_logger(__name__)
+
+SYNC_FREQUENCY_FLOOR = timedelta(minutes=5)
+
+
+class Command(BaseCommand):
+ help = (
+ "Bump every external data schema syncing faster than the 5-minute floor to 5 minutes, "
+ "then re-issue the affected Temporal schedules (per-schema sync schedules and, for CDC "
+ "sources, the extraction schedule)"
+ )
+
+ def add_arguments(self, parser: CommandParser) -> None:
+ parser.add_argument(
+ "--dry-run",
+ action="store_true",
+ help="Report the schemas that would be updated without changing anything",
+ )
+
+ def handle(self, **options: Any) -> None:
+ logger.setLevel(logging.INFO)
+ dry_run: bool = options["dry_run"]
+
+ # Soft-deleted rows are bumped too so no row anywhere keeps a sub-floor interval, but
+ # their schedules are already gone and must not be re-issued.
+ schemas = list(
+ ExternalDataSchema.objects.filter(sync_frequency_interval__lt=SYNC_FREQUENCY_FLOOR).select_related("source")
+ )
+
+ if not schemas:
+ logger.info("No schemas below the 5-minute floor — nothing to do")
+ return
+
+ live_schemas = [schema for schema in schemas if not schema.deleted]
+ cdc_sources = {
+ schema.source.id: schema.source
+ for schema in live_schemas
+ if schema.sync_type == ExternalDataSchema.SyncType.CDC
+ }
+
+ for schema in schemas:
+ logger.info(
+ "Schema below the 5-minute floor",
+ schema_id=str(schema.id),
+ team_id=schema.team_id,
+ name=schema.name,
+ source_id=str(schema.source_id),
+ sync_type=schema.sync_type,
+ sync_frequency_interval=str(schema.sync_frequency_interval),
+ deleted=schema.deleted,
+ )
+
+ if dry_run:
+ logger.info(
+ "Dry run — no changes made",
+ total=len(schemas),
+ schedules_to_update=len(live_schemas),
+ cdc_extraction_schedules_to_update=len(cdc_sources),
+ )
+ return
+
+ if not settings.TEST:
+ confirm = input(
+ f"\n\tWill set {len(schemas)} schemas to a 5-minute interval and re-issue "
+ f"{len(live_schemas)} sync schedules. Proceed? (y/n) "
+ )
+ if confirm.strip().lower() != "y":
+ logger.info("Aborting")
+ return
+
+ # Set the floor in memory first so the re-issued schedules pick it up, but persist the
+ # database interval only after the schedule update succeeds. Persisting first would make a
+ # failed schedule update non-retryable: the row would report 5 minutes (no longer matching
+ # the sub-floor query) while Temporal kept running at the old cadence, and a rerun would
+ # skip it. Skipped schemas (never activated, no schedule) and soft-deleted schemas (schedule
+ # already gone) have nothing to drift, so they are persisted regardless.
+ for schema in schemas:
+ schema.sync_frequency_interval = SYNC_FREQUENCY_FLOOR
+
+ skipped, failures = bulk_update_external_data_job_schedules(live_schemas)
+ failed_ids = {schema_id for schema_id, _ in failures}
+
+ persisted = 0
+ for schema in schemas:
+ if str(schema.id) in failed_ids:
+ continue
+ # An ops-driven migration, not a user edit — keep it out of the activity feed.
+ schema.save(update_fields=["sync_frequency_interval", "updated_at"], skip_activity_log=True)
+ persisted += 1
+
+ for schema_id, exc in failures:
+ logger.exception(
+ "Error updating external data schema schedule", external_data_schema_id=schema_id, exc_info=exc
+ )
+
+ # The CDC extraction schedule's interval is derived (from the database) from the source's
+ # fastest CDC schema, so it must be re-derived now that the persisted schemas were slowed
+ # down. A schema whose schedule update failed keeps its sub-floor interval, so the derived
+ # extraction interval stays consistent with what Temporal is actually running.
+ extraction_failures = 0
+ for source in cdc_sources.values():
+ try:
+ sync_cdc_extraction_schedule(source)
+ except Exception as exc:
+ extraction_failures += 1
+ logger.exception(
+ "Error updating CDC extraction schedule", external_data_source_id=str(source.id), exc_info=exc
+ )
+
+ logger.info(
+ "Done!",
+ updated=persisted,
+ not_persisted_after_schedule_failure=len(failures),
+ schedules_updated=len(live_schemas) - len(skipped) - len(failures),
+ schedules_skipped=len(skipped),
+ schedules_failed=len(failures),
+ cdc_extraction_schedules_updated=len(cdc_sources) - extraction_failures,
+ cdc_extraction_schedules_failed=extraction_failures,
+ )
diff --git a/products/data_warehouse/backend/management/test/test_migrate_sub_5min_sync_frequencies.py b/products/data_warehouse/backend/management/test/test_migrate_sub_5min_sync_frequencies.py
new file mode 100644
index 000000000000..30a3cd3d8a76
--- /dev/null
+++ b/products/data_warehouse/backend/management/test/test_migrate_sub_5min_sync_frequencies.py
@@ -0,0 +1,109 @@
+from datetime import timedelta
+
+import pytest
+from unittest import mock
+
+from django.core.management import call_command
+
+from posthog.api.test.test_organization import create_organization
+from posthog.api.test.test_team import create_team
+
+from products.warehouse_sources.backend.facade.models import ExternalDataSchema, ExternalDataSource
+
+pytestmark = [pytest.mark.django_db]
+
+COMMAND = "products.data_warehouse.backend.management.commands.migrate_sub_5min_sync_frequencies"
+
+
+def team():
+ return create_team(organization=create_organization("test org"))
+
+
+def _create_schema(source, name, interval, sync_type=ExternalDataSchema.SyncType.CDC, deleted=False):
+ return ExternalDataSchema.objects.create(
+ name=name,
+ team=source.team,
+ source=source,
+ should_sync=True,
+ sync_type=sync_type,
+ sync_frequency_interval=interval,
+ deleted=deleted,
+ )
+
+
+def test_bumps_sub_floor_schemas_and_resyncs_schedules(team):
+ cdc_source = ExternalDataSource.objects.create(team=team, source_type="Postgres", job_inputs={})
+ other_source = ExternalDataSource.objects.create(team=team, source_type="Stripe", job_inputs={})
+ deleted_source = ExternalDataSource.objects.create(team=team, source_type="Postgres", job_inputs={})
+
+ cdc_fast_1 = _create_schema(cdc_source, "public.orders", timedelta(minutes=1))
+ cdc_fast_2 = _create_schema(cdc_source, "public.users", timedelta(minutes=1))
+ non_cdc_fast = _create_schema(
+ other_source, "invoices", timedelta(minutes=1), sync_type=ExternalDataSchema.SyncType.FULL_REFRESH
+ )
+ at_floor = _create_schema(
+ other_source, "charges", timedelta(minutes=5), sync_type=ExternalDataSchema.SyncType.INCREMENTAL
+ )
+ slow = _create_schema(
+ other_source, "customers", timedelta(hours=6), sync_type=ExternalDataSchema.SyncType.INCREMENTAL
+ )
+ deleted_fast = _create_schema(deleted_source, "public.legacy", timedelta(minutes=1), deleted=True)
+
+ with (
+ mock.patch(f"{COMMAND}.bulk_update_external_data_job_schedules", return_value=([], [])) as mock_bulk,
+ mock.patch(f"{COMMAND}.sync_cdc_extraction_schedule") as mock_extraction,
+ ):
+ call_command("migrate_sub_5min_sync_frequencies")
+
+ for schema in (cdc_fast_1, cdc_fast_2, non_cdc_fast, deleted_fast):
+ schema.refresh_from_db()
+ assert schema.sync_frequency_interval == timedelta(minutes=5)
+ at_floor.refresh_from_db()
+ assert at_floor.sync_frequency_interval == timedelta(minutes=5)
+ slow.refresh_from_db()
+ assert slow.sync_frequency_interval == timedelta(hours=6)
+
+ # Only live sub-floor schemas get their sync schedule re-issued; the deleted one's schedule is gone.
+ mock_bulk.assert_called_once()
+ resynced_ids = {schema.id for schema in mock_bulk.call_args.args[0]}
+ assert resynced_ids == {cdc_fast_1.id, cdc_fast_2.id, non_cdc_fast.id}
+
+ # The CDC extraction schedule is re-derived once per affected live CDC source.
+ assert [call.args[0].id for call in mock_extraction.call_args_list] == [cdc_source.id]
+
+
+def test_failed_schedule_update_leaves_interval_retryable(team):
+ source = ExternalDataSource.objects.create(team=team, source_type="Postgres", job_inputs={})
+ failing = _create_schema(source, "public.orders", timedelta(minutes=1))
+ succeeding = _create_schema(source, "public.users", timedelta(minutes=1))
+
+ # bulk_update reports `failing`'s schedule update as a failure; its database interval must stay
+ # sub-floor so a rerun retries it, while `succeeding` is bumped to the floor.
+ failure = (str(failing.id), RuntimeError("boom"))
+ with (
+ mock.patch(f"{COMMAND}.bulk_update_external_data_job_schedules", return_value=([], [failure])),
+ mock.patch(f"{COMMAND}.sync_cdc_extraction_schedule"),
+ ):
+ call_command("migrate_sub_5min_sync_frequencies")
+
+ failing.refresh_from_db()
+ succeeding.refresh_from_db()
+ assert failing.sync_frequency_interval == timedelta(minutes=1)
+ assert succeeding.sync_frequency_interval == timedelta(minutes=5)
+
+
+def test_dry_run_changes_nothing(team):
+ source = ExternalDataSource.objects.create(team=team, source_type="Postgres", job_inputs={})
+ schema = _create_schema(source, "public.orders", timedelta(minutes=1))
+
+ with (
+ mock.patch(f"{COMMAND}.bulk_update_external_data_job_schedules") as mock_bulk,
+ mock.patch(f"{COMMAND}.sync_cdc_extraction_schedule") as mock_extraction,
+ ):
+ call_command("migrate_sub_5min_sync_frequencies", "--dry-run")
+
+ schema.refresh_from_db()
+ assert schema.sync_frequency_interval == timedelta(minutes=1)
+ mock_bulk.assert_not_called()
+ mock_extraction.assert_not_called()
diff --git a/products/data_warehouse/frontend/scenes/SchemaScene/ConfigurationTab.tsx b/products/data_warehouse/frontend/scenes/SchemaScene/ConfigurationTab.tsx
index 7a83ae7a8e04..e0d9dba2f7d6 100644
--- a/products/data_warehouse/frontend/scenes/SchemaScene/ConfigurationTab.tsx
+++ b/products/data_warehouse/frontend/scenes/SchemaScene/ConfigurationTab.tsx
@@ -868,9 +868,10 @@ function ScheduleSection({
}): JSX.Element {
const { loadSchema } = useActions(schemaSceneLogic({ sourceId, schemaId: schema.id }))
const isCdc = schema.sync_type === 'cdc'
- const frequencyOptions: LemonSelectOption<DataWarehouseSyncInterval>[] = allowedSyncFrequencies(
- schema.sync_type
- ).map((value) => ({ value, label: SyncFrequencyLabelMap[value] }))
+ const frequencyOptions: LemonSelectOption<DataWarehouseSyncInterval>[] = allowedSyncFrequencies().map((value) => ({
+ value,
+ label: SyncFrequencyLabelMap[value],
+ }))
const [draftFrequency, setDraftFrequency] = useState<DataWarehouseSyncInterval>(
schema.sync_frequency || (isCdc ? '5min' : '6hour')
diff --git a/products/data_warehouse/frontend/scenes/SourceScene/tabs/SchemasTab.tsx b/products/data_warehouse/frontend/scenes/SourceScene/tabs/SchemasTab.tsx
index 4e1e416b92aa..1ba40e6377f8 100644
--- a/products/data_warehouse/frontend/scenes/SourceScene/tabs/SchemasTab.tsx
+++ b/products/data_warehouse/frontend/scenes/SourceScene/tabs/SchemasTab.tsx
@@ -637,10 +637,7 @@ function SchemaBulkActions({
const selected = [...schemas]
const count = selected.length
- // Only offer frequencies every selected schema supports. Non-CDC schemas floor at 5min, so a
- // mixed selection falls back to the non-CDC set (which CDC also supports).
- const allCdc = selected.length > 0 && selected.every((schema) => schema.sync_type === 'cdc')
- const frequencyOptions = allowedSyncFrequencies(allCdc ? 'cdc' : 'incremental')
+ const frequencyOptions = allowedSyncFrequencies()
const onEnable = (): void => {
const needingDefaults = selected.filter((schema) => !schema.should_sync && !schema.sync_type)
diff --git a/products/data_warehouse/frontend/scenes/SourceScene/tabs/sourceSettingsLogic.test.ts b/products/data_warehouse/frontend/scenes/SourceScene/tabs/sourceSettingsLogic.test.ts
index ebcbd7cd2bcc..bf67dc92b623 100644
--- a/products/data_warehouse/frontend/scenes/SourceScene/tabs/sourceSettingsLogic.test.ts
+++ b/products/data_warehouse/frontend/scenes/SourceScene/tabs/sourceSettingsLogic.test.ts
@@ -1,10 +1,11 @@
import type { SourceFieldConfig } from '~/queries/schema/schema-general'
import type { ExternalDataSourceSchema } from '~/types'
+import { clampSyncFrequency } from 'products/data_warehouse/frontend/utils'
+
import {
buildBulkEnablePayloads,
clonePayloadPreservingFiles,
- clampFrequencyForSchema,
isSensitiveCredentialField,
removeEmptySensitiveValues,
runBulkSchemaAction,
@@ -228,18 +229,11 @@ describe('schemasEligibleForSync', () => {
})
})
-describe('clampFrequencyForSchema', () => {
- it('floors non-CDC schemas at 5 minutes', () => {
- const incremental = makeSchema({ sync_type: 'incremental' })
- expect(clampFrequencyForSchema('1min', incremental)).toBe('5min')
- expect(clampFrequencyForSchema('5min', incremental)).toBe('5min')
- expect(clampFrequencyForSchema('1hour', incremental)).toBe('1hour')
- })
-
- it('lets CDC schemas go down to 1 minute', () => {
- const cdc = makeSchema({ sync_type: 'cdc' })
- expect(clampFrequencyForSchema('1min', cdc)).toBe('1min')
- expect(clampFrequencyForSchema('6hour', cdc)).toBe('6hour')
+describe('clampSyncFrequency', () => {
+ it('floors every schema at 5 minutes, CDC included', () => {
+ expect(clampSyncFrequency('1min')).toBe('5min')
+ expect(clampSyncFrequency('5min')).toBe('5min')
+ expect(clampSyncFrequency('1hour')).toBe('1hour')
})
})
diff --git a/products/data_warehouse/frontend/scenes/SourceScene/tabs/sourceSettingsLogic.ts b/products/data_warehouse/frontend/scenes/SourceScene/tabs/sourceSettingsLogic.ts
index 168b9fdbe9e6..f6ffa88d36b0 100644
--- a/products/data_warehouse/frontend/scenes/SourceScene/tabs/sourceSettingsLogic.ts
+++ b/products/data_warehouse/frontend/scenes/SourceScene/tabs/sourceSettingsLogic.ts
@@ -340,13 +340,6 @@ export function buildBulkEnablePayloads(
)
}
-export function clampFrequencyForSchema(
- requested: DataWarehouseSyncInterval,
- schema: ExternalDataSourceSchema
-): DataWarehouseSyncInterval {
- return clampSyncFrequency(requested, schema.sync_type)
-}
-
function reportBulkResult(verb: string, total: number, failed: number, skipped: number, skipReason = ''): void {
const succeeded = total - failed
const parts = [`${verb} ${pluralize(succeeded, 'schema', 'schemas')}`]
@@ -1532,11 +1525,11 @@ export const sourceSettingsLogic = kea<sourceSettingsLogicType>([
lemonToast.success(`Disabled ${pluralize(schemas.length, 'schema', 'schemas')}`)
},
bulkSetFrequency: ({ schemas, frequency }) => {
- // Non-CDC schemas can't sync faster than every 5 minutes — clamp so a bulk edit
- // never pushes them below their allowed floor.
+ // Schemas can't sync faster than every 5 minutes — clamp so a bulk edit never
+ // pushes them below the floor.
let clamped = 0
schemas.forEach((schema) => {
- const effective = clampFrequencyForSchema(frequency, schema)
+ const effective = clampSyncFrequency(frequency)
if (effective !== frequency) {
clamped++
}
diff --git a/products/data_warehouse/frontend/utils.ts b/products/data_warehouse/frontend/utils.ts
index 600795f09159..9614e00c468a 100644
--- a/products/data_warehouse/frontend/utils.ts
+++ b/products/data_warehouse/frontend/utils.ts
@@ -184,25 +184,19 @@ export const SyncFrequencyLabelMap: Record<DataWarehouseSyncInterval, string> =
// Sync frequencies ordered shortest→longest. Object key order above is the single source of truth.
export const SYNC_FREQUENCY_ORDER = Object.keys(SyncFrequencyLabelMap) as DataWarehouseSyncInterval[]
-// Sub-5-minute cadence is CDC-only; every other sync type floors at 5 minutes. This is the one
-// place that rule lives — the schedule picker, bulk edits, and the clamp all derive from it.
-export const CDC_ONLY_SYNC_FREQUENCIES: DataWarehouseSyncInterval[] = ['1min']
-
-// Frequencies a given sync type is allowed to use. (The backend enforces the same rule in
-// ExternalDataSchemaSerializer — keep them in sync if this changes.)
-export function allowedSyncFrequencies(syncType: string | null | undefined): DataWarehouseSyncInterval[] {
- if (syncType === 'cdc') {
- return SYNC_FREQUENCY_ORDER
- }
- return SYNC_FREQUENCY_ORDER.filter((frequency) => !CDC_ONLY_SYNC_FREQUENCIES.includes(frequency))
+// Every sync type floors at 5 minutes. Rows written before the floor may still carry '1min'
+// (the label maps above keep rendering it), but it is never offered or accepted again. This is
+// the one place the floor lives — the schedule picker, bulk edits, and the clamp all derive
+// from it. (The backend enforces the same rule in ExternalDataSchemaSerializer.)
+const LEGACY_SUB_FLOOR_SYNC_FREQUENCIES: DataWarehouseSyncInterval[] = ['1min']
+
+export function allowedSyncFrequencies(): DataWarehouseSyncInterval[] {
+ return SYNC_FREQUENCY_ORDER.filter((frequency) => !LEGACY_SUB_FLOOR_SYNC_FREQUENCIES.includes(frequency))
}
-// Raise a requested frequency to the fastest one the sync type permits (e.g. 1min → 5min for non-CDC).
-export function clampSyncFrequency(
- requested: DataWarehouseSyncInterval,
- syncType: string | null | undefined
-): DataWarehouseSyncInterval {
- const allowed = allowedSyncFrequencies(syncType)
+// Raise a requested frequency to the fastest allowed one (e.g. a legacy 1min → 5min).
+export function clampSyncFrequency(requested: DataWarehouseSyncInterval): DataWarehouseSyncInterval {
+ const allowed = allowedSyncFrequencies()
return allowed.includes(requested) ? requested : allowed[0]
}
diff --git a/products/warehouse_sources/backend/presentation/views/external_data_schema.py b/products/warehouse_sources/backend/presentation/views/external_data_schema.py
index 805c562ffeeb..01267c64680a 100644
--- a/products/warehouse_sources/backend/presentation/views/external_data_schema.py
+++ b/products/warehouse_sources/backend/presentation/views/external_data_schema.py
@@ -154,9 +154,12 @@ def _reset_cdc_for_full_resnapshot(instance: ExternalDataSchema) -> None:
instance.save(update_fields=["status"])
-# Sync frequencies that only CDC schemas may use. Every other sync type floors at 5 minutes.
-CDC_ONLY_SYNC_FREQUENCIES = {"1min"}
-NON_CDC_FLOOR_SYNC_FREQUENCY = "5min"
+# Sync frequencies below the 5-minute floor. No longer accepted as input (dropped from the
+# serializer's choices), but rows written before the floor may still carry one until the
+# migrate_sub_5min_sync_frequencies command bumps them — so the interval mappings keep parsing
+# "1min" and the update path clamps instead of erroring.
+LEGACY_SUB_FLOOR_SYNC_FREQUENCIES = {"1min"}
+FLOOR_SYNC_FREQUENCY = "5min"
@extend_schema_field(
@@ -271,7 +274,6 @@ class ExternalDataSchemaSerializer(serializers.ModelSerializer):
sync_frequency = serializers.ChoiceField(
choices=[
("never", "never"),
- ("1min", "1min"),
("5min", "5min"),
("15min", "15min"),
("30min", "30min"),
@@ -284,7 +286,10 @@ class ExternalDataSchemaSerializer(serializers.ModelSerializer):
],
required=False,
allow_null=True,
- help_text="How often to sync.",
+ help_text="How often to sync. The fastest sync frequency is 5 minutes.",
+ error_messages={
+ "invalid_choice": '"{input}" is not a valid sync frequency. The fastest sync frequency is 5 minutes.'
+ },
)
sync_time_of_day = serializers.TimeField(
required=False, allow_null=True, help_text="UTC time of day to run the sync (HH:MM:SS)."
@@ -867,27 +872,19 @@ class ExternalDataSchemaSerializer(serializers.ModelSerializer):
was_sync_time_of_day_updated = False
source = instance.source
- # Sub-5-minute cadence is only valid for CDC. Enforce server-side so API/MCP callers (not
- # just the UI) can't drop a non-CDC schema below the allowed floor. We validate the
- # frequency the schema will actually end up with — the new value if one is supplied, else
- # the existing interval — against the sync type it will end up with. This also catches
- # switching a 1-minute CDC schema to a non-CDC type without re-sending the frequency.
+ # "1min" is rejected at the field level, but a schema whose stored interval predates the
+ # 5-minute floor keeps working until migrated. When such a schema stops being CDC (the only
+ # type that ever allowed 1min), clamp the inherited cadence to the floor so the switch
+ # doesn't dead-end. The clamp flows through the sync_frequency handling below.
resulting_sync_type = sync_type if "sync_type" in data else instance.sync_type
resulting_frequency = sync_frequency
if not resulting_frequency and instance.sync_frequency_interval is not None:
resulting_frequency = sync_frequency_interval_to_sync_frequency(instance.sync_frequency_interval)
- if resulting_frequency in CDC_ONLY_SYNC_FREQUENCIES and resulting_sync_type != ExternalDataSchema.SyncType.CDC:
- if sync_frequency:
- # The caller explicitly asked for a CDC-only cadence on a non-CDC schema — a direct
- # contradiction, so reject it.
- raise ValidationError(
- "A 1-minute sync frequency is only available for CDC schemas. "
- "The fastest frequency for other sync types is 5 minutes."
- )
- # Switching a CDC schema to a non-CDC type while it still carries a CDC-only cadence:
- # clamp to the non-CDC floor instead of dead-ending the switch. The clamp flows through
- # the sync_frequency handling below.
- sync_frequency = NON_CDC_FLOOR_SYNC_FREQUENCY
+ if (
+ resulting_frequency in LEGACY_SUB_FLOOR_SYNC_FREQUENCIES
+ and resulting_sync_type != ExternalDataSchema.SyncType.CDC
+ ):
+ sync_frequency = FLOOR_SYNC_FREQUENCY
if sync_frequency:
sync_frequency_interval = sync_frequency_to_sync_frequency_interval(sync_frequency)
diff --git a/products/warehouse_sources/backend/tests/api/test_external_data_schema.py b/products/warehouse_sources/backend/tests/api/test_external_data_schema.py
index 1305e5af626a..70a6f2edca5c 100644
--- a/products/warehouse_sources/backend/tests/api/test_external_data_schema.py
+++ b/products/warehouse_sources/backend/tests/api/test_external_data_schema.py
@@ -1147,7 +1147,7 @@ class TestExternalDataSchema(APIBaseTest):
]
)
def test_update_schema_xmin_floors_at_five_minutes(self, _name, sync_frequency, expected_status):
- # xmin does not get CDC's 1-minute cadence — it floors at the normal 5-minute incremental cadence.
+ # xmin floors at the 5-minute minimum like every other sync type.
source = self._xmin_postgres_source()
schema = ExternalDataSchema.objects.create(
name="public.orders",
@@ -1176,7 +1176,7 @@ class TestExternalDataSchema(APIBaseTest):
assert response.status_code == expected_status, response.content
if expected_status == 400:
- assert "1-minute" in str(response.json()).lower() or "cdc" in str(response.json()).lower()
+ assert "not a valid sync frequency" in str(response.json()).lower()
def test_update_schema_to_xmin_forces_full_resync(self):
# Switching to xmin from another strategy adds the `_ph_xmin` control column to the physical
@@ -1246,14 +1246,17 @@ class TestExternalDataSchema(APIBaseTest):
@parameterized.expand(
[
- ("incremental", ExternalDataSchema.SyncType.INCREMENTAL, 400),
- ("full_refresh", ExternalDataSchema.SyncType.FULL_REFRESH, 400),
- ("cdc", ExternalDataSchema.SyncType.CDC, 200),
+ ("incremental_one_minute", ExternalDataSchema.SyncType.INCREMENTAL, "1min", 400),
+ ("full_refresh_one_minute", ExternalDataSchema.SyncType.FULL_REFRESH, "1min", 400),
+ ("cdc_one_minute", ExternalDataSchema.SyncType.CDC, "1min", 400),
+ ("cdc_five_minutes", ExternalDataSchema.SyncType.CDC, "5min", 200),
]
)
- def test_update_schema_one_minute_frequency_only_for_cdc(self, _name, sync_type, expected_status):
- # A 1-minute cadence is CDC-only. The backend must enforce this regardless of caller
- # (UI, API, or MCP) so non-CDC schemas can't be pushed below the 5-minute floor.
+ def test_update_schema_sync_frequency_floors_at_five_minutes(
+ self, _name, sync_type, sync_frequency, expected_status
+ ):
+ # The 5-minute floor applies to every sync type, CDC included. The backend must enforce it
+ # regardless of caller (UI, API, or MCP).
is_cdc = sync_type == ExternalDataSchema.SyncType.CDC
source = ExternalDataSource.objects.create(
team=self.team,
@@ -1288,20 +1291,20 @@ class TestExternalDataSchema(APIBaseTest):
):
response = self.client.patch(
f"/api/environments/{self.team.pk}/external_data_schemas/{schema.id}",
- data={"sync_frequency": "1min"},
+ data={"sync_frequency": sync_frequency},
)
assert response.status_code == expected_status, response.content
if expected_status == 400:
- assert "cdc" in str(response.json()).lower()
+ assert "not a valid sync frequency" in str(response.json()).lower()
schema.refresh_from_db()
# Rejected before the interval is persisted.
assert schema.sync_frequency_interval != timedelta(minutes=1)
def test_update_schema_one_minute_clamps_on_switch_away_from_cdc(self):
- # A CDC schema on a 1-minute schedule switched to a non-CDC sync type without re-sending
- # sync_frequency would otherwise dead-end (1-minute is CDC-only). Instead of rejecting the
- # switch, clamp the inherited cadence to the non-CDC floor so the switch goes through.
+ # A schema whose stored interval predates the 5-minute floor (a legacy 1-minute CDC row)
+ # switched to a non-CDC sync type without re-sending sync_frequency must not dead-end:
+ # the inherited cadence is clamped to the floor so the switch goes through.
source = ExternalDataSource.objects.create(
team=self.team,
source_type=ExternalDataSourceType.POSTGRES,
@@ -1340,6 +1343,31 @@ class TestExternalDataSchema(APIBaseTest):
assert schema.sync_frequency_interval == timedelta(minutes=5)
assert schema.sync_type == ExternalDataSchema.SyncType.FULL_REFRESH
+ def test_stored_one_minute_interval_still_deserializes(self):
+ # Rows written before the 5-minute floor still carry a 1-minute interval until the
+ # migration command runs. Reading them must keep working, or every list/retrieve
+ # containing such a row 500s.
+ source = ExternalDataSource.objects.create(
+ team=self.team,
+ source_type=ExternalDataSourceType.POSTGRES,
+ job_inputs={"host": "h", "port": 5432, "database": "d", "user": "u", "password": "p", "schema": "public"},
+ )
+ schema = ExternalDataSchema.objects.create(
+ name="public.orders",
+ team=self.team,
+ source=source,
+ should_sync=True,
+ status=ExternalDataSchema.Status.COMPLETED,
+ sync_type=ExternalDataSchema.SyncType.CDC,
+ sync_type_config={"primary_key_columns": ["id"]},
+ sync_frequency_interval=timedelta(minutes=1),
+ )
+
+ response = self.client.get(f"/api/environments/{self.team.pk}/external_data_schemas/{schema.id}")
+
+ assert response.status_code == 200, response.content
+ assert response.json()["sync_frequency"] == "1min"
+
def test_update_schema_frequency_on_disabled_schema_does_not_touch_missing_schedule(self):
# A disabled / never-activated schema has no Temporal schedule. Changing its sync frequency
# must not try to update a schedule that doesn't exist (which raises "workflow not found");
diff --git a/products/warehouse_sources/frontend/generated/api.schemas.ts b/products/warehouse_sources/frontend/generated/api.schemas.ts
index aeedeb3f3a03..585ffd79deb6 100644
--- a/products/warehouse_sources/frontend/generated/api.schemas.ts
+++ b/products/warehouse_sources/frontend/generated/api.schemas.ts
@@ -49,7 +49,6 @@ export const IncrementalFieldTypeEnumApi = {
/**
* * `never` - never
- * * `1min` - 1min
* * `5min` - 5min
* * `15min` - 15min
* * `30min` - 30min
@@ -60,11 +59,11 @@ export const IncrementalFieldTypeEnumApi = {
* * `7day` - 7day
* * `30day` - 30day
*/
-export type SyncFrequencyEnumApi = (typeof SyncFrequencyEnumApi)[keyof typeof SyncFrequencyEnumApi]
+export type ExternalDataSchemaSyncFrequencyEnumApi =
+ (typeof ExternalDataSchemaSyncFrequencyEnumApi)[keyof typeof ExternalDataSchemaSyncFrequencyEnumApi]
-export const SyncFrequencyEnumApi = {
+export const ExternalDataSchemaSyncFrequencyEnumApi = {
Never: 'never',
- '1min': '1min',
'5min': '5min',
'15min': '15min',
'30min': '30min',
@@ -186,10 +185,9 @@ export interface ExternalDataSchemaApi {
* @nullable
*/
incremental_field_lookback_seconds?: number | null
- /** How often to sync.
+ /** How often to sync. The fastest sync frequency is 5 minutes.
*
* * `never` - never
- * * `1min` - 1min
* * `5min` - 5min
* * `15min` - 15min
* * `30min` - 30min
@@ -199,7 +197,7 @@ export interface ExternalDataSchemaApi {
* * `24hour` - 24hour
* * `7day` - 7day
* * `30day` - 30day */
- sync_frequency?: SyncFrequencyEnumApi | null
+ sync_frequency?: ExternalDataSchemaSyncFrequencyEnumApi | null
/**
* UTC time of day to run the sync (HH:MM:SS).
* @nullable
@@ -339,10 +337,9 @@ export interface PatchedExternalDataSchemaApi {
* @nullable
*/
incremental_field_lookback_seconds?: number | null
- /** How often to sync.
+ /** How often to sync. The fastest sync frequency is 5 minutes.
*
* * `never` - never
- * * `1min` - 1min
* * `5min` - 5min
* * `15min` - 15min
* * `30min` - 30min
@@ -352,7 +349,7 @@ export interface PatchedExternalDataSchemaApi {
* * `24hour` - 24hour
* * `7day` - 7day
* * `30day` - 30day */
- sync_frequency?: SyncFrequencyEnumApi | null
+ sync_frequency?: ExternalDataSchemaSyncFrequencyEnumApi | null
/**
* UTC time of day to run the sync (HH:MM:SS).
* @nullable
diff --git a/products/warehouse_sources/frontend/generated/api.zod.ts b/products/warehouse_sources/frontend/generated/api.zod.ts
index fb199167a130..56fcd608def1 100644
--- a/products/warehouse_sources/frontend/generated/api.zod.ts
+++ b/products/warehouse_sources/frontend/generated/api.zod.ts
@@ -54,27 +54,15 @@ export const ExternalDataSchemasUpdateBody = /* @__PURE__ */ zod.object({
sync_frequency: zod
.union([
zod
- .enum([
- 'never',
- '1min',
- '5min',
- '15min',
- '30min',
- '1hour',
- '6hour',
- '12hour',
- '24hour',
- '7day',
- '30day',
- ])
+ .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
.describe(
- '\* `never` - never\n\* `1min` - 1min\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
),
zod.null(),
])
.optional()
.describe(
- 'How often to sync.\n\n\* `never` - never\n\* `1min` - 1min\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
),
sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),
primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),
@@ -165,27 +153,15 @@ export const ExternalDataSchemasPartialUpdateBody = /* @__PURE__ */ zod.object({
sync_frequency: zod
.union([
zod
- .enum([
- 'never',
- '1min',
- '5min',
- '15min',
- '30min',
- '1hour',
- '6hour',
- '12hour',
- '24hour',
- '7day',
- '30day',
- ])
+ .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
.describe(
- '\* `never` - never\n\* `1min` - 1min\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
),
zod.null(),
])
.optional()
.describe(
- 'How often to sync.\n\n\* `never` - never\n\* `1min` - 1min\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
),
sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),
primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),
@@ -276,27 +252,15 @@ export const ExternalDataSchemasIncrementalFieldsCreateBody = /* @__PURE__ */ zo
sync_frequency: zod
.union([
zod
- .enum([
- 'never',
- '1min',
- '5min',
- '15min',
- '30min',
- '1hour',
- '6hour',
- '12hour',
- '24hour',
- '7day',
- '30day',
- ])
+ .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
.describe(
- '\* `never` - never\n\* `1min` - 1min\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
),
zod.null(),
])
.optional()
.describe(
- 'How often to sync.\n\n\* `never` - never\n\* `1min` - 1min\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
),
sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),
primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),
@@ -387,27 +351,15 @@ export const ExternalDataSchemasReloadCreateBody = /* @__PURE__ */ zod.object({
sync_frequency: zod
.union([
zod
- .enum([
- 'never',
- '1min',
- '5min',
- '15min',
- '30min',
- '1hour',
- '6hour',
- '12hour',
- '24hour',
- '7day',
- '30day',
- ])
+ .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
.describe(
- '\* `never` - never\n\* `1min` - 1min\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
),
zod.null(),
])
.optional()
.describe(
- 'How often to sync.\n\n\* `never` - never\n\* `1min` - 1min\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
),
sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),
primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),
@@ -498,27 +450,15 @@ export const ExternalDataSchemasResyncCreateBody = /* @__PURE__ */ zod.object({
sync_frequency: zod
.union([
zod
- .enum([
- 'never',
- '1min',
- '5min',
- '15min',
- '30min',
- '1hour',
- '6hour',
- '12hour',
- '24hour',
- '7day',
- '30day',
- ])
+ .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
.describe(
- '\* `never` - never\n\* `1min` - 1min\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
),
zod.null(),
])
.optional()
.describe(
- 'How often to sync.\n\n\* `never` - never\n\* `1min` - 1min\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
),
sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),
primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),
diff --git a/products/warehouse_sources/skills/setting-up-a-data-warehouse-source/references/sync-types.md b/products/warehouse_sources/skills/setting-up-a-data-warehouse-source/references/sync-types.md
index a10f9e1cb707..3ef41c88ea59 100644
--- a/products/warehouse_sources/skills/setting-up-a-data-warehouse-source/references/sync-types.md
+++ b/products/warehouse_sources/skills/setting-up-a-data-warehouse-source/references/sync-types.md
@@ -122,13 +122,13 @@ The `supports_webhooks` flag on each table in the db-schema response is the sour
## Sync frequency
`sync_frequency` is a per-schema option that's orthogonal to `sync_type`. Valid values are (smallest to largest):
-`"1min"`, `"5min"`, `"15min"`, `"30min"`, `"1hour"`, `"6hour"`, `"12hour"`, `"24hour"`, `"7day"`, `"30day"`, and
-`"never"`.
+`"5min"`, `"15min"`, `"30min"`, `"1hour"`, `"6hour"`, `"12hour"`, `"24hour"`, `"7day"`, `"30day"`, and
+`"never"`. `"5min"` is the floor for every sync type — the API rejects anything faster.
- For `full_refresh` on anything non-trivial: default to `24hour` — it re-imports everything each run. Sub-hour
frequencies are usually wasteful for full refresh.
-- For `incremental` / `append`: `1hour` or `6hour` is a reasonable default on reasonably sized tables. Sub-minute
- frequencies (`1min`, `5min`) exist but are rarely needed — if the user wants real-time, prefer `cdc` or `webhook`.
+- For `incremental` / `append`: `1hour` or `6hour` is a reasonable default on reasonably sized tables. The `5min`
+ floor exists but is rarely needed — if the user wants real-time, prefer `cdc` or `webhook`.
- For `cdc`: frequency doesn't really apply — CDC streams continuously.
- For cold archive tables: `7day` or `30day` keeps the schedule alive without wasting runs.
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 54ed78b7c240..6bc9a25e5388 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -28491,7 +28491,6 @@ export namespace Schemas {
/**
* * `never` - never
- * * `1min` - 1min
* * `5min` - 5min
* * `15min` - 15min
* * `30min` - 30min
@@ -28502,12 +28501,11 @@ export namespace Schemas {
* * `7day` - 7day
* * `30day` - 30day
*/
- export type SyncFrequencyEnum = typeof SyncFrequencyEnum[keyof typeof SyncFrequencyEnum];
+ export type ExternalDataSchemaSyncFrequencyEnum = typeof ExternalDataSchemaSyncFrequencyEnum[keyof typeof ExternalDataSchemaSyncFrequencyEnum];
- export const SyncFrequencyEnum = {
+ export const ExternalDataSchemaSyncFrequencyEnum = {
Never: 'never',
- '1min': '1min',
'5min': '5min',
'15min': '15min',
'30min': '30min',
@@ -28580,10 +28578,9 @@ export namespace Schemas {
* @nullable
*/
incremental_field_lookback_seconds?: number | null;
- /** How often to sync.
+ /** How often to sync. The fastest sync frequency is 5 minutes.
*
* * `never` - never
- * * `1min` - 1min
* * `5min` - 5min
* * `15min` - 15min
* * `30min` - 30min
@@ -28593,7 +28590,7 @@ export namespace Schemas {
* * `24hour` - 24hour
* * `7day` - 7day
* * `30day` - 30day */
- sync_frequency?: SyncFrequencyEnum | null;
+ sync_frequency?: ExternalDataSchemaSyncFrequencyEnum | null;
/**
* UTC time of day to run the sync (HH:MM:SS).
* @nullable
@@ -49690,10 +49687,9 @@ export namespace Schemas {
* @nullable
*/
incremental_field_lookback_seconds?: number | null;
- /** How often to sync.
+ /** How often to sync. The fastest sync frequency is 5 minutes.
*
* * `never` - never
- * * `1min` - 1min
* * `5min` - 5min
* * `15min` - 15min
* * `30min` - 30min
@@ -49703,7 +49699,7 @@ export namespace Schemas {
* * `24hour` - 24hour
* * `7day` - 7day
* * `30day` - 30day */
- sync_frequency?: SyncFrequencyEnum | null;
+ sync_frequency?: ExternalDataSchemaSyncFrequencyEnum | null;
/**
* UTC time of day to run the sync (HH:MM:SS).
* @nullable
diff --git a/services/mcp/src/generated/warehouse_sources/api.ts b/services/mcp/src/generated/warehouse_sources/api.ts
index 1dcc3b501aee..99c3322d70f2 100644
--- a/services/mcp/src/generated/warehouse_sources/api.ts
+++ b/services/mcp/src/generated/warehouse_sources/api.ts
@@ -85,27 +85,15 @@ export const ExternalDataSchemasPartialUpdateBody = /* @__PURE__ */ zod.object({
sync_frequency: zod
.union([
zod
- .enum([
- 'never',
- '1min',
- '5min',
- '15min',
- '30min',
- '1hour',
- '6hour',
- '12hour',
- '24hour',
- '7day',
- '30day',
- ])
+ .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
.describe(
- '\* `never` - never\n\* `1min` - 1min\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
),
zod.null(),
])
.optional()
.describe(
- 'How often to sync.\n\n\* `never` - never\n\* `1min` - 1min\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
),
sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),
primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),
@@ -223,27 +211,15 @@ export const ExternalDataSchemasIncrementalFieldsCreateBody = /* @__PURE__ */ zo
sync_frequency: zod
.union([
zod
- .enum([
- 'never',
- '1min',
- '5min',
- '15min',
- '30min',
- '1hour',
- '6hour',
- '12hour',
- '24hour',
- '7day',
- '30day',
- ])
+ .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
.describe(
- '\* `never` - never\n\* `1min` - 1min\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
),
zod.null(),
])
.optional()
.describe(
- 'How often to sync.\n\n\* `never` - never\n\* `1min` - 1min\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
),
sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),
primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),
@@ -343,27 +319,15 @@ export const ExternalDataSchemasReloadCreateBody = /* @__PURE__ */ zod.object({
sync_frequency: zod
.union([
zod
- .enum([
- 'never',
- '1min',
- '5min',
- '15min',
- '30min',
- '1hour',
- '6hour',
- '12hour',
- '24hour',
- '7day',
- '30day',
- ])
+ .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
.describe(
- '\* `never` - never\n\* `1min` - 1min\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
),
zod.null(),
])
.optional()
.describe(
- 'How often to sync.\n\n\* `never` - never\n\* `1min` - 1min\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
),
sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),
primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),
@@ -463,27 +427,15 @@ export const ExternalDataSchemasResyncCreateBody = /* @__PURE__ */ zod.object({
sync_frequency: zod
.union([
zod
- .enum([
- 'never',
- '1min',
- '5min',
- '15min',
- '30min',
- '1hour',
- '6hour',
- '12hour',
- '24hour',
- '7day',
- '30day',
- ])
+ .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
.describe(
- '\* `never` - never\n\* `1min` - 1min\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
),
zod.null(),
])
.optional()
.describe(
- 'How often to sync.\n\n\* `never` - never\n\* `1min` - 1min\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
),
sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),
primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-schemas-incremental-fields-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-schemas-incremental-fields-create.json
index 772cd8228130..3614025849dd 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-schemas-incremental-fields-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-schemas-incremental-fields-create.json
@@ -128,27 +128,15 @@
"sync_frequency": {
"anyOf": [
{
- "description": "* `never` - never\n* `1min` - 1min\n* `5min` - 5min\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day",
- "enum": [
- "never",
- "1min",
- "5min",
- "15min",
- "30min",
- "1hour",
- "6hour",
- "12hour",
- "24hour",
- "7day",
- "30day"
- ],
+ "description": "* `never` - never\n* `5min` - 5min\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day",
+ "enum": ["never", "5min", "15min", "30min", "1hour", "6hour", "12hour", "24hour", "7day", "30day"],
"type": "string"
},
{
"type": "null"
}
],
- "description": "How often to sync.\n\n* `never` - never\n* `1min` - 1min\n* `5min` - 5min\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day"
+ "description": "How often to sync. The fastest sync frequency is 5 minutes.\n\n* `never` - never\n* `5min` - 5min\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day"
},
"sync_time_of_day": {
"anyOf": [
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-schemas-partial-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-schemas-partial-update.json
index 772cd8228130..3614025849dd 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-schemas-partial-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-schemas-partial-update.json
@@ -128,27 +128,15 @@
"sync_frequency": {
"anyOf": [
{
- "description": "* `never` - never\n* `1min` - 1min\n* `5min` - 5min\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day",
- "enum": [
- "never",
- "1min",
- "5min",
- "15min",
- "30min",
- "1hour",
- "6hour",
- "12hour",
- "24hour",
- "7day",
- "30day"
- ],
+ "description": "* `never` - never\n* `5min` - 5min\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day",
+ "enum": ["never", "5min", "15min", "30min", "1hour", "6hour", "12hour", "24hour", "7day", "30day"],
"type": "string"
},
{
"type": "null"
}
],
- "description": "How often to sync.\n\n* `never` - never\n* `1min` - 1min\n* `5min` - 5min\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day"
+ "description": "How often to sync. The fastest sync frequency is 5 minutes.\n\n* `never` - never\n* `5min` - 5min\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day"
},
"sync_time_of_day": {
"anyOf": [
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-schemas-reload.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-schemas-reload.json
index 772cd8228130..3614025849dd 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-schemas-reload.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-schemas-reload.json
@@ -128,27 +128,15 @@
"sync_frequency": {
"anyOf": [
{
- "description": "* `never` - never\n* `1min` - 1min\n* `5min` - 5min\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day",
- "enum": [
- "never",
- "1min",
- "5min",
- "15min",
- "30min",
- "1hour",
- "6hour",
- "12hour",
- "24hour",
- "7day",
- "30day"
- ],
+ "description": "* `never` - never\n* `5min` - 5min\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day",
+ "enum": ["never", "5min", "15min", "30min", "1hour", "6hour", "12hour", "24hour", "7day", "30day"],
"type": "string"
},
{
"type": "null"
}
],
- "description": "How often to sync.\n\n* `never` - never\n* `1min` - 1min\n* `5min` - 5min\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day"
+ "description": "How often to sync. The fastest sync frequency is 5 minutes.\n\n* `never` - never\n* `5min` - 5min\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day"
},
"sync_time_of_day": {
"anyOf": [
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-schemas-resync.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-schemas-resync.json
index 772cd8228130..3614025849dd 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-schemas-resync.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/external-data-schemas-resync.json
@@ -128,27 +128,15 @@
"sync_frequency": {
"anyOf": [
{
- "description": "* `never` - never\n* `1min` - 1min\n* `5min` - 5min\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day",
- "enum": [
- "never",
- "1min",
- "5min",
- "15min",
- "30min",
- "1hour",
- "6hour",
- "12hour",
- "24hour",
- "7day",
- "30day"
- ],
+ "description": "* `never` - never\n* `5min` - 5min\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day",
+ "enum": ["never", "5min", "15min", "30min", "1hour", "6hour", "12hour", "24hour", "7day", "30day"],
"type": "string"
},
{
"type": "null"
}
],
- "description": "How often to sync.\n\n* `never` - never\n* `1min` - 1min\n* `5min` - 5min\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day"
+ "description": "How often to sync. The fastest sync frequency is 5 minutes.\n\n* `never` - never\n* `5min` - 5min\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day"
},
"sync_time_of_day": {
"anyOf": [