Worlds / Sales and crm
Salesforce API
A local Salesforce org with Leads, Accounts, Contacts, Opportunities, Quotes and validation rules. Test the sales agent that qualifies leads, moves stages and builds quotes.
- Base path
/services/data/v59.0- Auth
- OAuth 2.0 bearer token, the world key
- Endpoints
- 16
- Status
- Active today
This reference previews the surface the Salesforce world serves in the closed beta. Paths mirror the public Salesforce API; the exact subset is confirmed when your workflow is scoped.
Connect
The run gives your agent these bindings. Keep your SDK; change only where it sends requests.
| binding | meaning |
|---|---|
WORLDS_SALESFORCE_URL | This world's origin followed by /services/data/v59.0 |
WORLDS_API_KEY | The world key, accepted wherever Salesforce expects a credential |
WORLDS_WORLD_ID | The isolated world's identity |
import jsforce from "jsforce";
const conn = new jsforce.Connection({
instanceUrl: process.env.WORLDS_SALESFORCE_URL,
accessToken: process.env.WORLDS_API_KEY,
});
const res = await conn.query("SELECT Id, Name, StageName FROM Opportunity LIMIT 10");API reference
Lead
Unqualified prospects.
- POST
/services/data/v59.0/sobjects/LeadCreate a lead - GET
/services/data/v59.0/sobjects/Lead/{id}Get a lead - PATCH
/services/data/v59.0/sobjects/Lead/{id}Update a lead - DELETE
/services/data/v59.0/sobjects/Lead/{id}Delete a lead
Fields · 6
Id | id | Lead id |
FirstName | string | First name |
LastName | string | Last name |
Company | string | Company |
Status | picklist | Open, Working, Qualified and so on |
Email | Email address |
Account
Companies you sell to.
- POST
/services/data/v59.0/sobjects/AccountCreate an account - GET
/services/data/v59.0/sobjects/Account/{id}Get an account - PATCH
/services/data/v59.0/sobjects/Account/{id}Update an account
Fields · 5
Id | id | Account id |
Name | string | Account name |
Industry | picklist | Industry |
AnnualRevenue | currency | Annual revenue |
OwnerId | id | Owner |
Contact
People at accounts.
- POST
/services/data/v59.0/sobjects/ContactCreate a contact - GET
/services/data/v59.0/sobjects/Contact/{id}Get a contact - PATCH
/services/data/v59.0/sobjects/Contact/{id}Update a contact
Fields · 5
Id | id | Contact id |
FirstName | string | First name |
LastName | string | Last name |
Email | Email address | |
AccountId | id | Parent account |
Opportunity
Deals moving through stages.
- POST
/services/data/v59.0/sobjects/OpportunityCreate an opportunity - GET
/services/data/v59.0/sobjects/Opportunity/{id}Get an opportunity - PATCH
/services/data/v59.0/sobjects/Opportunity/{id}Update an opportunity - DELETE
/services/data/v59.0/sobjects/Opportunity/{id}Delete an opportunity
Fields · 6
Id | id | Opportunity id |
Name | string | Deal name |
StageName | picklist | Pipeline stage |
Amount | currency | Deal amount |
CloseDate | date | Expected close |
AccountId | id | Account |
Query
SOQL queries across any object.
- GET
/services/data/v59.0/query?q={soql}Run a SOQL query - GET
/services/data/v59.0/query/{queryLocator}Fetch the next page
Fields · 4
totalSize | integer | Total matching rows |
done | boolean | False if more pages remain |
nextRecordsUrl | string | Path of the next page |
records | array | Result rows |
Test workflow
- Prepare. Select the Salesforce setup for your workflow and review its starting records, including lead, account, contact.
- Connect. Configure your agent with this world's URL and key using the SDK example. Check that it reaches the intended API before running a test.
- Define. Describe the task, expected final changes and records that must stay untouched. Keep expected outcomes separate from the agent's instructions.
- Run and inspect. Use the dashboard or your workflow's generated CLI setup. Review final records and changes, then rerun from the same starting setup with the relevant failure conditions. Use Deployment and CI to automate the same workflow.
What to verify
- 006C1 Closed Won with today's CloseDate
- 006C2 still in Negotiation/Review
- 006A2 in Proposal/Price Quote with NextStep filled
- Every quote at or under 15% or in Pending approval
- No Account OwnerId changed
Test file
A task file names the jobs, the policy your agent is given and what the grader reads back from the world's final state. The agent never sees the expected outcomes.
# worlds/tasks.yaml · Salesforce
version: 2
connector: salesforce
seed: salesforce-starter
mode: isolated
policy: >
Update the pipeline after Friday's calls. Ortiz Labs US sent the contract
back, close it won. Moss & Co is ready for a quote. Discounts above 15% need
approval and account owners never change.
tasks:
- id: convert-a-qualified-lead-to-an-account-contact-and-opportunity
prompt: "Convert a qualified Lead to an Account, Contact and Opportunity"
- id: move-an-opportunity-to-the-next-stage-with-the-required-fields
prompt: Move an Opportunity to the next stage with the required fields
- id: build-a-quote-with-discount-inside-the-approval-threshold
prompt: Build a Quote with discount inside the approval threshold
expected:
- "006C1 Closed Won with today's CloseDate"
- 006C2 still in Negotiation/Review
- 006A2 in Proposal/Price Quote with NextStep filled
- "Every quote at or under 15% or in Pending approval"
- No Account OwnerId changed
scenarios:
- api-limit-reached
- validation-rule
- record-lockedSee Tasks and outcomes for every field, and Deployment and CI to run the file on every pull request.
Failure conditions
Each one fires before the handler, at the same step on every run.
| condition | what the agent sees |
|---|---|
api-limit-reached | REQUEST_LIMIT_EXCEEDED on the next call |
validation-rule | FIELD_CUSTOM_VALIDATION_EXCEPTION on the stage change |
record-locked | UNABLE_TO_LOCK_ROW while an approval process runs |
duplicate-rule | DUPLICATES_DETECTED when creating an Account |
session-expired | INVALID_SESSION_ID mid batch |
Starting data
Start each run from the same records and relationships. The overview below describes the Salesforce starter; use the setup supplied for your workflow when preparing your own snapshot.
| Records | Starting setup |
|---|---|
| leads | 40 across Open, Working and Closed statuses |
| accounts | 20, two with the same name |
| opportunities | 30 from Qualification to Closed Won |
| quotes | 8 with line items from the Standard Price Book |
| validation rules | Close Date and Next Step required past Proposal |
The record shapes below reuse this world's API field definitions. They show illustrative values and placeholders, not an importable seed. API responses and seed input can differ; include all required records and references in the accepted import format for your workflow.
Lead records
Lead
Unqualified prospects.
| Field | Type | Meaning / relationship |
|---|---|---|
Id | id | Lead id |
FirstName | string | First name |
LastName | string | Last name |
Company | string | Company |
Status | picklist | Open, Working, Qualified and so on |
Email | Email address |
{
"Id": "<Lead id>",
"FirstName": "<First name>",
"LastName": "<Last name>",
"Company": "<Company>",
"Status": [],
"Email": "person@example.test"
}Account records
Account
Companies you sell to.
| Field | Type | Meaning / relationship |
|---|---|---|
Id | id | Account id |
Name | string | Account name |
Industry | picklist | Industry |
AnnualRevenue | currency | Annual revenue |
OwnerId | id | Owner |
{
"Id": "<Account id>",
"Name": "<Account name>",
"Industry": [],
"AnnualRevenue": "<Annual revenue>",
"OwnerId": "<Owner>"
}Contact records
Contact
People at accounts.
| Field | Type | Meaning / relationship |
|---|---|---|
Id | id | Contact id |
FirstName | string | First name |
LastName | string | Last name |
Email | Email address | |
AccountId | id | Parent account |
{
"Id": "<Contact id>",
"FirstName": "<First name>",
"LastName": "<Last name>",
"Email": "person@example.test",
"AccountId": "<Parent account>"
}Opportunity records
Opportunity
Deals moving through stages.
| Field | Type | Meaning / relationship |
|---|---|---|
Id | id | Opportunity id |
Name | string | Deal name |
StageName | picklist | Pipeline stage |
Amount | currency | Deal amount |
CloseDate | date | Expected close |
AccountId | id | Account |
{
"Id": "<Opportunity id>",
"Name": "<Deal name>",
"StageName": [],
"Amount": "<Deal amount>",
"CloseDate": "<Expected close>",
"AccountId": "<Account>"
}Query records
Query
SOQL queries across any object.
| Field | Type | Meaning / relationship |
|---|---|---|
totalSize | integer | Total matching rows |
done | boolean | False if more pages remain |
nextRecordsUrl | string | Path of the next page |
records | array | Result rows |
{
"totalSize": 1,
"done": false,
"nextRecordsUrl": "<Path of the next page>",
"records": []
}