The ServiceNow component allows you to interact with your ServiceNow instance via REST API. This component provides actions to query and manipulate ServiceNow records, and triggers to poll for new and updated records.
To build an integration flow, you must configure OAuth 2.0 authentication:
Before configuring the component, you need to set up OAuth 2.0 in your ServiceNow instance. For detailed instructions, see the ServiceNow OAuth Applications documentation.
Create OAuth Application – Navigate to System OAuth → Application Registry → New → New Inbound Integration Experience → OAuth - Authorization code grant
https://{your-tenant-address}/callback/oauth2useraccount scope grants access to all resources available to the signed-in user. Use this scope with caution as it may introduce security risks. Consider creating a more restrictive scope for your integration.https://<instance>.service-now.com/oauth_auth.dohttps://<instance>.service-now.com/oauth_token.douseraccount as the auth scope, enter: useraccounthttps://dev12345.service-now.com or https://yourcompany.service-now.com.v1 or v2). Only specify this value to use an endpoint version other than the latest. If not specified, the latest version will be used.5) – How many times requests are retried when throttled.10000) – Wait time in milliseconds before the next retry.Please Note: The OAuth Application User must have appropriate roles (e.g.,
rest_api_explorerorweb_service_admin) to access the Table API.
Deletes a single record from a ServiceNow table by its unique identifier (sys_id).
Configuration:
incidentInput:
{
"sysId": "abc123def456"
}
Output:
{
"statusCode": 204,
"deletedSysId": "abc123def456"
}
Please Note: If the record does not exist, ServiceNow will return a 404 error, which will be propagated as an error in the action.
Retrieves a single record from a ServiceNow table by its unique identifier (sys_id).
false) – Return display values instead of sys_ids for reference fields.The output message contains a single object with properties specific to the selected table. Common fields include:
Configuration:
incidentInput:
{
"sysId": "abc123def456",
"fields": "number,short_description,state,priority",
"displayValue": true
}
Output:
{
"sys_id": "abc123def456",
"number": "INC0010001",
"short_description": "User cannot access email",
"state": "In Progress",
"priority": "High"
}
Retrieves multiple records from a ServiceNow table. Can emit records individually or as pages.
incident, sys_user, cmdb_ci).Emit individually – Each record is emitted as a separate message.Emit page – Records are emitted in pages as arrays.100) – Maximum number of records to return per request. Must be between 1 and 10000.priority=1^state=2 – Records with priority=1 AND state=2short_descriptionCONTAINSemail – Records containing “email” in short_descriptionsys_created_on>=javascript:gs.dateGenerate('2024-01-01','00:00:00') – Records created after a datefalse) – Return display values instead of sys_ids for reference fields.The output structure depends on the selected Emit Behavior:
Configuration:
incidentEmit individuallyInput:
{
"pageSize": 50,
"query": "state=2^priority=1",
"fields": ["sys_id", "number", "short_description", "priority", "state"],
"displayValue": true
}
Output: Multiple messages, each containing one incident record.
Sends a custom HTTP request to the ServiceNow REST API. Use this action when you need functionality not covered by prebuilt actions.
None.
GET, POST, PATCH, PUT, DELETE./api/now/table/incident – Access the incident table/api/now/table/incident/{sys_id} – Access a specific incident/api/now/table/sys_user – Access the user tableInput:
{
"method": "POST",
"url": "/api/now/table/incident",
"data": {
"short_description": "User cannot access email",
"urgency": "2",
"impact": "2",
"category": "inquiry"
}
}
Creates a new record or updates an existing record in a ServiceNow table based on the selected operation.
Create – Inserts a new record into the table.Update – Updates an existing record identified by sys_id.The input metadata is dynamically generated based on the selected Table Name. After selecting a table, the input metadata will show all available fields for that table with their appropriate types.
The metadata is generated after you select a table name in the configuration.
The output message contains a single object with properties specific to the selected table. Common fields include:
Configuration:
incidentCreateInput:
{
"short_description": "User cannot access email",
"urgency": "2",
"impact": "2",
"category": "inquiry",
"caller_id": "abc123def456"
}
Output:
{
"sys_id": "abc123def456",
"number": "INC0010001",
"short_description": "User cannot access email",
"urgency": "2",
"impact": "2",
"category": "inquiry",
"sys_created_on": "2024-01-15 10:30:00",
"sys_created_by": "admin"
}
Configuration:
incidentUpdateInput:
{
"sysId": "abc123def456",
"incident_state": "3",
"work_notes": "Issue resolved by restarting service",
"resolved_at": "2024-01-15 11:45:00",
"close_code": "Solved (Work Around)"
}
Please Note: For update operations, only include the fields you want to modify. The
sysIdfield is required. All other fields shown in the input metadata are optional and will only be updated if you provide values for them.
Output:
{
"sys_id": "abc123def456",
"number": "INC0010001",
"short_description": "User cannot access email",
"incident_state": "3",
"work_notes": "Issue resolved by restarting service",
"resolved_at": "2024-01-15 11:45:00",
"close_code": "Solved (Work Around)",
"sys_updated_on": "2024-01-15 11:45:00",
"sys_updated_by": "admin"
}
Please Note:
- For create operations, if the record creation fails, an error will be thrown.
- For update operations, if the record with the specified sys_id does not exist, ServiceNow will return a 404 error, which will be propagated as an error in the action.
Polls for new and updated records from a ServiceNow table based on a date field. The trigger uses snapshot to track the last processed timestamp and only fetches records that have been created or updated since the last execution.
sys_updated_on) – Field name to use for filtering records by date. The list is dynamically populated based on the selected table and includes:
sys_updated_on – Last modification timestamp (default)sys_created_on – Creation timestampopened_at, resolved_at, due_date, etc.)YYYY-MM-DD HH:mm:ss). If not specified, defaults to 1970-01-01 00:00:00. The trigger will use snapshot to track the last processed timestamp, so this is only used for the first execution.state=2^priority=1). This will be combined with the date filter.100) – Maximum number of records to fetch per request. Must be between 1 and 100.Emit individually – Each record is emitted as a separate message.Emit page – Records are emitted as an array.The output structure depends on the selected Emit Behavior:
Please Note:
- The trigger uses snapshot to track progress. Each execution will automatically continue from where the previous execution left off.
- If you want to reset the polling, you can clear the snapshot or change the Start Time.
- The date field format should match ServiceNow’s format:
YYYY-MM-DD HH:mm:ss.- Records are ordered by the date field to ensure consistent processing.