Portal Community

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

Configuration

Connection

FieldTypeRequiredDescription
InstanceUrlstringrequiredSalesforce org URL.
AccessTokenstringrequiredValid OAuth2 access token. Store in BizFirst Credentials Manager.

Operation Fields

FieldTypeRequiredDescription
LeadIdstringrequired18-character Salesforce ID of the lead to convert.
ConvertedStatusstringrequiredLead status picklist value to apply on conversion, e.g. Closed - Converted. Must be a status with Converted = true in org settings.
AccountIdstringoptionalExisting Salesforce Account ID to merge into. If omitted, a new Account is created from the Lead data.
ContactIdstringoptionalExisting Salesforce Contact ID to merge into. If omitted, a new Contact is created.
OpportunityNamestringoptionalName for the new Opportunity. Required if DoNotCreateOpportunity is false or omitted.
DoNotCreateOpportunitybooloptionalSet to true to skip Opportunity creation. Defaults to false.
SendNotificationEmailbooloptionalWhether 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 CodeCondition
CFG_INVALIDNode settings could not be resolved.
CFG_MISSING_INSTANCEInstanceUrl is missing or empty.
CFG_MISSING_TOKENAccessToken is missing or empty.
VAL_MISSING_FIELDLeadId or ConvertedStatus is missing.
UNEXPECTED_ERRORUnexpected exception during execution.

Output

Success Port

FieldTypeDescription
leadIdstringThe original Lead ID that was converted.
accountIdstringSalesforce Account ID — either newly created or the existing one matched.
contactIdstringSalesforce Contact ID — either newly created or the existing one matched.
opportunityIdstringSalesforce Opportunity ID. Null if DoNotCreateOpportunity was true.
convertedboolAlways true on the success port.
resourcestringAlways lead.
operationstringAlways convert.

Error Port

FieldTypeDescription
errorCodestringMachine-readable error code.
messagestringHuman-readable description of the error.

Sample Output

{
  "leadId": "00Q5g000003aXyzEAE",
  "accountId": "0015g000007HijKAB",
  "contactId": "0035g000006LmnOPQ",
  "opportunityId": "0065g000005RstUVW",
  "converted": true,
  "resource": "lead",
  "operation": "convert"
}

Expression Reference

ExpressionDescription
{{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

PolicyDetail
Duplicate preventionAlways provide AccountId and ContactId when converting a lead whose company is already in Salesforce to prevent duplicate Account/Contact creation.
ConvertedStatus validityThe ConvertedStatus value must exist in the lead status picklist with Converted = true. Verify in your org setup before deployment.
IdempotencyA lead can only be converted once. Check IsConverted with lead/get before calling convert if the workflow may re-trigger.
Error port wiringAlways wire the error port. Conversion failures can occur due to missing required fields on the generated Account or Contact.
Sandbox testingTest 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"
}