Salesforce
Salesforce actions enable interactions with the Salesforce API.
All Salesforce actions must use the Salesforce connection instance, created by the login action.
Connection Setup
login
Establishes a connection to Salesforce using provided credentials.
Parameters:
username - Salesforce account username.
password - Salesforce account password.
token - Security token provided by Salesforce.
client_id (Optional)- Client ID for custom apps.
domain (Optional)- Salesforce domain.
organizationId (Optional)- Organization ID for multi-tenant access.
Return:
sf_connection - Salesforce connection instance for further API interactions.
Actions
query
Executes a SOQL query and retrieves data from Salesforce, handling pagination.
Parameters:
sf_connection - Salesforce instance provided by login.
query - SOQL query string to be executed.
Return:
result - List of all retrieved records.
total_size - Total number of records matching the query.
update
Updates or inserts a record in the Salesforce Contact object.
Parameters:
sf_connection - Salesforce instance provided by login.
id - Unique identifier of the record to be updated.
values - Dictionary containing the fields to be updated and their new values.
Return:
status - Response indicating the result of the upsert operation.
describe
Retrieves metadata for the Contact object or a specific Contact record layout.
Parameters:
sf_connection - Salesforce instance provided by login.
id (Optional)- ID of the specific Contact record for layout description.
Return:
items - List of dictionaries for each field, containing:
- label - Human-readable name of the field.
- name - API name of the field.
- type - Data type of the field (e.g., string, number).
- referenceTo - Related Salesforce objects, if applicable.
salesforce.describe
Returns field metadata for a Salesforce object, or layout metadata when a record id is provided. Same behavior as describe.
Parameters:
sf_connection - Salesforce instance from salesforce.login.
table - Salesforce object API name.
id (optional) - when set, calls describe layout for that record (default=None).
Return:
items - list of field dictionaries with label, name, type, and referenceTo.
Exceptions:
This action gives no exceptions
get_all_pages
Retrieve all records from a Salesforce SOQL query, handling pagination automatically.
Parameters:
sf_connection - Salesforce connection instance provided by login.
response - Initial response object returned from a SOQL query.
data - List that will be filled with all records collected across multiple pages.
Return:
data - Complete list of records from all pages of the query, where the "attributes" field has been removed.
Exceptions:
This action returns no Exception.
salesforce.login
Establishes a connection to Salesforce using provided credentials. Same behavior as login.
Parameters:
username - Salesforce account username.
password - Salesforce account password.
token - Security token provided by Salesforce.
client_id (optional) - Client ID for custom apps (default=None).
domain (optional) - Salesforce domain (default=None).
organizationId (optional) - Organization ID for multi-tenant access (default=None).
Return:
sf_connection - Salesforce connection object for further API interactions.
Exceptions:
This action gives no exceptions
salesforce.query
Executes a SOQL query with automatic pagination. Same behavior as query.
Parameters:
sf_connection - Salesforce instance from salesforce.login or login.
query - SOQL query string.
Return:
result - list of all records (attributes field removed from each record).
total_size - total number of records matching the query.
Exceptions:
This action gives no exceptions
salesforce.update
Performs an upsert on any Salesforce object. Same behavior as update.
Parameters:
sf_connection - Salesforce instance from salesforce.login.
table - Salesforce object API name (for example Contact, Account, Lead).
id - external id in the form External_Id__c/value or standard record id for upsert.
values - dictionary of fields to create or update.
Return:
status - upsert response from the API.
Exceptions:
This action gives no exceptions