lead/getAll
Query and retrieve multiple Lead records from Salesforce using an optional filter and limit.
When to Use
- Get all uncontacted leads created in the last 30 days for a morning outreach batch.
- List all leads from a specific campaign source for reporting or follow-up automation.
- Retrieve all leads assigned to a specific user before reassigning on their leave period.
- Pull leads by status (e.g.
Working - Contacted) for batch processing in a loop.
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 |
Query | string | optional | SOQL-style WHERE clause filter applied to Lead records, e.g. Status = 'Open - Not Contacted'. Omit to return all accessible leads (subject to Limit). |
Limit | int | optional | Maximum number of records to return. Defaults to 200 if not specified. Maximum is governed by Salesforce API limits. |
Sample Configuration
{
"Resource": "lead",
"Operation": "getAll",
"InstanceUrl": "https://myorg.my.salesforce.com",
"AccessToken": "{{credentials.salesforce.accessToken}}",
"Query": "Status = 'Open - Not Contacted' AND CreatedDate = LAST_30_DAYS",
"Limit": 100
}
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. |
UNEXPECTED_ERROR | Unexpected exception during execution. |
Output
Success Port
| Field | Type | Description |
records | array | Array of Lead objects. Each object contains the full Lead field set from the Salesforce REST API. |
totalSize | int | Total number of records returned in this response. |
resource | string | Always lead. |
operation | string | Always getAll. |
Error Port
| Field | Type | Description |
errorCode | string | Machine-readable error code. |
message | string | Human-readable description of the error. |
Sample Output
{
"records": [
{
"Id": "00Q5g000003aXyzEAE",
"FirstName": "Jane",
"LastName": "Doe",
"Company": "Acme Corp",
"Email": "jane.doe@acme.com",
"Status": "Open - Not Contacted",
"LeadSource": "Web",
"CreatedDate": "2026-05-01T08:00:00.000Z"
},
{
"Id": "00Q5g000003bAbcFAE",
"FirstName": "John",
"LastName": "Smith",
"Company": "Beta Ltd",
"Email": "john@beta.com",
"Status": "Open - Not Contacted",
"LeadSource": "Partner Referral",
"CreatedDate": "2026-05-03T10:30:00.000Z"
}
],
"totalSize": 2,
"resource": "lead",
"operation": "getAll"
}
Expression Reference
| Expression | Description |
{{nodes.GetAllLeads.records}} | Array of all returned Lead records. |
{{nodes.GetAllLeads.records[0].Id}} | Salesforce ID of the first lead. |
{{nodes.GetAllLeads.totalSize}} | Number of leads returned. |
{{nodes.GetAllLeads.records[*].Email}} | Array of email addresses across all returned leads. |
Node Policies & GuardRails
| Policy | Detail |
| Credential storage | Store AccessToken in BizFirst Credentials Manager. |
| Query filter safety | Never interpolate unsanitized user input into the Query field. This prevents SOQL injection. |
| Limit enforcement | Always set a Limit in production to prevent unintentional large result sets and excess API quota consumption. |
| Large datasets | For result sets exceeding 2,000 records, use soql/executeWithPagination instead. |
| Error port wiring | Always wire the error port to handle invalid query syntax and permission failures. |
Examples
Batch Process Uncontacted Leads
Retrieve all open uncontacted leads from the last 30 days, then pass the records array into a Loop node to process each lead individually.
{
"Query": "Status = 'Open - Not Contacted' AND CreatedDate = LAST_30_DAYS",
"Limit": 200
}
// Loop node iterates {{nodes.GetAllLeads.records}}
// Inside loop: lead/update sets Status = 'Working - Contacted'
List Leads by Campaign
Retrieve leads from a specific campaign source for a weekly email digest to the marketing team.
{
"Query": "LeadSource = 'Partner Referral' AND CreatedDate = THIS_WEEK",
"Limit": 500
}
Reassign Leads from Departing Rep
When an employee leaves, retrieve all their assigned leads and reassign to a new owner in bulk.
{
"Query": "OwnerId = '0055g000007AbcDEF' AND IsConverted = false",
"Limit": 500
}
// Loop: lead/update with OwnerId = new rep's Salesforce User ID