A lead pipeline is where leads live. Its stages are the columns on the board, its assignment rules decide who gets each new lead, and its scoring rules give each lead a number. The website form does not write leads itself. Its answers are saved as records in their own collection, and an automation turns each answer into a lead. That way every lead goes through the lead service, which places it on the pipeline, links it to the person's contact and runs the assignment rules.
Video tutorials for this topic
Ask first
- What do they sell, and to whom? One line. It names the pipeline and shapes the scoring rules.
- Which stages do they use? If they have none, offer this as a suggestion and say it is one: New → Contacted → Qualified → Proposal → Won / Lost. Use their words when they have them.
- Who gets new leads? One person, several people taking turns, or a different person by where the lead came from or how good it looks. Get the people by name and find their user records. Never guess.
- What should the form ask? At least name and email. Then phone, company, the message, and any of their own questions.
- Should this be the main pipeline? Leads that arrive without a pipeline (added by hand, imported, Facebook leads) land on the pipeline marked default.
Steps
1. Leads: the pipeline
Create a lead_pipeline record (create_record):
| Field | Value |
|---|---|
name | e.g. "Website sales" |
description | what they sell, one line |
isActive | true |
isDefault | true only if the person said this is the main pipeline. Only one pipeline can be the default. |
stages | one entry per stage: { id, name, order, probability, isWon, isLost }. Give each stage its own short id (e.g. new, contacted), order from 0, probability 0–100 for the forecast. Mark the won stage isWon: true and the lost stage isLost: true. |
New leads land on the stage with the lowest order.
Hands on: the pipeline's sk and its first stage's id.
Check: open the board (/leads?pipeline=<pipeline sk>) and confirm the columns, in order.
2. Leads: scoring rules
Add scoringRules to the pipeline (update_record_partial with data.scoringRules). Each rule is:
{ id, name, category, condition: { field, operator, value }, points, isActive: true }
category:demographic,behavioral,engagementorfirmographic.field: a lead field, such assource,company,jobTitle,value, orcustomFields.<name>for a form question.operator:equals,not_equals,contains,greater_than,less_than,exists,not_exists,in,not_in.points: −100 to 100. The score is the sum of the points of the rules that match, kept between 0 and 100.
Build them from what the person said makes a good lead, e.g. has a company: +20, came from a referral: +25, deal value over 5,000: +30.
Tell the person plainly: these rules do not score new leads by themselves. A new lead gets the standard score (how complete its details are, plus its source). The pipeline's rules are applied when scores are recalculated: recalculate_scores for one lead (leadId) or for all leads. Editing a lead's email, phone, company, job title or source later puts the standard score back.
Check: the pipeline's configuration, Scoring tab, lists each rule. On the board, the person opens it by clicking the pipeline's icon next to its name.
3. Leads: assignment rules
Add assignmentRules to the pipeline. When a new lead arrives with no owner, the rules are tried in priority order (1 first). The first rule whose criteria match and that names someone gives the lead its owner.
{ id, name, priority, active: true, criteria, assignTo }
criteria(all optional; leave it empty to match every lead):source: a list of lead sources, e.g.["website"],["facebook"];score:{ min, max };tags: a list (any one matches);customFields:{ <field>: <exact value> }.
assignTo:- one person:
{ type: "user", value: "<their email>" }; - taking turns:
{ type: "round_robin", userPool: ["<email>", "<email>"] }; - whoever has fewest leads:
{ type: "load_balanced", userPool: [...] }.
- one person:
Put the specific rules first and end with a catch-all rule (empty criteria) so no lead is left without an owner. Use email addresses: they are what the board shows as the owner.
Check: on the board, the Assignment button opens the pipeline's Routing tab, which lists each rule and who it goes to.
Try it once: create one test lead (create_record with datatype lead. Leads always go through the lead service) with pipelineId: <pipeline sk>, source: "website", and an @test.local email. Confirm it sits on the first stage, shows the expected owner and has a score. The lead service also makes a contact for the test address. With the person's yes, delete the test lead and that contact.
4. Collection builder: the record type for the answers
Create a collection for the website answers (e.g. website_enquiry, title "Website enquiries"). Add one field per question. Use these field names so the next steps can copy them onto the lead: firstName, lastName, email (required), phone, company, message. Their own questions get their own fields.
Hands on: the collection's name. Check: open it in the Collection builder; every field is there with the right type.
5. CRM Forms: the form on that collection
Create a crm_form with collection set to the collection from step 4. Its fields come from the collection, so don't retype them.
title: what visitors see, e.g. "Get a quote".authenticationType:email(asks for an address, no check) ornone. A website form should not ask people to sign in.submitMessage: the thank-you text.email: where staff are told of each answer, only if the person asked for that.
Never bind a form to the lead collection. That would write leads without the lead service: no pipeline stage, no contact, no assignment.
Hands on: the form's name and its share link (the site's forms address followed by ?form=<form name>, shown on the form's Setup tab).
Check: open the form (/crm-form?uid=<form sk>&formTab=setup) and preview it.
6. Automation: each answer becomes a lead
Create the automation with create_automation, status draft:
- trigger:
database_changewith{ datatype: "<collection name>", operation: "created" }; - one action step,
create_lead, with config:
| Config | Value |
|---|---|
email | {{data.email}} (required) |
firstName, lastName | {{data.firstName}}, {{data.lastName}} |
phone, company | {{data.phone}}, {{data.company}} |
notes | {{data.message}} |
source | website |
sourceDetails | e.g. Website form: Get a quote |
pipelineId | the pipeline's sk |
Leave assignedTo out so the assignment rules from step 3 choose the owner. A placeholder whose field was left blank on the form is dropped, not saved as text.
Stop: an automation runs only when its status is active. Show the person what it does ("every answer to Get a quote becomes a lead on Website sales, given an owner by the assignment rules") and turn it on (set_automation_status → active) only after a yes. This one sends nothing to the visitor; the welcome email is a separate job (New-lead follow-up).
Hands on: the automation's sk.
Check: with it on, send one test answer through the form itself (POST crm/form/submit/<form name>/<test email>, an @test.local address). Confirm three things: the answer shows under the form's Submissions, a lead appears on the pipeline's first stage with the expected owner, and the automation's monitor (/automation?monitor=<automation sk>) shows the run. With the person's yes, delete the test answer, the test lead and its contact.
7. The website
The form is a page of its own at its share link. There is no form block to place inside a website page; the website links to the form (a button, a menu item, a link in an email).
Stop: putting the link on the live website publishes the form to the public. Give the person the link, and add it to a page only when they say so.
When it's done
Tell the person:
- the pipeline and its stages, in order;
- the scoring rules, and that the pipeline's rules apply when scores are recalculated (new leads get the standard score);
- who gets new leads, rule by rule;
- the form, where its answers are kept, and its share link;
- whether the form-to-lead automation is on.
Open the pipeline board (/leads?pipeline=<pipeline sk>).
Don'ts
- Don't use the pipeline's Automation tab or its
automationslist. Nothing runs them. Automations live in the Automation app. - Don't rely on the pipeline
settingsfor duplicates, scoring model, stale leads or working hours (duplicateCheck,scoringModel,rottenLeadDays,workingHours). Nothing reads them. OnlyautoAssignmentwithassignmentMethodis used, and only as a fallback after the rules, drawing on the pipeline'steamMembers. A catch-all rule is clearer. - Don't invent people for the assignment rules, and don't assign to someone the person didn't name.


