Skip to main content
Build a pipeline that ingests form data, persists it in Postgres, and emails a digest to your team. Runs are triggered by an inbound webhook; a separate scheduled trigger (external cron → same workflow or a digest-only variant) can send the daily email.

What you’ll build

Outcome: Every submission is stored with a timestamp. Once per day, stakeholders receive an HTML email listing new leads or tickets.

Prerequisites

  • project_contributor in your workspace
  • Postgres connection with INSERT and SELECT on a form_submissions table
  • Resend connection with a verified sending domain
  • An LLM provider configured in Providers (for the digest narrative)
  • Inbound webhook feature enabled for your environment

Create the table

Run once against your database:

Connectors to install

Part 1 — Ingest submissions

1

Create the ingest workflow

In Workflow Studio, create a workflow named form-submission-ingest.
2

Add validate step

Add a lua_script step that requires email and normalizes input from the webhook body.
3

Add Postgres insert

Add mcp_callpostgres_exec on your postgres instance to INSERT a row.
4

Create webhook subscription

Link an inbound webhook subscription to this workflow. Configure your form tool (Typeform, Webflow, custom app) to POST JSON to the subscription URL.
5

Test

Submit a test form. Confirm a row appears in form_submissions and the run succeeds in Command Center.

Validate step

Insert step

Webhook payload example

Your form should POST fields that map to workflow input:

Part 2 — Daily digest email

Create a second workflow form-daily-digest (or branch on input.digest in one graph).
1

Query last 24 hours

mcp_callpostgres_query for rows where created_at > NOW() - INTERVAL '1 day'.
2

Summarize with LLM

llm_call with a prompt that includes {{steps.query-submissions.result.rows}} and asks for a short HTML bullet list.
3

Send email

mcp_callsend_email on your resend instance with html from the LLM step.
4

Schedule externally

Use GitHub Actions, cron, or your cloud scheduler to POST to the digest webhook URL once per day (see Workflow patterns).

Query step

LLM step

Send step

Full workflow graphs (copy-paste)

Bind your postgres and resend MCP instances on each mcp_call step in Workflow Studio.

Ingest workflow (form-submission-ingest)

Digest workflow (form-daily-digest)

Wire the ingest workflow to your form webhook URL. Schedule the digest workflow with an external cron POST — see Inbound webhooks.

Idempotency

Form providers may retry webhooks. Options:
  • Add a unique submission_id column and use ON CONFLICT DO NOTHING
  • Check for duplicate email + timestamp in a Lua step before INSERT

Variations

  • Swap Resend for Gmail if you prefer sending from a Google mailbox.
  • Append rows to Google Sheets instead of Postgres for a no-DB setup.
  • Add human_task approval before the digest sends on Mondays only.