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: v56View latest version
Lead qualifying from any data source.
- This val is a 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
- Lead data from incoming POST requests are passed to the OpenAI agent in
agent.ts
AI Agent
- The agent uses web research check if the lead is a
matchfor the criteria inPROMPT.txt. - By default, the AI returns
{name, match, reasoning}. This is theoutput_data.
Storage
- Every lead is added to the
leadsSQLite table:id,timestamp,input_data,output_data.
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: