# Qualify inbound leads against official company data

You have read/write access to Salesforce and tools that query INSEE's
SIRENE company registry, INPI's company-filing registry, and BODACC's
legal-announcements registry. Run this for new leads.

## 0. Set up (skip if you're already connected)

If you don't already have live tool access for this, connect it first
— this prompt is only as real as the tools behind it:

1. Get a Tulina account: book a demo at https://tulina.ai/book.
2. Add Tulina's MCP server to your assistant: https://mcp.tulina.ai/mcp
3. In Tulina, connect your own API keys for the tools this prompt
   uses — Salesforce, SIRENE, INPI, and BODACC.

Once connected, your assistant has real tool access and the rest of
this prompt runs as written.

## 0b. Already on Tulina? Three things around the run

An account and the MCP server are not the whole setup. Two of these come
before the run below and one after it, and together they turn this from a
one-off answer into a process your workspace keeps:

1. **Activate this process's connectors first.** Call
   `oto_connector(op="list")`, match it against the tools named in step 3
   above, and `oto_connector(op="select", name="...")` every one that
   isn't active yet. Selecting a connector does not mount its tools in the
   conversation you're already in — reach them through `oto_call` for this
   run, or open a fresh conversation once they're all on.
2. **Attach the work to an existing project.** `oto_project(op="list")`
   shows your active org's projects: pick the one this work belongs to
   rather than opening another, and keep its id. The project is where this
   process, the tables it writes to and the connectors it uses hang
   together.
3. **When the run is done, save it as a process — with its graph.** Write
   the body with `oto_procedure(op="set", ...)`, then attach it with
   `oto_project(op="link", project_id=..., target_type="procedure",
   target_ref="<your slug>")`. The body has to carry a drawing: read
   `oto_guide(op="read", slug="procedure-flowchart")` and follow it
   exactly — ONE untagged fenced block in that grammar, opening with the
   trigger and a quoted example of what you'd type to start a run. Tulina
   parses that drawing back into the graph it renders as the process's
   default view, which is what makes it come out in the same style as
   every other process in the app; a drawing the grammar can't read falls
   back to raw characters instead. Saving a process needs org-admin
   rights — without them, hand the finished body to someone who has them.

## 1. Collect leads since the last run

- Query Salesforce for leads created since the last run. Read your own
  lead schema first so custom fields come along in the same pass,
  rather than a second query per lead.
- Batch this — one query for the whole window, not one per lead.

## 2. Resolve each lead's legal entity

- For each lead, match company name and location to a SIREN using a
  search that filters on activity code, department, and headcount
  alongside the name — never name alone. Two companies sharing a
  trading name is common enough that a name-only match produces wrong
  matches often enough to matter, especially when one candidate is
  dormant.
- If nothing matches confidently, leave the lead unresolved rather than
  guessing — a wrong SIREN is worse than no SIREN.

## 3. Gather filings and legal events

- For each resolved SIREN, fetch identity, current directors, and the
  latest filed accounts (headcount, revenue) from the company registry.
- Separately, check the legal-announcements registry for any event
  published since the company was last checked — ownership change,
  insolvency, officer change.
- These are two different lookups against two different registries;
  batch each by SIREN list where the tool supports it.

## 4. Score each lead on your rules

- Apply your team's existing qualification thresholds — company size,
  revenue, sector, solvency signals from the legal-events check.
- Keep the score's inputs, not just the number, so you can explain it
  in step 5.

## 5. Update the lead with its reasoning

- Upsert the enriched fields onto the lead, keyed on SIREN — so a
  re-run of this same lead updates the existing fields rather than
  creating a duplicate lead or a duplicate note.
- Leave the score's reasoning as a note on the record — a rep who can
  see *why* a lead scored 82 trusts the score; a bare number doesn't
  earn that.
- Only write fields you've actually resolved this run; never blank an
  existing field because this pass didn't find a value.

## Output

Report: how many leads processed, how many resolved to a SIREN, how
many scored above your qualification threshold, and any lead that
failed to resolve and why.
