Portal Community

lead/getAll

Query and retrieve multiple Lead records from Salesforce using an optional filter and limit.

When to Use

Configuration

Connection

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

Operation Fields

FieldTypeRequiredDescription
QuerystringoptionalSOQL-style WHERE clause filter applied to Lead records, e.g. Status = 'Open - Not Contacted'. Omit to return all accessible leads (subject to Limit).
LimitintoptionalMaximum 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 CodeCondition
CFG_INVALIDNode settings could not be resolved.
CFG_MISSING_INSTANCEInstanceUrl is missing or empty.
CFG_MISSING_TOKENAccessToken is missing or empty.
UNEXPECTED_ERRORUnexpected exception during execution.

Output

Success Port

FieldTypeDescription
recordsarrayArray of Lead objects. Each object contains the full Lead field set from the Salesforce REST API.
totalSizeintTotal number of records returned in this response.
resourcestringAlways lead.
operationstringAlways getAll.

Error Port

FieldTypeDescription
errorCodestringMachine-readable error code.
messagestringHuman-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

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

PolicyDetail
Credential storageStore AccessToken in BizFirst Credentials Manager.
Query filter safetyNever interpolate unsanitized user input into the Query field. This prevents SOQL injection.
Limit enforcementAlways set a Limit in production to prevent unintentional large result sets and excess API quota consumption.
Large datasetsFor result sets exceeding 2,000 records, use soql/executeWithPagination instead.
Error port wiringAlways 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