# Record SendGrid bounce events in PostgreSQL

Persist a SendGrid bounce event’s ID, message ID, SMTP reason and Unix timestamp in PostgreSQL. Select a table with event\_id TEXT PRIMARY KEY, message\_id TEXT, reason TEXT and event\_timestamp BIGINT. Repeated events upsert the same row. The recipient email field is omitted, but the SMTP reason can still contain an address.

[Use template](https://dashboard.fasthook.io/workflow/new?templateKey=sendgrid-bounce-events-to-postgresql&templateName=Record+SendGrid+bounce+events+in+PostgreSQL)

**Required accounts**

- SendGrid
- PostgreSQL

## Workflow steps

### 1. Trigger · Email Bounced

**SendGrid**. Receive the SendGrid bounce event. Open/click events require tracking enabled by the sender.

### 2. Filter · Only bounce events with an ID

**FastHook**. Continue only when the configured conditions match the incoming record.

### 3. Action · Record the bounce reason

**PostgreSQL**. Insert a row or update mapped columns when a unique key already exists. Use a stable key for repeatable delivery.

## Set up your workflow

1. **Copy the template** Open the template in FastHook to create an editable Workflow Draft.
2. **Connect your accounts** Connect your accounts for SendGrid, PostgreSQL.
3. **Review the Workflow** Review the Steps, field mappings, routes, and provider settings.
4. **Activate** Activate the Workflow when the Draft is ready, then verify a test run.

## Questions about this template

### Does the template copy someone else's credentials?

No. FastHook creates a disconnected Draft. Connect your own SendGrid, PostgreSQL accounts before activation.

### Can I change the Steps and mappings?

Yes. The copied Workflow is an editable Draft. Review every Step, input, mapping, and route before you activate it.

### What is copied into my workspace?

FastHook recreates the Trigger configuration, Action Steps, routes, and mappings with new IDs. Provider accounts, credentials, and secrets are never copied.

### When does the Workflow start running?

Only after you connect the required accounts, finish the configuration, and explicitly activate the Draft.

## Related integrations

- [PostgreSQL integrations](https://www.fasthook.io/apps/postgresql/integrations)
- [SendGrid integrations](https://www.fasthook.io/apps/sendgrid/integrations)
