> For the complete documentation index, see [llms.txt](https://docs.gradient.works/kb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gradient.works/kb/automation-builder-kit-abk/actions/matching/matchleadtoaccountaction.md).

# Match Lead to Account

Takes a list of Leads from earlier in the Flow, finds matching Accounts and provides a list of [LeadToAccountMatch](/kb/automation-builder-kit-abk/models/leadtoaccountmatch.md) results for use later in the Flow. The matches can be used for assignment or [lead conversion](/kb/automation-builder-kit-abk/actions/leads/convertleadaction.md).

For more information on how to use this action, see [Lead and Account Matching](/kb/routing/matching.md).

## Configuration

{% tabs %}
{% tab title="Flow Element" %}

<figure><img src="/files/2FT8ciAw7XBZrpuiqmdP" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Apex Properties" %}
Please note that you will not directly interact with these input fields as you do with some Flow Actions. Instead the Gradient Works custom editor takes care of the heavy lifting.

| Name                 | Required | Type        | Description                                                                  |
| -------------------- | -------- | ----------- | ---------------------------------------------------------------------------- |
| accountDomainField   | No       | String      | Deprecated                                                                   |
| accountNameField     | No       | String      | Deprecated                                                                   |
| filterData           | No       | String      | Include matches that meet all the specified filters                          |
| lead                 | No       | Lead        | The Lead to match to Accounts. Must fill out lead or leads.                  |
| leadCompanyNameField | No       | String      | Deprecated                                                                   |
| leadDomainField      | No       | String      | Deprecated                                                                   |
| leads                | No       | List\<Lead> | The list of Leads to match to Accounts. Must fill out lead or leads.         |
| matchCriteriaData    | No       | String      | Criteria for finding potential matching Accounts                             |
| rankerData           | No       | String      | If there are multiple matches, rank them according to the specified criteria |
| {% endtab %}         |          |             |                                                                              |
| {% endtabs %}        |          |             |                                                                              |

## Outputs

For easy access later in the flow, we recommend you select "Manually assign variables" in the Flow editor and store the `results` value in a variable.

| Name    | Type                                                                                    | Description                                                                                                      |
| ------- | --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| count   | Integer                                                                                 | The number of results                                                                                            |
| result  | [LeadToAccountMatch](/kb/automation-builder-kit-abk/models/leadtoaccountmatch.md)       | The first result of matching Leads to Accounts. Can be used when working with a single Lead in place of results. |
| results | List<[LeadToAccountMatch](/kb/automation-builder-kit-abk/models/leadtoaccountmatch.md)> | The results of matching Leads to Accounts                                                                        |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gradient.works/kb/automation-builder-kit-abk/actions/matching/matchleadtoaccountaction.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
