WorkOS Docs Homepage
Events
API referenceDashboardSign In
Event typesEvent typesData syncingOverviewOverviewSyncing with events APISyncing with events APISyncing with webhooksSyncing with webhooksData reconciliationData reconciliation
Syncing to external databasesSyncing to external databases
PostgresPostgresMySQLMySQLNeonNeonPlanetScalePlanetScaleMongoDB AtlasMongoDB AtlasClickHouse CloudClickHouse CloudMonitoring and OperationsMonitoring and Operations
ObservabilityStreaming to DatadogStreaming to Datadog
API Reference
API Reference
Integrations
Integrations
Migrate to WorkOS
Migrate to WorkOS
SDKs
SDKs

Neon

Mirror your WorkOS data into Neon from your own host or a Neon Function.

On this page

  • Introduction
  • Run from your own host
  • Run as a Neon Function
  • Compute and branches

Introduction

Neon is hosted Postgres with branching, automatic scaling, and scale to zero. The sync engine uses the same @workos/sync-postgres destination as any other Postgres database.

The Neon integration guide in the sync engine repository covers database setup, connection strings, TLS, deployment, and branching.

Run from your own host

Follow the Postgres guide with your Neon connection string as DATABASE_URL. Both direct and pooled connections work. Use sslmode=verify-full and preserve the other parameters in the connection string.

See Choose a connection and Run the sync from your own host for the exact setup.

Run as a Neon Function

You can also run the sync on the Neon branch itself, without operating a separate host. The Neon Functions template uses scheduled triggers for polling, backfill, and reconciliation. A verified WorkOS webhook can trigger an immediate poll, and a token-protected status endpoint reports the mirror’s health.

Follow Run the sync as a Neon Function for the template, environment variables, trigger configuration, and deployment commands.

Compute and branches

A continuous listener or a tick every minute keeps Neon’s compute awake, so plan for continuous compute usage while syncing. A longer polling interval can let it suspend between polls, at the cost of more lag.

A Neon branch copies the mirror, cursor, checkpoints, and writer lease. A sync on the child resumes from that cursor for the same WorkOS environment rather than starting a new backfill. See Branches for lease timing and shared API rate limits.

Keep the workos schema out of Neon’s Data API unless you have designed the grants and row-level security for browser access. The mirror includes raw event payloads and deleted rows; see Query it.

PlanetScale Mirror your WorkOS data into PlanetScale Postgres or Vitess
Up next
© WorkOS, Inc.
FeaturesAuthKitSingle Sign-OnDirectory SyncAdmin PortalFine-Grained Authorization
DevelopersDocumentationChangelogAPI Status
ResourcesBlogPodcastPricingSecuritySupport
CompanyAboutCustomersCareersLegalPrivacy
© WorkOS, Inc.