Skip to main content

Tutorial · 10 minutes

Build a lead-capture page

The freelancer / consultant playbook — a focused landing page, a contact form bound to a CRM-shaped database, an automated welcome email, and a webhook ping the moment a high-value lead lands.

What you'll need

  • A Coagentic account (sign up free).
  • A Resend API key for the welcome email.
  • (Optional) A webhook URL — any endpoint you control — for the high-value-lead ping.
Step 01

Describe the page and the lead flow

Open the agent panel and paste something like:

I'm a freelance brand consultant. I want a one-page site with three sections — hero, services, contact form. Tone: calm, confident, not salesy. Form fields: name, email, company, budget range, project description. When someone submits, drop them in a leads database, send a welcome email, and POST to my webhook URL if the budget is > $10,000.

The agent will create the project, design a single leads table (one row per submission), build the page, and stub the workflow.

Step 02

Review the form ↔ database mapping

Open Site → Database. The leads table maps one column per form field, plus auto-fields: id, created_at, source, budget_cents (the string "$10k - $25k" → integer), status (defaulted to "new").

Tell the agent to add or remove columns as you'd like — "add a referral_source dropdown to the form" calls add_column on the table and patches the form's JSX in the same step.

Step 03

Connect Resend

Project → Integrations → Resend → paste API key. The agent marks the welcome-email action as ready.

Step 04

Point a Generic HTTP webhook at your endpoint (optional)

Grab a webhook URL from whatever service you want to notify — a chat app's incoming webhook, an automation tool, or your own endpoint. In the workflow's Generic HTTP (http_request) action, paste it as the target URL. Skip if you don't want the ping.

Step 05

Inspect the workflow

Project → Workflows. You'll see one workflow, handle-new-lead, triggered on form_submit. The form-submit handler already inserts the row into leads automatically; the workflow runs right after with the new row's data as its trigger payload. Two actions:

  • send_email via Resend, templated with the lead's name and a calendly link.
  • Conditional http_request (Generic HTTP) — only if budget_cents > 1000000.

Tweak the email copy or the budget threshold from the visual editor without touching code.

Step 06

Flip Live, drop a test lead

Toggle Live on the Overview tab. Open the public URL, fill the form with a test lead, watch the row appear in the database, the email arrive, and (if your budget is high enough) the webhook ping fire.

Common iterations

  • Drip sequence — "after the welcome email, send follow-up day 3 and day 7 if the lead hasn't replied". Add a cron-triggered workflow that scans the leads table.
  • CRM export — "every new lead, also POST to my HubSpot ingestion URL". Add a generic HTTP action.
  • Site assistant — "add a chat that pre-qualifies leads and skips the form for tiny budgets". Knowledge base = your services + pricing.
Next
Integrations →

The full list of connectable providers — payments, email, SMS, chat — and how to wire each one.