Claude lead triage generator
Let Claude read your form submissions first. This generator writes a small Cloudflare Worker that receives each submission from FormDoc, asks Claude to sort it into your categories, set a priority and summarise it, and posts the result to Slack, with a draft first reply if you want one. You choose the categories and the model; the generator writes the code.
FormDoc webhooks are part of the Pro plan, which is opening soon. You can build and test the Worker today with the webhook signature tester.
Make your triage Worker
Needs FormDoc webhooks (Pro, opening soon), a Cloudflare account and an Anthropic API key. Claude usage is billed by Anthropic.
src/index.ts
wrangler.jsonc
How to use the lead triage generator
- Choose a Claude model, describe your business in a few words and list your categories.
- Choose whether Claude drafts a first reply and whether results go to Slack.
- Follow the steps shown to create the project, add your secrets and deploy with Wrangler.
- In FormDoc, add a webhook to your form with the Worker’s address and copy its signing secret.
- Press Send test in FormDoc and watch the result arrive in Slack.
What the Worker does
| Step | What happens |
|---|---|
| Check the signature | Rejects any request without a valid X-Formdoc-Signature, or one older than 5 minutes |
| Answer FormDoc | Replies at once, so FormDoc doesn’t time out, and carries on in the background |
| Ask Claude | Sends the form’s fields with your categories; Claude returns a category, priority, summary and optional reply |
| Share the result | Posts to your Slack channel and writes a log line you can see with wrangler tail |
Claude’s answer comes back as structured JSON that matches a schema, so the Worker never has to guess at free text. The instructions tell Claude that the submission is data from a visitor, not instructions, so a message saying “ignore your rules” is sorted like any other.
Choosing a model
Claude Opus 5.5 is the most capable and handles unusual or long messages best. Claude Haiku 5.5 is the fastest and lowest-cost option and is usually enough for short contact forms. Claude Sonnet 5.5 sits between the two. Claude usage is billed by Anthropic to your own API key; check Anthropic’s current prices before choosing.
Privacy
Submissions go from FormDoc to your Worker and from your Worker to Anthropic and Slack, using your own accounts. Mention these services in your privacy policy if visitors’ messages are sent to them. FormDoc itself never sends submissions to Claude.
Common questions
Is the generator free?
Yes. The generator is free. Running the Worker uses your Cloudflare account, which has a free tier, and your Anthropic API key, which is billed by Anthropic.
Do I need Slack?
No. Turn off the Slack option and the Worker only logs each result. You can change the code to send results anywhere, for example to a spreadsheet or your CRM.
What happens if Claude can’t sort a message?
The Worker logs the submission’s id and the reason, and moves on. The submission is still emailed to you by FormDoc as usual, so nothing is lost.
Can I check webhook signatures without deploying anything?
Yes. Paste a delivery into the webhook signature tester, or sign a test request there and send it to your Worker with curl. The webhooks guide explains the payload.