How to Score and Prioritize Inbound Sales Leads with AI Structured Output
Receive a web form submission on a Webhook trigger, use an Agent-mode Connector node with a Response Schema to return a JSON lead score and fit summary, then create a prioritized Monday.com item and a Klaviyo profile for nurturing.
What This Integration Does
Sales teams lose deals when hot leads sit in a queue behind cold ones. This Spojit workflow turns every inbound form submission into a scored, ranked record the moment it arrives. An Agent-mode Connector node reads the raw form fields, weighs fit signals like company size, budget, and intent, and returns a numeric score plus a short reasoning summary in a fixed JSON shape you can branch on and store. The result is a Monday.com board where reps see the highest-priority leads at the top, and a Klaviyo profile so every lead also enters your nurture marketing from day one.
The workflow runs whenever your marketing site or form tool POSTs to the workflow's Webhook URL. The trigger parses the JSON body, an Agent-mode Connector node scores it against your criteria, a Transform node maps the score to a priority label, and two Connector nodes in Direct mode write the lead to Monday.com and Klaviyo. Each submission produces one Monday.com item and one Klaviyo profile. Because Klaviyo's create-profile upserts on email, re-submissions from the same person update the existing profile rather than duplicating it. Failed runs appear in the execution history with the full input and the AI output so you can replay them.
Prerequisites
- A Webhook signing connection (scheme Spojit or Custom) so Spojit can verify incoming form posts. See the webhook trigger setup guide below.
- A Monday.com connection with permission to create items, and the target
boardId(and optionally agroupId) where leads should land. Uselist-boardsonce to find the ID. - The Monday.com board's column IDs for the fields you want to write (for example a Status column for priority and a numbers column for the score). Open the board and check the column settings, or call
get-board. - A Klaviyo connection with permission to create and update profiles.
- A clear, written set of scoring criteria (what makes a lead a 90 vs a 30) so the prompt is consistent.
Step 1: Receive the form submission with a Webhook trigger
Add a Trigger node and set its type to Webhook. Pick your signing connection so Spojit verifies the HMAC signature on each request, then copy the generated workflow URL into your form tool or marketing site. When a submission arrives the trigger returns 202 with an executionId and exposes the parsed JSON body as {{ input }}. A typical payload looks like this:
{
"name": "Dana Okafor",
"email": "dana@acme.io",
"company": "Acme Robotics",
"companySize": "250-500",
"budget": "50k+",
"message": "We need to automate order routing across 3 warehouses by Q3."
}
You will reference these as {{ input.email }}, {{ input.company }}, {{ input.message }}, and so on in the steps below.
Step 2: Score the lead with an Agent-mode Connector node
Add a Connector node and switch it to Agent mode. Agent mode lets the agent reason over the free-text fields and produce judgment, and the Response Schema forces the answer into reliable JSON instead of prose. Write a prompt that hands the agent the submission and your criteria:
Score this inbound sales lead from 0 to 100 on fit and intent.
Higher company size, larger budget, and concrete, urgent needs score higher.
Lead:
- Name: {{ input.name }}
- Company: {{ input.company }}
- Company size: {{ input.companySize }}
- Budget: {{ input.budget }}
- Message: {{ input.message }}
Define the Response Schema so the output is always shaped the same way:
{
"type": "object",
"properties": {
"score": { "type": "integer", "minimum": 0, "maximum": 100 },
"tier": { "type": "string", "enum": ["hot", "warm", "cold"] },
"fitSummary": { "type": "string" }
},
"required": ["score", "tier", "fitSummary"]
}
Set the node's Output Variable to scoring. Downstream you can read {{ scoring.score }}, {{ scoring.tier }}, and {{ scoring.fitSummary }}. Because the schema is enforced, later nodes never have to parse loose text.
Step 3: Map the score to a priority label with a Transform node
Add a Transform node to derive presentation-ready values from the raw score. Build a small structured object that turns {{ scoring.score }} into a Monday.com Status label and a friendly headline. For example, produce a priority string ("Urgent" for 80 and above, "High" for 60 to 79, "Standard" below 60) and an itemName like:
{{ input.company }} - {{ input.name }} ({{ scoring.score }})
Set the Transform node's Output Variable to lead so you can reference {{ lead.priority }} and {{ lead.itemName }} when writing to Monday.com. Keeping this mapping in its own node makes the priority thresholds easy to tune later without touching the AI prompt.
Step 4: Create a prioritized item in Monday.com (Direct mode)
Add a Connector node, choose the Monday.com connector, keep it in Direct mode, and select the create-item tool. Direct mode is deterministic and costs no AI credits, which is what you want for a predictable single write. Map the fields:
boardId: your leads board ID.name:{{ lead.itemName }}.groupId(optional): the group new leads should land in.columnValues: an object keyed by your board's column IDs.
The columnValues object lets you push the score, priority, and contact details into their columns. Using your own column IDs, it looks like:
{
"status": { "label": "{{ lead.priority }}" },
"numbers": "{{ scoring.score }}",
"email": { "email": "{{ input.email }}", "text": "{{ input.email }}" },
"text": "{{ scoring.fitSummary }}"
}
Set the Output Variable to mondayItem. The tool returns the new item's id, which you can reuse in a follow-up create-update call or a notification if you extend the workflow later.
Step 5: Create or update the Klaviyo profile (Direct mode)
Add another Connector node, choose the Klaviyo connector in Direct mode, and select the create-profile tool. Pass the lead's attributes so marketing can begin nurturing immediately:
{
"email": "{{ input.email }}",
"first_name": "{{ input.name }}",
"properties": {
"company": "{{ input.company }}",
"lead_score": "{{ scoring.score }}",
"lead_tier": "{{ scoring.tier }}"
}
}
Klaviyo upserts on email, so a returning lead updates the existing profile and its lead_score rather than creating a duplicate. To drop high-fit leads straight into a sales nurture list, add one more Direct-mode Connector node with Klaviyo's add-profiles-to-list tool, passing the list ID and the email. You can find the list ID with list-lists.
Step 6: Gate the list-add behind the lead tier with a Condition node
If you only want hot leads added to the priority nurture list, place a Condition node before the add-profiles-to-list call. Set the condition to check whether {{ scoring.tier }} equals hot (or whether {{ scoring.score }} is at least 80). Connect the true branch to the list-add node and leave the false branch to finish the run after the profile is created. This keeps cold leads in Klaviyo for general marketing while reserving the priority list for genuine opportunities.
Tips
- Keep the scoring prompt and thresholds in sync. The Agent-mode node decides the raw score; the Transform node decides what label that score maps to. Tune them independently.
- Ask Miraxa to scaffold the canvas: "Build a workflow with a Webhook trigger, an Agent-mode Connector node that scores a lead into JSON, a Monday.com
create-itemnode, and a Klaviyocreate-profilenode." Then fine-tune fields in the properties panel. - Store
{{ scoring.fitSummary }}in a long-text column on Monday.com so reps see the AI's reasoning at a glance without opening the run. - If your form already hands you a numeric budget or employee count, include it verbatim in the prompt. Concrete numbers make the score far more stable than free text alone.
Common Pitfalls
- Wrong column IDs. Monday.com's
columnValuesare keyed by internal column IDs, not the labels you see on screen. Confirm them withget-boardbefore going live, or the write silently skips those columns. - Status label mismatch. The
labelyou send in a Status column must already exist on that column in Monday.com, otherwise it is rejected. Create "Urgent", "High", and "Standard" on the board first. - Skipping the Response Schema. Without it, Agent mode can return prose, and
{{ scoring.score }}will be empty. Always define the schema so downstream nodes get clean fields. - Webhook replays. If your form tool retries on timeout you can get duplicate runs. Enable the trigger's opt-in dedup using an event-id header so the same submission only scores once.
Testing
Before pointing your live form at the workflow, POST a single sample submission to the Webhook URL (use the JSON from Step 1) and watch the run in the execution history. Confirm the Agent-mode node produced a valid scoring object with a score, tier, and summary, that the Transform node mapped it to the right priority, and that exactly one Monday.com item and one Klaviyo profile were created. Send two or three contrasting leads (a clear hot lead and a clear cold one) to verify the thresholds and the Condition branch behave as expected, then connect your real form.