Skip to content

Salesforce Tool

Salesforce Tool reads information from your Salesforce account: accounts, contacts, opportunities, cases or any other object your user has access to. Queries are written in SOQL, Salesforce’s query language.

You can use it as a tool, connecting its Tool output to the Tools input of an agent: the agent writes the query based on what it is asked and answers with the records. You can also use it as a step in the flow, writing the query yourself in Query to execute.

When to use it

  • A sales rep asks the assistant “Which opportunities do I have open this month?”.
  • You want a support agent to check a customer’s open cases before replying.
  • A flow pulls every Monday the list of opportunities closing that week.
  • You need to combine Salesforce data with another source in a flow.

Configuration

You need a Salesforce Rest API credential with your Salesforce username, password, security token and domain (login for production, test for a sandbox). See Credentials.

FieldWhat it does
Credential (required)The Salesforce Rest API credential used to access your account.
Query to executeThe SOQL query run with the Data output, for example SELECT Name, Amount FROM Opportunity WHERE IsClosed = false. As a tool, the agent writes the query.

Output

  • Tool: connects to an agent’s Tools input. The agent receives the records each query returns.
  • Data: a list with one item per record found, with the fields you asked for in the query.

Example

A software company wants its sales team to query Salesforce from the chat.

  1. Add Salesforce Tool and pick the Salesforce Rest API credential.
  2. Connect the Tool output to the agent’s Tools input.
  3. In the agent’s instructions, say which objects and fields you use, for example that an opportunity’s value is in Amount.
  4. A sales rep asks “What are my five largest open opportunities?”. The agent queries Salesforce and answers with the list.

Good practices

  • The component only reads data; it does not create or change records.
  • If the login fails or the query in Query to execute has an error, the component fails with Salesforce’s message. As a tool, the agent receives that message and can correct its query.
  • If Domain is empty, login (production) is used.
  • The agent sees everything the credential’s user can see. Use a user with access only to what is needed.