Worlds / Support
Salesforce Service Cloud API
A local Service Cloud org with Cases, Accounts, Contacts, queues, entitlements and milestones. Test the agent that works the case queue, sets status and escalates on time.
- Base path
/services/data/v59.0- Auth
- OAuth 2.0 bearer token, the world key
- Endpoints
- 15
- Status
- Active today
This reference previews the surface the Salesforce Service Cloud world serves in the closed beta. Paths mirror the public Salesforce Service Cloud 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_SERVICE_CLOUD_URL | This world's origin followed by /services/data/v59.0 |
WORLDS_API_KEY | The world key, accepted wherever Salesforce Service Cloud 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_SERVICE_CLOUD_URL,
accessToken: process.env.WORLDS_API_KEY,
});
const res = await conn.query("SELECT Id, Subject, Status FROM Case LIMIT 10");API reference
Case
Customer issues worked by support agents.
- GET
/services/data/v59.0/sobjects/CaseDescribe the Case object - POST
/services/data/v59.0/sobjects/CaseCreate a case - GET
/services/data/v59.0/sobjects/Case/{id}Get a case - PATCH
/services/data/v59.0/sobjects/Case/{id}Update a case - DELETE
/services/data/v59.0/sobjects/Case/{id}Delete a case
Fields · 7
Id | id | Case id |
CaseNumber | string | Auto-numbered label |
Subject | string | Short summary |
Status | picklist | New, Working, Escalated or Closed |
Priority | picklist | High, Medium or Low |
ContactId | id | Contact who raised it |
OwnerId | id | Agent or queue |
Contact
People at customer 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 |
CaseComment
Public or internal notes on a case.
- POST
/services/data/v59.0/sobjects/CaseCommentAdd a comment - GET
/services/data/v59.0/sobjects/CaseComment/{id}Get a comment
Fields · 4
Id | id | Comment id |
ParentId | id | Case id |
CommentBody | textarea | Comment text |
IsPublished | boolean | Visible to the customer |
Account
Companies you support.
- 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 · 4
Id | id | Account id |
Name | string | Account name |
Industry | picklist | Industry |
OwnerId | id | Account owner |
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 Service Cloud setup for your workflow and review its starting records, including case, contact, casecomment.
- 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
- Case 00001041 Escalated, owner Tier 2 queue
- Case 00001043 still New in Tier 1
- Case 00001042 Closed with Reason and a case comment
- No milestone completed without a reply
- No OwnerId set to an inactive user
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 Service Cloud
version: 2
connector: salesforce-service-cloud
seed: salesforce-service-cloud-starter
mode: isolated
policy: >
Work the Tier 1 queue. Escalate only Premium cases within an hour of their
First Response milestone. Close resolved cases with a Reason and a comment.
Watch for accounts with the same name in different regions.
tasks:
- id: take-a-case-from-a-queue-and-set-its-status
prompt: Take a case from a queue and set its status
- id: escalate-a-case-that-is-about-to-miss-a-milestone
prompt: Escalate a case that is about to miss a milestone
- id: close-a-case-with-the-right-reason-and-comment
prompt: Close a case with the right reason and comment
expected:
- "Case 00001041 Escalated, owner Tier 2 queue"
- Case 00001043 still New in Tier 1
- Case 00001042 Closed with Reason and a case comment
- No milestone completed without a reply
- No OwnerId set to an inactive user
scenarios:
- api-limit-reached
- record-locked
- validation-ruleSee 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 |
record-locked | UNABLE_TO_LOCK_ROW while an assignment rule runs |
validation-rule | FIELD_CUSTOM_VALIDATION_EXCEPTION: Reason required to close |
session-expired | INVALID_SESSION_ID halfway through the batch |
milestone-violation | The clock passes the First Response target |
Starting data
Start each run from the same records and relationships. The overview below describes the Salesforce Service Cloud starter; use the setup supplied for your workflow when preparing your own snapshot.
| Records | Starting setup |
|---|---|
| cases | 50 across New, Working, Escalated and Closed |
| queues | Tier 1, Tier 2, Billing |
| entitlements | Standard and Premium with First Response milestones |
| accounts | 15, two with the same name in different regions |
| escalation rules | 1 active rule on Priority High |
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.
Case records
Case
Customer issues worked by support agents.
| Field | Type | Meaning / relationship |
|---|---|---|
Id | id | Case id |
CaseNumber | string | Auto-numbered label |
Subject | string | Short summary |
Status | picklist | New, Working, Escalated or Closed |
Priority | picklist | High, Medium or Low |
ContactId | id | Contact who raised it |
OwnerId | id | Agent or queue |
{
"Id": "<Case id>",
"CaseNumber": "<Auto-numbered label>",
"Subject": "<Short summary>",
"Status": [],
"Priority": [],
"ContactId": "<Contact who raised it>"
}Contact records
Contact
People at customer 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>"
}CaseComment records
CaseComment
Public or internal notes on a case.
| Field | Type | Meaning / relationship |
|---|---|---|
Id | id | Comment id |
ParentId | id | Case id |
CommentBody | textarea | Comment text |
IsPublished | boolean | Visible to the customer |
{
"Id": "<Comment id>",
"ParentId": "<Case id>",
"CommentBody": "<Comment text>",
"IsPublished": false
}Account records
Account
Companies you support.
| Field | Type | Meaning / relationship |
|---|---|---|
Id | id | Account id |
Name | string | Account name |
Industry | picklist | Industry |
OwnerId | id | Account owner |
{
"Id": "<Account id>",
"Name": "<Account name>",
"Industry": [],
"OwnerId": "<Account owner>"
}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": []
}