leads
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v80View latest version
Lead qualifying from any data source. Use AI to stay focused on inbound leads that fit your ICP.
- This val accepts webhook
- You can POST arbitrary lead data to it from anywhere
- An AI agent sorts the good leads from the bad leads
- Leads are stored and arranged in a dashboard
- Click Remix
- Store your
OPENAI_API_KEYas an environment variable here - Customize
PROMPT.txt(Don't remove any fields from the structured response) - Get the val's HTTP endpoint from
main.ts: - Forward leads to this webhook as a POST request.
- That's it! Watch them drop into your dashboard at
main.ts
Webhook
- The webhook receives each POST request and stores the incoming data as
input_data - All
input_datais passed to the OpenAI agent inagent.ts
AI Agent
- The agent uses web research to evaluate if the lead is a
matchfor the criteria inPROMPT.txt. - The AI returns
{name, match, reasoning}. This is theoutput_data.
Storage
- Every lead is added to the
leadsSQLite table with the columns:id— auto-incremented, starts at 1timestamp— unix ms when receivedinput_data— the POST body you sent (JSON)output_data— AI result:{name, match, reasoning}
Dashboard
- Leads that are a
matchare at the top of the dashboard. - Non-matches are hidden by default
- Click a lead to view all input and output data
- Add fields to the AI's output instructions in
PROMPT.txtto:- enhance the AI's assessment
- enrich your leads
- normalize lead data from different sources
- Add query parameters to your POST to flag sources
- ex:
your-val-endpoint.val.run?source=signup-page
- ex: