How to Automate ServiceNow ITSM (Requests/Approvals, Asset Workflows, Procurement Sync — No API Required)

Mar 5

Introduction

ServiceNow is used for ITSM, service requests, approvals, asset management, and procurement. While ServiceNow offers REST and integration APIs, browser automation provides a powerful solution for request/approval workflows, asset workflows, and procurement sync when API access is limited or when teams rely on the ServiceNow web UI.

Why Use Browser Automation for ServiceNow?

  • Limited API Access: API scope and ACLs can restrict bulk or UI-only workflows
  • Request/Approvals: Submit requests, run approval workflows, and process approvals from the portal when API or Flow is restricted
  • Asset Workflows: Update CMDB, run asset lifecycle workflows, and reconcile from the UI
  • Procurement Sync: Sync POs, vendors, and catalog items to or from external systems when integrations are limited
  • UI-Only Features: Many request and approval views are easiest via the web interface
  • Cross-Application: Operate across Service Portal, ITSM, and SPM in one session
  • Audit: Export activity and request data for governance reviews

Setting Up ServiceNow Automation

Here's how to automate request/approvals, asset workflows, and procurement sync in ServiceNow using browser automation:



import { chromium } from 'playwright';

const response = await fetch("https://api.anchorbrowser.io/api/sessions", {
  method: "POST",
  headers: {
    "anchor-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    'headless': false,
    'proxy': { 'type': 'residential', 'country': 'US' }
  }),
});

const { id } = await response.json();
const connectionString = `wss://connect.anchorbrowser.io?apiKey=YOUR_API_KEY&sessionId=${id}`;

const browser = await chromium.connectOverCDP(connectionString);
const context = browser.contexts()[0];
const ai = context.serviceWorkers()[0];
const page = context.pages()[0];

await page.goto("https://your-instance.service-now.com");

await ai.evaluate(JSON.stringify({
  prompt: 'Log in to ServiceNow using the provided credentials. Complete SSO or 2FA if required and wait for the home or service portal to load.'
}));



Use Case 1: Request/Approvals

Submit requests and run approval workflows from the ServiceNow UI:



const runRequestApprovals = async (page, ai, criteria) => {
  await ai.evaluate(JSON.stringify({
    prompt: criteria.action === 'submit'
      ? 'Navigate to Service Portal or Self-Service > Create request. Open the catalog item or request type.'
      : 'Navigate to My Approvals (or Approvals). Apply filter: pending, request type.'
  }));
  
  await page.waitForLoadState('networkidle');
  
  await ai.evaluate(JSON.stringify({
    prompt: criteria.action === 'submit'
      ? `Fill and submit request: ${criteria.requestType || 'as specified'}. Attach details if provided.`
      : criteria.action === 'approve'
      ? `Approve request(s) matching ${criteria.scope || 'selection'}. Add comment if required.`
      : 'List pending approvals: number, short description, requested for. Return as JSON array.'
  }));
  
  await page.waitForLoadState('networkidle');
  
  const summary = await ai.evaluate(JSON.stringify({
    prompt: 'Return JSON: { processed: number, action: string }.'
  }));
  
  return { ...JSON.parse(summary), completedAt: new Date().toISOString() };
};



Use Case 2: Asset Workflows

Run asset lifecycle and CMDB workflows from the portal:



const runAssetWorkflows = async (page, ai, criteria) => {
  await ai.evaluate(JSON.stringify({
    prompt: criteria.assetType
      ? `Navigate to Hardware/Software Assets or CMDB. Open list or asset form: ${criteria.assetType}.`
      : 'Navigate to Asset Management or Configuration. Open the asset list.'
  }));
  
  await page.waitForLoadState('networkidle');
  
  await ai.evaluate(JSON.stringify({
    prompt: criteria.action === 'update'
      ? `Update asset(s) matching ${criteria.scope || 'selection'}. Set fields as specified. Save.`
      : criteria.action === 'reconcile'
      ? 'Run discovery or reconciliation for the selected scope. Wait for completion or return job ID.'
      : 'List asset summary: name, asset tag, state, assigned to. Return as JSON array.'
  }));
  
  await page.waitForLoadState('networkidle');
  
  const result = await ai.evaluate(JSON.stringify({
    prompt: 'Return summary: assets updated or workflow result. As JSON. No credentials.'
  }));
  
  return { result: typeof result === 'string' ? JSON.parse(result) : result, completedAt: new Date().toISOString() };
};



Use Case 3: Procurement Sync

Sync procurement and catalog data to or from external systems:



const runProcurementSync = async (page, ai, criteria) => {
  await ai.evaluate(JSON.stringify({
    prompt: criteria.syncFrom === 'servicenow'
      ? 'Navigate to Procurement or Catalog. Open POs, vendors, or catalog items. Export list if available.'
      : 'Navigate to Procurement or SPM. Open the module to sync.'
  }));
  
  await page.waitForLoadState('networkidle');
  
  await ai.evaluate(JSON.stringify({
    prompt: criteria.action === 'export'
      ? 'Export PO or catalog list (CSV/Excel). Wait for download.'
      : criteria.action === 'import'
      ? `Create or update records from ${criteria.source || 'provided data'}. Map fields. Submit.`
      : 'List PO or catalog summary. Return as JSON array.'
  }));
  
  const download = await page.waitForEvent('download', { timeout: 20000 }).catch(() => null);
  const path = download ? await download.path() : null;
  
  if (path && criteria.syncTo) {
    await ai.evaluate(JSON.stringify({
      prompt: `Use exported data to sync to ${criteria.syncTo}. Do not expose PII or secrets.`
    }));
  }
  
  return { path, completedAt: new Date().toISOString() };
};



Exporting Activity and Audit Data

Pull request and audit data for compliance:



const exportServiceNowActivity = async (page, ai, scope) => {
  await ai.evaluate(JSON.stringify({
    prompt: scope === 'audit'
      ? 'Navigate to System Security > Audit. Set date range. Export or copy events.'
      : 'Navigate to Requests or Approvals. Export list or report. Wait for download if available.'
  }));
  
  const download = await page.waitForEvent('download', { timeout: 20000 }).catch(() => null);
  return download ? await download.path() : null;
};



Best Practices for ServiceNow Automation

  • Security: Use least-privilege roles and SSO; never log credentials; respect ServiceNow and data governance
  • Request/Approvals: Do not auto-approve without policy; use automation for bulk submit or triage first
  • Asset Workflows: Prefer API where available; use browser for one-off or UI-only updates; audit before bulk changes
  • Procurement Sync: Sync only approved data; redact PII and financial details before sharing externally
  • Rate Limits: Add delays between actions to stay within instance limits
  • Error Handling: Retry on session timeout; handle SSO and 2FA gracefully
  • Compliance: Align automation with your org's ITSM and procurement policies

Handling Authentication

ServiceNow supports SSO (SAML, etc.) and 2FA:



const handleServiceNowAuth = async (page, ai, credentials) => {
  await page.goto("https://your-instance.service-now.com");
  
  await ai.evaluate(JSON.stringify({
    prompt: 'Sign in with the provided credentials. If SSO is required, complete org SSO.'
  }));
  
  await ai.evaluate(JSON.stringify({
    prompt: 'If 2FA is required, enter code from app or device. Wait for ServiceNow home or portal to load.'
  }));
  
  await page.waitForLoadState('networkidle');
};



Resources

Conclusion

Browser automation provides a flexible alternative to API access for ServiceNow ITSM workflows. By using intelligent browser agents, you can automate request/approval workflows, asset workflows, and procurement sync directly from the ServiceNow web UI. Whether you need to submit and approve requests, run asset lifecycle and CMDB workflows, or sync procurement data to external systems, browser automation enables efficient ITSM when API access is limited or when teams work in the portal.

Start automating your ServiceNow requests, asset workflows, and procurement sync today.

Other hubs

See all
No hubs found

Stay ahead in browser automation

We respect your inbox. Privacy policy

Welcome aboard! Thanks for signing up
Oops! Something went wrong while submitting the form.