Skip to main content
Score inbound and outbound contacts automatically when volume is too high for manual review.

Scaffold it

terse init acme-revenue --template contact-scoring

What it does

  1. Triggers on a new contact in Attio.
  2. Pulls firmographic context from Apollo.
  3. Uses the model to assign a score and short rationale.
  4. Writes the score and rationale back to Attio.

Core workflow

import { AttioRecordInputEvent, Terse, TerseAgent } from "terse-sdk"
import { Apollo, Attio, AttioList } from "./terse.generated"

const client = new Terse()

await client.createWorkflow({
  name: "contact-scoring",
  triggers: [Attio.onRecordCreated({ list: AttioList.Contacts.NewContacts })],
  skills: [
    Attio.skill({ lists: [AttioList.Contacts.NewContacts] }),
    Apollo.skill(),
  ],
  onTrigger: async (event: AttioRecordInputEvent, agent: TerseAgent) => {
    const company = await agent.tools.apollo.enrichCompany({
      domain: event.record.values.company_domain,
    })

    const prompt = [
      "Score this contact from 1-100 and explain why.",
      `Company: ${event.record.values.company_name}`,
      `Domain: ${event.record.values.company_domain}`,
      `Industry: ${company.industry}`,
      `Employee count: ${company.employeeCount}`,
      `Revenue: ${company.estimatedRevenue}`,
      `Technologies: ${company.technologies.join(", ")}`,
    ].join("\n")

    const result = await agent.runAndWait(prompt, event)

    // Parse structured score from model output
    const scoreMatch = result.match(/\b(\d{1,3})\b/)
    const score = scoreMatch ? parseInt(scoreMatch[1], 10) : 0

    await agent.tools.attio.updateRecord({
      list: AttioList.Contacts.NewContacts,
      recordId: event.record.id,
      fields: { contact_score: score, scoring_notes: result },
    })
  },
})

Customize

  • Change the score thresholds to match your routing logic.
  • Add Slack or email delivery if high scores should notify a rep immediately.
  • Split scoring by persona if your GTM team handles multiple buyer types.
  • See structured output for a more robust way to extract typed scores from the model.