> ## Documentation Index
> Fetch the complete documentation index at: https://developers.clay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Enrich leads and accounts

> Use Clay to enrich records with contact, company, technology, hiring, funding, and firmographic data.

Use Clay when your system needs better GTM data before it can score, route, sync, or act on a lead or account. Clay can run enrichment waterfalls and return structured outputs to your app, CRM, data warehouse, or workflow engine.

## Common enrichments

| Category | Examples |
| - | - |
| Contact data | Work Email, Phone Number, Person Job Title |
| Company identity | Company Domain, Company Address, Company Industry |
| Company size and revenue | Employee Count, Company Revenue (Exact) |
| Technology and hiring | Verify Technology Usage, Website Techstack, Company Job Openings |
| Company intelligence | Company News, Company Latest Funding |

## Example workflows

* Enrich every signup with company domain, employee count, industry, revenue, tech stack, and latest funding.
* Find people at a target account, fetch work emails, and route them to the right outbound motion.
* Verify whether an account uses a target technology before assigning it to a campaign.
* Add recent company news and job openings to account scoring logic.

## Enrich Audiences records with a workflow

<Note>Audiences and Workflows must be enabled for your workspace.</Note>

<Card title="Install the Clay plugin" href="/quickstart#agent-plugin">
  Install the plugin and sign in before asking an agent to build the Workflow.
</Card>

Ask your agent:

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Find me all the people without a phone number, create a workflow to enrich them, and write each phone number back to the same Audiences record.
```

The agent can inspect the available people fields, find records where the phone field is empty, and create a Workflow that enriches the matching people and writes the result back to Audiences.

Save this filter for the default Phone field as `missing-phone.json`:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "type": "GroupOp",
  "combinationMode": "And",
  "items": [
    {
      "type": "BinOp",
      "key": "phone",
      "dataPath": ["contact_entity_field_values", "field", "phone"],
      "operator": "Empty",
      "value": null,
      "entityType": "CONTACT"
    }
  ]
}
```

To target a different phone field, replace `phone` in both `key` and `dataPath` with the field ID returned by `clay audiences fields list`.

The underlying CLI flow creates a saved segment from the filter, then creates a Workflow and attaches the segment as its trigger:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
clay audiences fields list --entity-type people

AUDIENCE_ID=$(clay audiences create \
  --entity-type people \
  --name "People missing phone numbers" \
  --filter ./missing-phone.json \
  | jq -r '.id')

WORKFLOW_ID=$(clay workflows create \
  --name "Enrich missing phone numbers" \
  | jq -r '.id')

TRIGGER_ID=$(jq -n --arg segmentId "$AUDIENCE_ID" \
  '{triggerType: "audience_segment", segmentId: $segmentId, entityType: "CONTACT"}' \
  | clay workflows triggers create "$WORKFLOW_ID" --input - \
  | jq -r '.resourceId')

TRIGGER_NODE_ID=$(clay workflows triggers get "$TRIGGER_ID" \
  | jq -r '.workflowNodeId')
```

Creating the trigger also creates its canvas trigger node. The agent should choose a phone enrichment action from the workspace catalog, connect it after `$TRIGGER_NODE_ID`, and add a final **Upsert Audiences Record** tool node (`upsert-audiences-record`).

The final node should map the trigger's `$.fields.id` to `audiences_record_id`, map the enrichment result to `enriched_phone`, and use this `inputMappingConfig`:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "entityType": { "type": "static", "value": "CONTACT" },
  "lookupFields|selectedLookupFields": {
    "type": "static",
    "value": ["id"]
  },
  "lookupFields|id": {
    "type": "reference",
    "expression": "{{audiences_record_id}}"
  },
  "recordFields|selectedRecordFields": {
    "type": "static",
    "value": ["phone"]
  },
  "recordFields|phone": {
    "type": "reference",
    "expression": "{{enriched_phone}}"
  },
  "recordFields|removeNullValues": { "type": "static", "value": true }
}
```

Using the record ID makes the upsert update the person that triggered the run. Once the phone is written, that person no longer matches the missing-phone segment. Validate and test the Workflow before publishing it.

## Build it with Clay

Start with a Clay-managed function when the use case is standard. Use a custom function when your team has specific providers, fallback order, prompts, or output schemas.

<Card title="Routines" href="/routines">
  Run Clay-managed functions or expose your own Clay functions through Routines.
</Card>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.