Prerequisites
- Attio Plus plan or higher, which runs the new Workflows engine.
- A
Personobject (orCompany) with three attributes already created. You needlead_scoreas a number, andlead_bandas a single-select with optionsA,B, andC. You also need a matching key such asemailordomain. - A source for the event payload. The webhook path needs a product-analytics or reverse-ETL tool that can POST JSON to Attio’s generated webhook URL. Reverse-ETL means extract, transform, load. The attribute path needs the signal fields to already be writing to the record.
- An active sequence to enroll A-band leads into, and a sales team configured for round-robin assignment.
- Workspace member access with permission to publish workflows. The webhook source is the only external credential you need. No API keys are required inside Attio.
How it works
The trigger fires on one event. Parse JSON turns the raw payload into typed variables. That means each value carries its proper type, such as a number rather than text. The Formula then reduces fit, intent, and engagement to one number on a 0 to 100 scale. Switch reads the resulting band and sends the run down exactly one branch. Every branch writes the score and band back to the record, so the value is durable and filterable. The A band also picks an owner and starts outreach. The C band stops after the write. Each step passes its output to the next through the engine’s variables, which the Variables & data passing concept explains in full.- Webhook received fires on the inbound event, or Attribute value changed fires on a signal field.
- Parse JSON extracts
fit,intent, andengagement. - Formula computes the combined
lead_score. - Switch branches on the score band.
- Update record writes
lead_scoreandlead_bandon every branch. - On the A band only, Round robin assigns an owner and Enroll in sequence starts outreach.
Build steps
1
Add the trigger
Create a new workflow and add the Webhook received trigger. Copy the generated webhook URL into your analytics tool so it can POST events to the workflow. When your signals already live in Attio, swap in the Attribute value changed trigger instead. Scope it to the
Person object and the signal attribute.2
Parse the payload
Add the Parse JSON block. Point its Source field at the trigger body, then define a schema with the three signal inputs and the matching key. Mark anything your source may omit as optional, so a missing field does not fail the run.
3
Compute the score with a visible Formula
Add the Formula block. Keep the expression readable so reps trust the result. Transparency is the entire point of this recipe, unlike a black-box machine-learning score where the math is hidden. Each component is capped, so the total lands on a clean 0 to 100 scale.
4
Branch on the band with Switch
Add the Switch block and create one branch per band, reading the score from the Formula step. Order matters here. Switch takes the first matching branch, so put the highest threshold first.
5
Write the score and band on every branch
On each Switch branch, add an Update record block targeting the matched
Person. Write both the numeric score and the band, so the value is filterable and visible in the record. The band string differs per branch.6
Route the A band
On Branch A only, after Update record, add a Round robin block to assign an owner from your sales pool. Then add an Enroll in sequence block to start outreach. Branch B adds the lead to a nurture sequence or list. Branch C ends after the score write.
Variable mapping
Credit cost worked example
Parse JSON, Formula, and Switch are free logic blocks, so they cost nothing no matter how often they run. Only the data writes and the sequence enrollment consume credits.
¹ Round robin is a free workspace block. The 3 credits on the A branch come from the Update record and Enroll in sequence writes.
Say you process 2,000 events a month with a typical split of 10 percent A, 30 percent B, and 60 percent C. The monthly cost is
(200 × 3) + (600 × 2) + (1,200 × 1) = 3,000 credits. Compare that against your plan’s monthly credit allowance on Credits & pricing explained. Adjust the band thresholds if the A branch enrolls more leads than your team can work. None of this involves an AI block.
If you later add a Classify record step behind a Filter, sample about ten records and read the per-run cost in the run viewer. AI cost is variable and token-based, so it is not a fixed number you can read off a table.
Test plan
- Open the trigger in the workflow editor and click the Run test button. For the webhook path, paste a sample payload with
email,fit,intent, andengagement. For the attribute path, edit the signal field on a testPerson. - Confirm Parse JSON outputs typed values, such as
fit: 38,intent: 32, andengagement: 12, and not raw strings. - Confirm the Formula output
lead_scorereads82for those inputs. - Confirm Switch routes the run down Branch A, because
82 >= 75. - Open the matched record and confirm Update record wrote
lead_score = 82andlead_band = A. - Confirm Round robin assigned an owner and Enroll in sequence shows the lead enrolled.
- Open the run in run history and read each block’s input and output to confirm the score is explainable end to end. The Runs, debugging & publishing concept shows where each value appears.
- Fire one deliberately failing input. Send a payload where
intentis the string"high"instead of a number. Parse JSON fails the schema and stops the run before any write. Confirm in run history that no credits were spent and no record was updated.
Failure modes
Variations
Separate fit and intent scores
Output two Formula values instead of one combined number. Name themfit_score and intent_score, and write both to the record. Switch on a two-by-two matrix, where high fit and high intent together earn an A. That way, reps can see whether a lead is a good fit, actively buying, or both. Everything else stays the same.
Recompute on a schedule
Swap the trigger for Recurring schedule. Add a Find records block to pull the leads to rescore. Then wrap the Formula, Switch, and Update record steps in a Loop. The loop multiplies cost by the number of records. Gate it with a Filter that rescores only leads whose signals changed since the last run.See also
- Webhook lead intake with safe upsert
- Variables & data passing
- Runs, debugging & publishing
- Switch
- Formula