ServiceNow

Support OAuth, or username and password

Read and update ServiceNow incidents, requests and any table record from any Windmill script, flow or app.

Set up in 2 steps

1

Connect from the Resources page

Open Resources, click Add a resource/API and find ServiceNow. Enter your instance name, and the client id and secret from your instance's Application Registry.

2

Run your first script

Fork any script below and read before writing anything.

Scripts

Building blocks, if none of the projects above fit. Fork one, run it, or call it as a step inside your own flow.

Submit a script →

Trigger flows from ServiceNow

ServiceNow is not only a destination. These inbound paths are supported today.

New or updated record (scheduled poll)

The New or Updated Record trigger script polls one table and returns the records created or updated since its last run, optionally narrowed by a query. To run it, open a flow, add a trigger and choose Scheduled Poll, then pick the trigger script and an interval. Windmill puts the script first in the flow with a loop after it, so the steps you add run once per new item. The cursor is saved per flow: two flows polling the same source each get every item, and test runs keep a cursor of their own.

Resource type

The shape of the credential every script on this page expects.

FieldTypeRequiredWhat it is
instance_urlstringYesInstance base URL, e.g. https://dev12345.service-now.com (no trailing slash). Every REST call is made against this host.
usernamestringNoBasic auth username. Leave blank when using an OAuth bearer token.
passwordstringNoBasic auth password. Leave blank when using an OAuth bearer token.
tokenstringNoOAuth 2.0 access token (Bearer). Populated automatically when you connect via Windmill's ServiceNow OAuth flow (admin configures the instance + client id/secret in instance settings), or paste one manually. Provide this instead of username/password to authenticate with OAuth.

Questions

Token or username and password?

Either. The scripts build the header from whichever the resource carries, so instance_url plus a token, or instance_url plus a username and password, both work.

A record is not visible

ServiceNow filters every table by the caller's roles. A missing record is usually an ACL rather than a wrong id.

Are my credentials stored on the hub?

Never. They live only in your own Windmill workspace, encrypted at rest.