> ## Documentation Index
> Fetch the complete documentation index at: https://docs.noxus.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Salesforce

> Connect a Salesforce org and read or write its contacts, accounts, cases and any other object

Noxus reads and writes Salesforce records: contacts, accounts, cases, and records of any standard or custom object. A Salesforce connection points at one org and offers two ways to sign in:

| Method | What you enter | When to use it |
| :- | :- | :- |
| **Access Token** | The instance URL and an access token | You already have a token and will replace it when it expires |
| **Client Credentials** | The instance URL and a Connected App's consumer key and secret | Flows that run unattended. Noxus gets a new token by itself |

## Connect with client credentials

**1. Prepare a Connected App in Salesforce**

In your Connected App, turn on **Enable Client Credentials Flow** and set a **Run As** user. Copy the app's **Consumer Key** and **Consumer Secret**.

**2. Add the connection in Noxus**

Open **Connections** → **Add connection** → **Salesforce**, then **Client Credentials**. Enter:

* **Instance URL**: your org's address, for example `https://yourcompany.my.salesforce.com`. It must start with `https://`.
* **Consumer Key**
* **Consumer Secret**

Click **Connect**. Noxus requests a token from your org and checks it when you save. If Salesforce refuses the key or secret, the connection shows **Invalid** with Salesforce's reason.

While a flow runs, Noxus requests a fresh token when the current one is about to expire, so the connection keeps working without changes.

## Connect with an access token

Open **Connections** → **Add connection** → **Salesforce**, then **Access Token**. Enter the **Instance URL** (it must start with `https://`) and the **Access Token**, then click **Connect**. Noxus checks the token against your org when you save. A token that Salesforce refuses marks the connection **Invalid** with "Invalid or expired access token".

Noxus uses the token as you entered it and does not renew it. When it expires, enter a new one in the connection, or switch to client credentials.

## Nodes

In the flow editor, the Salesforce nodes are under **Integrations** → **Salesforce**. Each node has a **Connection** field to pick which Salesforce connection it uses. Every text field can hold a fixed value or a variable from earlier in the flow. Agents can also use these nodes as tools.

| Node | What it does |
| :- | :- |
| [Query Records](#query-records) | Reads records of any object with your own fields, filter and order |
| [Create Salesforce Record](#create-salesforce-record) | Creates a record of any object |
| [Update Salesforce Record](#update-salesforce-record) | Updates a record of any object |
| [Create Salesforce Contact](#create-salesforce-contact) | Creates a contact |
| [Get Contact](#get-contact) | Reads one contact by its ID |
| [Find Contact](#find-contact) | Finds contacts by email, phone or name |
| [Find Account](#find-account) | Finds accounts by name, account number, phone or website |
| [Create Salesforce Case](#create-salesforce-case) | Creates a case |
| [Get Salesforce Case](#get-salesforce-case) | Reads one case by its ID |
| [Update Salesforce Case](#update-salesforce-case) | Changes a case, including closing it |

Fields under advanced settings are marked *(advanced)* below. Outputs that hold records are JSON text.

### Query Records

Runs a SOQL query on any object, standard or custom.

| Field | Default | What it does |
| :- | :- | :- |
| **Object** | Empty (required) | The object's API name, for example `Account`, `Contact` or `MyObject__c` |
| **Fields** | Empty | Field API names to return, separated by commas. `Id` is always added. Left empty, only `Id` is returned |
| **Where Clause** | Empty | A SOQL filter without the `WHERE` keyword, for example `Status__c = 'Active'` |
| **Order By** | Empty | A SOQL sort without the `ORDER BY` keyword, for example `CreatedDate DESC` |
| **Limit** *(advanced)* | `10` | The maximum number of records |

Outputs: **records** (the matching records as JSON) and **count** (how many were found).

### Create Salesforce Record

Creates a record of any object.

| Field | Default | What it does |
| :- | :- | :- |
| **Object** | Empty (required) | The object's API name, for example `Lead`, `Opportunity` or `MyObject__c` |
| **Fields** | No rows | One row per field: the field's API name and its value. At least one row is required |

Outputs: **record\_id** (the new record's ID) and **success** (`true`).

### Update Salesforce Record

Changes fields on one record of any object.

| Field | Default | What it does |
| :- | :- | :- |
| **Object** | Empty (required) | The object's API name |
| **Record ID** | Empty (required) | The ID of the record to change |
| **Fields** | No rows | One row per field to change: the field's API name and its new value. At least one row is required |

Output: **success** (`true`).

### Create Salesforce Contact

| Field | Default | What it does |
| :- | :- | :- |
| **First Name** | Empty | |
| **Last Name** | Empty (required) | |
| **Email** | Empty | |
| **Phone** | Empty | |
| **Title** *(advanced)* | Empty | Job title |
| **Department** *(advanced)* | Empty | |
| **Account ID** *(advanced)* | Empty | The account the contact belongs to |
| **Description** *(advanced)* | Empty | |

Outputs: **contact\_id** (the new contact's ID) and **success** (`true`).

### Get Contact

| Field | Default | What it does |
| :- | :- | :- |
| **Contact ID** | Empty (required) | The contact's Salesforce ID |

Output: **contact\_data** (the contact record as JSON).

### Find Contact

Fill in at least one search field. A contact matches if it matches any of them: the same email, the same phone, or a name that contains the text.

| Field | Default | What it does |
| :- | :- | :- |
| **Email** | Empty | Exact email address |
| **Phone** | Empty | Exact phone number |
| **Name** | Empty | Text the contact's name contains |
| **Limit** *(advanced)* | `10` | The maximum number of contacts |

Outputs: **contacts** (the matches as JSON, each with its ID, first and last name, email, phone, title, department and account ID) and **count**.

### Find Account

Fill in at least one search field. An account matches if it matches any of them: a name that contains the text, or the same account number, phone or website.

| Field | Default | What it does |
| :- | :- | :- |
| **Name** | Empty | Text the account's name contains |
| **Account Number** | Empty | Exact account number |
| **Phone** | Empty | Exact phone number |
| **Website** | Empty | Exact website |
| **Limit** *(advanced)* | `10` | The maximum number of accounts |

Outputs: **accounts** (the matches as JSON, each with its ID, name, account number, phone, website, industry, type, billing city and billing country) and **count**.

### Create Salesforce Case

| Field | Default | What it does |
| :- | :- | :- |
| **Subject** | Empty (required) | A short description of the case |
| **Status** | New | New, Working or Escalated |
| **Priority** | Medium | Low, Medium, High or Critical |
| **Origin** | None | Phone, Email or Web |
| **Type** | Empty | For example Question or Problem |
| **Reason** *(advanced)* | Empty | |
| **Contact ID** | Empty | The related contact |
| **Account ID** | Empty | The related account |
| **Description** | Empty | The full description |

Outputs: **case\_id** (the new case's ID) and **success** (`true`).

### Get Salesforce Case

| Field | Default | What it does |
| :- | :- | :- |
| **Case ID** | Empty (required) | The case's Salesforce ID |

Output: **case\_data** (the case record as JSON).

### Update Salesforce Case

Only the fields you set are changed. Set **Status** to Closed to close the case.

| Field | Default | What it does |
| :- | :- | :- |
| **Case ID** | Empty (required) | The case to change |
| **Status** | No change | New, Working, Escalated or Closed |
| **Priority** | No change | Low, Medium, High or Critical |
| **Origin** | No change | Phone, Email or Web |
| **Subject** | Empty | Left empty, the subject stays as it is |
| **Type** | Empty | Left empty, the type stays as it is |
| **Reason** *(advanced)* | Empty | Left empty, the reason stays as it is |
| **Description** | Empty | Left empty, the description stays as it is |

Output: **success** (`true`).

## Triggers

A flow can start when a Salesforce contact is created or updated. In the flow editor, open **Triggers** and search for "Salesforce".

| Trigger | Starts the flow when |
| :- | :- |
| Salesforce Contact Created | A new contact is created |
| Salesforce Contact Updated | A contact is updated |

Salesforce sends the events to Noxus: the trigger shows a **Webhook URL**, and you point a Salesforce Platform Event or Change Data Capture notification at it. The trigger's fields:

| Field | Default | What it does |
| :- | :- | :- |
| **Trigger On** | New Contact Created | New Contact Created or Contact Updated |
| **Email Filter** | Empty (all contacts) | Only contacts whose email contains this text, for example `@example.com` |
| **Department Filter** | Empty (all contacts) | Only contacts in one of these departments |

The flow receives the contact's ID, first name, last name, email, phone, title, department, account ID, created date and last modified date. Contact Created starts the flow once per contact ID, even if Salesforce sends the same contact again (it remembers the last 1,000 contacts).

## When a node fails

| Message | What to do |
| :- | :- |
| Salesforce credentials not configured | Pick a connection in the node's **Connection** field, or add one. |
| At least one search parameter is required | Fill in at least one search field of Find Contact or Find Account. |
| At least one field is required | Add a row to **Fields** in Create Salesforce Record or Update Salesforce Record. |
| Salesforce authentication failed | Check the consumer key and secret, and that the Connected App allows the client credentials flow. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.