# Neon
Source: https://www.inngest.com/docs/features/events-triggers/neon

description = `Trigger functions from your Neon Postgres database updates.`;

Inngest allows you to trigger functions from your Neon Postgres database updates.

## Benefits of triggering functions from database events

By decoupling function triggers from your application logic, events are initiated by database updates rather than relying on instrumentation in your code to send them. This ensures you won’t miss an event when data is manipulated within your application. This decoupling creates a clean abstraction layer between database operations and code that runs asynchronously.

Additionally, as database events are pushed into the Inngest system to enqueue new functions, this can eliminate the need for architecture patterns like the [transactional outbox pattern](https://microservices.io/patterns/data/transactional-outbox.html).

### Leveraging Inngest features with database triggers

Beyond the architectural benefit, some specific Inngest features go perfectly with database triggers:

- [**Fan-out**](/docs/guides/fan-out-jobs) - Use a single database event to trigger multiple functions to run in parallel. For example, a pg/users.inserted might trigger a welcome email function and a function that starts a trial in Stripe.
- [**Batching**](/docs/guides/batching) - Database events can be batched to process many updates more efficiently. For example, many small updates can be aggregated or efficiently perform bulk operations using third party APIs that support it, like Shopify.
- [**Flow control**](/docs/guides/flow-control) - Combine database triggers with flow control functionality like throttling, debouncing, or rate limiting for better resource management and efficiency. For example, use throttling for working with third party API rate limits or use debounce for operations that may happen frequently, helping to avoid redundant work.

## How it works
Once you connect Neon to Inngest, any changes to data in your database will automatically send new events to your Inngest account.

<Info>
  The Neon integration currently only supports a single database connection per-account to the Inngest production environment.
  No other environments are supported at this time.
</Info>

## Connecting Neon to Inngest
Connecting Neon will require some configuration changes on your Postgres database and Neon project.

There are three steps to install the Neon integration in Inngest:

1. **Authorization:** by adding your postgres credentials, Inngest can access your database to proceed with the installation
2. **Enable logical replication:** change the `wal_level` configuration to `logical`
3. **Connect the Neon database to Inngest**

You will find Neon in the integrations page inside your Inngest dashboard. Click "Connect" to begin the setup process:
<ImageTheme
  light={'/assets/docs/features/events-triggers/neon/neon-integration-page.png'}
  className="my-0"
  alt={'Neon integration card inside the Inngest integrations page'}
/>

### 1. Authorizing Inngest
<Callout>
Inngest doesn’t store your credentials. Make sure you don’t refresh the page when completing the steps, otherwise your credentials will be lost. If that’s the case, you will be prompt to authorize Inngest again.
</Callout>

Insert your postgres credentials and hit the “Verify” button to start the validation process:
<ImageTheme
  light={'/assets/docs/features/events-triggers/neon/neon-authorize-step.png'}
  className="my-0"
  alt={'Neon authorization step inside the Inngest integrations page'}
/>

### 2. Enable logical replication
You will need to make sure your Neon project has enabled logical replication.

Enable logical replication either automatically using the Neon dashboard:
<ImageTheme
  light={'/assets/docs/features/events-triggers/neon/neon-dashboard.png'}
  className="my-0"
  alt={'Neon dashboard settings with option to enable logical replication'}
/>

Or follow the steps in the [Neon guide](https://neon.tech/docs/guides/logical-replication-postgres-to-neon#enable-logical-replication-in-the-source-neon-project) to locate and edit your postgresql.conf file.
Once that’s complete, go back to Inngest to “Verify logical replication is enabled”:

<ImageTheme
  light={'/assets/docs/features/events-triggers/neon/neon-logical-replication-step.png'}
  className="my-0"
  alt={'Neon verify enable logical replication step inside the Inngest integrations page'}
/>

### 3. Connecting
There are two ways to connect to the Neon Database:

- Automatically
- Manually *(coming soon)*

Inngest will setup and connect to your Neon Database automatically. It will create a Postgres role for replication, grant schema access to the role, create a replication slot and create a publication.
<ImageTheme
  light={'/assets/docs/features/events-triggers/neon/neon-connect-step.png'}
  className="my-0"
  alt={'Neon automatic connect step inside the Inngest integrations page'}
/>

## Local development *(coming soon)*
For information about our plans check our [public roadmap.](https://roadmap.inngest.com/roadmap)