Worlds / Eng and it ops
ServiceNow API
A local ServiceNow instance with incidents, requested items, change requests, approvals and CMDB configuration items. Test the IT agent that triages, resolves and routes tickets and respects change windows.
- Base path
/api/now- Auth
- OAuth bearer token or basic auth, the world key
- Endpoints
- 14
- Status
- Active today
This reference previews the surface the ServiceNow world serves in the closed beta. Paths mirror the public ServiceNow 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_SERVICENOW_URL | This world's origin followed by /api/now |
WORLDS_API_KEY | The world key, accepted wherever ServiceNow expects a credential |
WORLDS_WORLD_ID | The isolated world's identity |
const base = process.env.WORLDS_SERVICENOW_URL;
const res = await fetch(base + "/api/now/table/incident?sysparm_limit=20&sysparm_query=active=true", {
headers: {
Authorization: "Bearer " + process.env.WORLDS_API_KEY,
Accept: "application/json",
},
});
const { result } = await res.json();API reference
Incidents
Break and fix tickets in the incident table.
- GET
/api/now/table/incidentList incidents - POST
/api/now/table/incidentCreate an incident - GET
/api/now/table/incident/{sys_id}Get an incident - PATCH
/api/now/table/incident/{sys_id}Update an incident - DELETE
/api/now/table/incident/{sys_id}Delete an incident
Fields · 6
sys_id | string | Record id |
number | string | Number such as INC0010001 |
short_description | string | Summary |
state | string | New, In Progress, On Hold, Resolved or Closed |
priority | string | 1 critical through 5 planning |
assigned_to | reference | Assignee |
Change requests
Planned changes with risk and approval state.
- GET
/api/now/table/change_requestList change requests - POST
/api/now/table/change_requestCreate a change request - PATCH
/api/now/table/change_request/{sys_id}Update a change request
Fields · 5
sys_id | string | Record id |
number | string | Number such as CHG0030001 |
type | string | Normal, Standard or Emergency |
risk | string | Risk rating |
approval | string | Approval state |
Users
People who raise and work tickets.
- GET
/api/now/table/sys_userList users - GET
/api/now/table/sys_user/{sys_id}Get a user - GET
/api/now/table/sys_user_groupList groups
Fields · 5
sys_id | string | Record id |
user_name | string | User name |
name | string | Full name |
email | string | |
department | reference | Department |
Knowledge articles
Published how-to and fix articles.
- GET
/api/now/table/kb_knowledgeList knowledge articles - GET
/api/now/table/kb_knowledge/{sys_id}Get a knowledge article - POST
/api/now/table/kb_knowledgeCreate a knowledge article
Fields · 5
sys_id | string | Record id |
number | string | Number such as KB0010001 |
short_description | string | Title |
text | string | Article body |
workflow_state | string | Draft, review or published |
Test workflow
- Prepare. Select the ServiceNow setup for your workflow and review its starting records, including incidents, change requests, users.
- 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
- INC0041201 assigned to Network
- INC0041188 resolved with close notes
- INC0041190 still In Progress
- CHG0030112 still in Assess
- No CMDB records 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 · ServiceNow
version: 2
connector: servicenow
seed: servicenow-starter
mode: isolated
policy: >
Work the Service Desk queue. Resolve incidents with a confirmed fix using
the right close code and notes, and route anything else to its owning group.
Do not touch change requests.
tasks:
- id: triage-incidents-with-category-priority-and-assignment-group
prompt: "Triage incidents with category, priority and assignment group"
- id: resolve-incidents-with-a-close-code-and-close-notes
prompt: Resolve incidents with a close code and close notes
- id: move-change-requests-through-approval-inside-a-change-window
prompt: Move change requests through approval inside a change window
expected:
- INC0041201 assigned to Network
- INC0041188 resolved with close notes
- INC0041190 still In Progress
- CHG0030112 still in Assess
- No CMDB records changed
scenarios:
- rate-limited
- acl-denied
- business-rule-abortSee 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 |
|---|---|
rate-limited | The Table API returns 429 |
acl-denied | Writing to change_request returns 403 |
business-rule-abort | An update without close notes is rejected as invalid |
token-expired | The OAuth token expires mid run |
outside-window | A change scheduled outside the window is blocked |
Starting data
Start each run from the same records and relationships. The overview below describes the ServiceNow starter; use the setup supplied for your workflow when preparing your own snapshot.
| Records | Starting setup |
|---|---|
| incidents | 120 across New, In Progress, On Hold, Resolved and Closed |
| change requests | 15 normal and standard changes with approvals |
| cmdb | 300 configuration items with relationships |
| assignment groups | Service Desk, Network, Database and Apps |
| change windows | Weekly maintenance windows and a freeze period |
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.
An incident's assigned_to references a user by sys_id. Users can reference a department. Include the users, groups and configuration items needed by your incident and change workflows; a record number such as INC0010001 is a display identifier, not the relationship key.
Incidents records
Incidents
Break and fix tickets in the incident table.
| Field | Type | Meaning / relationship |
|---|---|---|
sys_id | string | Record id |
number | string | Number such as INC0010001 |
short_description | string | Summary |
state | string | New, In Progress, On Hold, Resolved or Closed |
priority | string | 1 critical through 5 planning |
assigned_to | reference | Assignee |
{
"sys_id": "incident_example",
"number": "INC0010001",
"short_description": "VPN connection unavailable",
"state": "New",
"priority": "3",
"assigned_to": "user_example"
}Change requests records
Change requests
Planned changes with risk and approval state.
| Field | Type | Meaning / relationship |
|---|---|---|
sys_id | string | Record id |
number | string | Number such as CHG0030001 |
type | string | Normal, Standard or Emergency |
risk | string | Risk rating |
approval | string | Approval state |
{
"sys_id": "change_example",
"number": "CHG0030001",
"type": "Normal",
"risk": "Moderate",
"approval": "Requested"
}Users records
Users
People who raise and work tickets.
| Field | Type | Meaning / relationship |
|---|---|---|
sys_id | string | Record id |
user_name | string | User name |
name | string | Full name |
email | string | |
department | reference | Department |
{
"sys_id": "user_example",
"user_name": "alex.support",
"name": "Alex Support",
"email": "alex@example.test",
"department": "department_example"
}Knowledge articles records
Knowledge articles
Published how-to and fix articles.
| Field | Type | Meaning / relationship |
|---|---|---|
sys_id | string | Record id |
number | string | Number such as KB0010001 |
short_description | string | Title |
text | string | Article body |
workflow_state | string | Draft, review or published |
{
"sys_id": "article_example",
"number": "KB0010001",
"short_description": "Restore VPN access",
"text": "Check the connection and sign in again.",
"workflow_state": "published"
}