Portal Community

lead/delete

Delete a Lead record from Salesforce. Records are moved to the Recycle Bin and remain recoverable for 15 days.

Destructive Operation: Deleted leads move to the Salesforce Recycle Bin for 15 days. After that period, deletion is permanent. Consider updating the lead's Status to a closed value or using a custom IsArchived flag as a non-destructive alternative.

When to Use

Configuration

Connection

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

Operation Fields

FieldTypeRequiredDescription
LeadIdstringrequired18-character Salesforce Lead ID of the record to delete.

Sample Configuration

{
  "Resource": "lead",
  "Operation": "delete",
  "InstanceUrl": "https://myorg.my.salesforce.com",
  "AccessToken": "{{credentials.salesforce.accessToken}}",
  "LeadId": "{{nodes.FindDuplicateLead.Id}}"
}

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 is missing or empty.
UNEXPECTED_ERRORUnexpected exception during execution.

Output

Success Port

FieldTypeDescription
statusstringAlways deleted on success.
resourcestringAlways lead.
operationstringAlways delete.

Error Port

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

Sample Output

{
  "status": "deleted",
  "resource": "lead",
  "operation": "delete"
}

Expression Reference

ExpressionDescription
{{nodes.DeleteLead.status}}Operation status (deleted).
{{nodes.DeleteLead.errorCode}}Error code from error port.
{{nodes.DeleteLead.message}}Error message from error port.

Node Policies & GuardRails

PolicyDetail
Soft deleteSalesforce moves deleted leads to the Recycle Bin for 15 days. They can be restored within this window.
Prefer archivingFor audit-sensitive workflows, update Status to a closed value rather than deleting.
GDPR complianceFor right-to-erasure requests, confirm identity verification before triggering deletion. Log the deletion event in your compliance system.
Permission requiredThe authenticated user must have Delete permission on the Lead object.
Error port wiringAlways wire the error port. Deletion can fail if the record is locked or if the user lacks permission.

Examples

Delete Duplicate Lead After Merge

A deduplication workflow identifies duplicate leads using SOQL. After merging data into the canonical record, delete the duplicate.

{
  "LeadId": "{{nodes.FindDuplicate.duplicateLeadId}}"
}

Purge Test Leads After QA

A scheduled cleanup workflow retrieves all leads tagged with Description = 'QA_TEST' and deletes them.

// GetAll config:
{ "Query": "Description = 'QA_TEST'" }
// Loop: delete each lead
{ "LeadId": "{{loop.current.Id}}" }

GDPR Erasure Request

When an erasure request is verified, the workflow finds the lead by email via SOQL, then deletes it and logs the action.

// SOQL: SELECT Id FROM Lead WHERE Email = '{{trigger.subjectEmail}}'
// Delete:
{ "LeadId": "{{nodes.FindLead.records[0].Id}}" }
// Log: write deletion record to compliance audit log