lead/convert
Convert a Lead to an Account, Contact, and optionally an Opportunity in a single operation.
Lead Conversion: Lead conversion creates an Account and Contact from the Lead data. Optionally, it also creates an Opportunity. Provide existing AccountId or ContactId values to merge into existing records and avoid creating duplicates.
When to Use
- Convert a qualified MQL to an opportunity automatically after a discovery call is logged.
- Trigger automated conversion when a lead score exceeds the MQL threshold.
- Convert an inbound lead after the prospect replies to the first email.
- Batch-convert trade show leads after the 48-hour follow-up window has passed.
Configuration
Connection
| Field | Type | Required | Description |
InstanceUrl | string | required | Salesforce org URL. |
AccessToken | string | required | Valid OAuth2 access token. Store in BizFirst Credentials Manager. |
Operation Fields
| Field | Type | Required | Description |
LeadId | string | required | 18-character Salesforce ID of the lead to convert. |
ConvertedStatus | string | required | Lead status picklist value to apply on conversion, e.g. Closed - Converted. Must be a status with Converted = true in org settings. |
AccountId | string | optional | Existing Salesforce Account ID to merge into. If omitted, a new Account is created from the Lead data. |
ContactId | string | optional | Existing Salesforce Contact ID to merge into. If omitted, a new Contact is created. |
OpportunityName | string | optional | Name for the new Opportunity. Required if DoNotCreateOpportunity is false or omitted. |
DoNotCreateOpportunity | bool | optional | Set to true to skip Opportunity creation. Defaults to false. |
SendNotificationEmail | bool | optional | Whether to send the standard Salesforce lead conversion email to the owner. Defaults to false. |
Sample Configuration
{
"Resource": "lead",
"Operation": "convert",
"InstanceUrl": "https://myorg.my.salesforce.com",
"AccessToken": "{{credentials.salesforce.accessToken}}",
"LeadId": "{{nodes.GetQualifiedLead.Id}}",
"ConvertedStatus": "Closed - Converted",
"OpportunityName": "{{nodes.GetQualifiedLead.Company}} — Enterprise Deal",
"SendNotificationEmail": false
}
Validation Errors
| Error Code | Condition |
CFG_INVALID | Node settings could not be resolved. |
CFG_MISSING_INSTANCE | InstanceUrl is missing or empty. |
CFG_MISSING_TOKEN | AccessToken is missing or empty. |
VAL_MISSING_FIELD | LeadId or ConvertedStatus is missing. |
UNEXPECTED_ERROR | Unexpected exception during execution. |
Output
Success Port
| Field | Type | Description |
leadId | string | The original Lead ID that was converted. |
accountId | string | Salesforce Account ID — either newly created or the existing one matched. |
contactId | string | Salesforce Contact ID — either newly created or the existing one matched. |
opportunityId | string | Salesforce Opportunity ID. Null if DoNotCreateOpportunity was true. |
converted | bool | Always true on the success port. |
resource | string | Always lead. |
operation | string | Always convert. |
Error Port
| Field | Type | Description |
errorCode | string | Machine-readable error code. |
message | string | Human-readable description of the error. |
Sample Output
{
"leadId": "00Q5g000003aXyzEAE",
"accountId": "0015g000007HijKAB",
"contactId": "0035g000006LmnOPQ",
"opportunityId": "0065g000005RstUVW",
"converted": true,
"resource": "lead",
"operation": "convert"
}
Expression Reference
| Expression | Description |
{{nodes.ConvertLead.accountId}} | The resulting Account ID. |
{{nodes.ConvertLead.contactId}} | The resulting Contact ID. |
{{nodes.ConvertLead.opportunityId}} | The resulting Opportunity ID. |
{{nodes.ConvertLead.converted}} | Conversion success flag. |
{{nodes.ConvertLead.errorCode}} | Error code from the error port. |
Node Policies & GuardRails
| Policy | Detail |
| Duplicate prevention | Always provide AccountId and ContactId when converting a lead whose company is already in Salesforce to prevent duplicate Account/Contact creation. |
| ConvertedStatus validity | The ConvertedStatus value must exist in the lead status picklist with Converted = true. Verify in your org setup before deployment. |
| Idempotency | A lead can only be converted once. Check IsConverted with lead/get before calling convert if the workflow may re-trigger. |
| Error port wiring | Always wire the error port. Conversion failures can occur due to missing required fields on the generated Account or Contact. |
| Sandbox testing | Test conversion logic in a sandbox, especially when mapping to existing Accounts and Contacts. |
Examples
Convert Qualified MQL After Discovery Call
A sales rep logs a call activity. When the call result is "Qualified", the workflow converts the lead and creates an opportunity named after the company.
{
"LeadId": "{{trigger.leadId}}",
"ConvertedStatus": "Closed - Converted",
"OpportunityName": "{{nodes.GetLead.Company}} — New Business",
"SendNotificationEmail": true
}
Score-Triggered Conversion (No Opportunity)
When lead score exceeds 80, convert to Account + Contact only (no opportunity yet — sales rep will create it manually).
{
"LeadId": "{{trigger.leadId}}",
"ConvertedStatus": "Closed - Converted",
"DoNotCreateOpportunity": true
}
Convert and Merge into Existing Account
A SOQL lookup identifies an existing Account by domain. Convert the lead into that account to avoid duplicates.
{
"LeadId": "{{trigger.leadId}}",
"AccountId": "{{nodes.FindAccount.records[0].Id}}",
"ConvertedStatus": "Closed - Converted",
"OpportunityName": "{{trigger.companyName}} — Expansion"
}