ServiceNow
Support OAuth (client credentials or sign-in), or username and passwordRead and update ServiceNow incidents, requests and any table record from any Windmill script, flow or app.
Set up in 4 steps
Create an OAuth client in ServiceNow
A ServiceNow admin registers an OAuth API endpoint for external clients (System OAuth, Application Registry) and sets its OAuth Application User. Client credentials also need the system property glide.oauth.inbound.client.credential.grant_type.enabled set to true. Scripts using client credentials act as that user, so give it only the roles they need.
Connect as the service user
Under Others in the Add a resource dialog, pick servicenow and enter the instance name (dev12345) and the client id and secret. No Windmill admin is needed; use this lane for shared and scheduled flows.
Or share one service account from the instance
The Windmill instance admin adds ServiceNow under Instance settings → Authentication → OAuth with that client id and secret and the instance name, and picks Client credentials (or Both) under These credentials are for. Users then pick ServiceNow under Instance-configured OAuth APIs and click Connect without entering an id or secret, which stays on the Windmill server. Every read-write member of every workspace on the Windmill instance can connect this way.
Or sign in as yourself
To act as each person, the Windmill instance admin adds ServiceNow (instance name, client id and secret, Authorization code or Both) under Instance settings → Authentication → OAuth. Users then click Connect under Instance-configured OAuth APIs; one Windmill instance signs in to one ServiceNow instance.
Scripts
Building blocks, if none of the projects above fit. Fork one, run it, or call it as a step inside your own flow.
Update change request
Get change next states
Create incident
Create change request
Close change request
New or Updated Record
Upload Attachment
Update Record
List Tables
List Records
List Attachments
Insert Into Import Set
Get Record
Get Import Set Result
Get Current User
Download Attachment
Delete Record
Delete Attachment
Create Record
Aggregate Records
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. To run it, open a flow, add a trigger and choose Scheduled Poll, then pick the trigger script and an interval. The steps after it run once per new item, and each flow keeps its own cursor.
Resource type
The shape of the credential every script on this page expects.
servicenow
View raw schema →| Field | Type | Required | What it is |
|---|---|---|---|
| instance_url | string | Yes | Instance base URL, e.g. https://dev12345.service-now.com (no trailing slash). Every REST call is made against this host. |
| username | string | No | Basic auth username. Leave blank when using an OAuth bearer token. |
| password | string | No | Basic auth password. Leave blank when using an OAuth bearer token. |
| token | string | No | OAuth 2.0 access token (Bearer). Populated automatically when you connect with OAuth (client credentials under Others, or sign-in once the instance admin configures ServiceNow 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 send the token when the resource has one, and Basic auth otherwise.
A record is not visible
ServiceNow filters every table by the caller's roles, so a missing record is usually an ACL rather than a wrong id.
There is no Connect button on my instance
Signing in as yourself, or the shared service account, needs the Windmill instance admin to configure ServiceNow first. Your own client credentials under Others, or a username and password, need no admin.
Are my credentials stored on the hub?
Never. They live only in your own Windmill workspace, encrypted at rest.