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
- Remove duplicate leads after a merge operation to keep the org clean.
- Delete test leads created during QA or staging workflow testing.
- Purge leads on a GDPR right-to-erasure request after verifying the subject's identity.
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 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 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 is missing or empty. |
UNEXPECTED_ERROR | Unexpected exception during execution. |
Output
Success Port
| Field | Type | Description |
status | string | Always deleted on success. |
resource | string | Always lead. |
operation | string | Always delete. |
Error Port
| Field | Type | Description |
errorCode | string | Machine-readable error code. |
message | string | Human-readable description of the error. |
Sample Output
{
"status": "deleted",
"resource": "lead",
"operation": "delete"
}
Expression Reference
| Expression | Description |
{{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
| Policy | Detail |
| Soft delete | Salesforce moves deleted leads to the Recycle Bin for 15 days. They can be restored within this window. |
| Prefer archiving | For audit-sensitive workflows, update Status to a closed value rather than deleting. |
| GDPR compliance | For right-to-erasure requests, confirm identity verification before triggering deletion. Log the deletion event in your compliance system. |
| Permission required | The authenticated user must have Delete permission on the Lead object. |
| Error port wiring | Always 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