Find lead by condition
The Find lead robot searches Bitrix24 leads by phone, email, stage, assigned user, or a custom JSON filter, with sorting and a limit of up to 50 results. It returns the first lead ID and title, all found IDs, the count, and a Found flag (Y/N). Works in Bitrix24 business processes and robots.
The robot searches Bitrix24 leads by conditions: phone number, email, stage (e.g. NEW or IN_PROCESS), assigned user, and a custom JSON filter for non-standard conditions that is merged with the other fields. Sorting by creation date, modification date, or ID is available, with a result limit from 1 to 50 (default 5). Typical cases: find a repeat lead with the same phone number before creating a new one, or collect the leads of an assigned user at a specific stage. Returns the ID and title of the first lead, all found IDs, the count, and a Found flag (Y/N) — build a condition on it in the workflow designer and pass the IDs to the next steps of the business process.
What input parameters does the robot accept?
| Parameter | Type | Required? | Default |
|---|---|---|---|
| Phone | string | — | |
| string | — | ||
| Stage (e.g. NEW, IN_PROCESS, WON, JUNK) | string | — | |
| Assigned user ID | int | — | |
| Custom filter (JSON, e.g. {"CONVERTED":"N"}) | string | — | |
| Sort by: CREATED / DATE_MODIFY / ID (default DATE_MODIFY DESC) | string | — | |
| Maximum results (default 5) | int | — |
What does the robot return?
| Parameter | Type |
|---|---|
| ID of the first lead found | int |
| Title of the first lead | string |
| All found IDs | int |
| Number of leads found | int |
| Found (Y/N) | string |
Scenario: detect a repeat inquiry
- A new form submission creates a lead with a phone number
- The robot searches the CRM for leads with the same number
- If a lead is found, the repeat inquiry is routed to the same assigned user