Link contacts to a lead
The "Link contacts to a lead" robot links one or several contacts to a Bitrix24 (Alaio) lead by their IDs, right inside an automation rule or a workflow. The "add" mode appends to the already linked contacts, the "replace" mode keeps only the listed ones. It returns a success flag, the number of linked contacts and the resulting list of IDs.
The stock "Change document" robot cannot link a contact to a lead: the lead field list has no such field, because contacts are stored as a separate binding. This robot fills the gap. Provide one contact ID or several, comma-separated, from a variable or from the output of another robot such as "Find contact by phone". By default the robot works with the lead the workflow runs on, but any lead ID can be given. The "Add" mode appends contacts to the already linked ones and skips those already present; the "Replace" mode keeps only the listed contacts, the first one becoming the primary. It returns Success (Y/N), the number of contacts linked by this run, and the full list of linked contact IDs after the run, ready for conditions and next steps.
What input parameters does the robot accept?
| Parameter | Type | Required? | Default |
|---|---|---|---|
| Lead ID (empty — the lead the workflow runs on) | int | — | |
| Contact IDs (one or several) | string | yes | |
| Mode | select | — | add |
What does the robot return?
| Parameter | Type |
|---|---|
| Success (Y/N) | string |
| Contacts linked by this run | int |
| IDs of all linked contacts after the run | string |
What errors can the robot return?
The robot writes these messages to the business process log when it cannot complete a step. The text tells you what to fix in the settings or the data.
- Error: no ID given and the workflow runs on a different item
- Error: no valid contact ID given
- Error: too many contacts, the limit is {max}
- API error: {message}
- Could not link contacts: {ids}
- Contacts not found: {ids}
Scenario: a new lead from an existing customer's phone
- A lead with a phone number is created in the CRM
- The "Find contact by phone" robot finds the contact and returns its ID
- This robot links the found contact to the lead, so the manager sees the customer history at once