Send email when webhook receives data

Developer ToolAPI IntegrationMarketingDatabaseRecipe Tools

What it does

When someone posts data to a webhook, this automation stores it in PostgreSQL and sends an email. The email goes out only when the webhook payload indicates success.

Who it's for

Operations teams who need to log webhook events and notify someone by email when data arrives.

How teams use this

Log and confirm webhook events

Store incoming webhook data in PostgreSQL and send an email confirmation so someone knows the event arrived and was recorded. The team has an audit trail and real-time notification in one flow.

Alert on webhook failures

Check the webhook status before sending email, and only notify when the payload shows success. If the status contains failed, the email is skipped and the event is still logged.

Route emails to different recipients

Add a condition to the email step so different team members receive notifications based on the webhook source or status. Include a field in the PostgreSQL insert to tag the event type.

Extend logging with custom fields

Set additional columns in the PostgreSQL table to capture the webhook timestamp, sender IP, or payload size. Only insert rows when the relay flag is true.

How it works

  1. Receive data via HTTP webhook. Someone posts JSON data to the webhook endpoint in real time, and this automation wakes up with that payload ready to process.
  2. Store the webhook data. Insert a row into the public_v1.word_or_phrase table in PostgreSQL so the event is logged and searchable later for auditing.
  3. Wait before sending email. Execute JavaScript code to pause briefly, giving the PostgreSQL database time to confirm the insert before the next step runs.
  4. Check the webhook status. Send an HTTP request to verify the webhook payload contains succeeded and relay is true. If the status contains failed, stop here.
  5. Send email with the result. Send an email notifying someone that the webhook was received, logged, and processed successfully so the team stays informed.