Create a ServiceNow ingestion pipeline
The ServiceNow connector is in gated Public Preview. To participate in the preview, contact your Databricks account team.
This article describes how to create a ServiceNow ingestion pipeline using Databricks Lakeflow Connect.
Before you begin
To create an ingestion pipeline, you must meet the following requirements:
-
Your workspace is enabled for Unity Catalog.
-
Serverless compute is enabled for your workspace. See Enable serverless compute.
-
If you plan to create a connection: You have
CREATE CONNECTION
privileges on the metastore.If you plan to use an existing connection: You have
USE CONNECTION
privileges orALL PRIVILEGES
on the connection object. -
You have
USE CATALOG
privileges on the target catalog. -
You have
USE SCHEMA
andCREATE TABLE
privileges on an existing schema orCREATE SCHEMA
privileges on the target catalog.
To ingest from ServiceNow, see Configure ServiceNow for Databricks ingestion.
Create the ingestion pipeline
Permissions required: USE CONNECTION
or ALL PRIVILEGES
on a connection.
This step describes how to create the ingestion pipeline. Each ingested table is written to a streaming table with the same name.
- Databricks UI
- Databricks notebook
- Databricks CLI
-
In the sidebar of the Databricks workspace, click Data Ingestion.
-
On the Add data page, under Databricks connectors, click ServiceNow.
The ingestion wizard opens.
-
On the Ingestion pipeline page of the wizard, enter a unique name for the pipeline.
-
In the Destination catalog drop-down menu, select a catalog. Ingested data and event logs will be written to this catalog. You’ll select a destination schema later.
-
Select the Unity Catalog connection that stores the credentials required to access the source data.
If there are no existing connections to the source, click Create connection and enter the authentication details you obtained in Configure ServiceNow for Databricks ingestion. You must have
CREATE CONNECTION
privileges on the metastore. -
Click Create pipeline and continue.
-
On the Source page, select the tables to ingest into Databricks, and then click Next.
If you select All tables, the connector writes all existing and future tables in the source schema to the destination schema. There is a maximum of 250 tables per pipeline.
-
On the Destination page, select the Unity Catalog catalog and schema to write to.
If you don't want to use an existing schema, click Create schema. You must have
USE CATALOG
andCREATE SCHEMA
privileges on the parent catalog. -
Click Save pipeline and continue.
-
(Optional) On the Settings page, click Create schedule. Set the frequency to refresh the destination tables.
-
(Optional) Set email notifications for pipeline operation success or failure.
-
Click Save and run pipeline.
-
Generate a personal access token and copy the token so you can paste it into a notebook later. See Databricks personal access tokens for workspace users.
-
Import the following notebook to your workspace:
Create a ServiceNow ingestion pipeline
-
Modify the following values in the notebook:
Cell 1:
api_token
: The personal access token you generated
Cell 3:
-
name
: A name for the pipeline -
connection_name
: The name of the Unity Catalog connection you created in Catalog Explorer (Catalog > External data > Connections). If you don't have an existing connection to the source, you can create one. You must have theCREATE CONNECTION
privilege on the metastore. -
source_table
: The name of the source table -
destination_catalog
: A name for the destination catalog that will contain the ingested data -
destination_schema
: A name for the destination schema that will contain the ingested data -
scd_type
: The SCD method to use:SCD_TYPE_1
orSCD_TYPE_2
.For more information, see SCD type 1 vs. type 2.
-
Click Run all.
To create the pipeline:
databricks pipelines create --json "<pipeline definition or json file path>"
To edit the pipeline:
databricks pipelines update --json "<pipeline definition or json file path>"
To get the pipeline definition:
databricks pipelines get "<pipeline-id>"
To delete the pipeline:
databricks pipelines delete "<pipeline-id>"
For more information, run:
databricks pipelines --help
databricks pipelines <create|update|get|delete|...> --help
Update your pipeline schedule and notifications
-
After the pipeline has been created, revisit the Databricks workspace, and then click Pipelines.
The new pipeline appears in the pipeline list.
-
To view the pipeline details, click the pipeline name.
-
On the pipeline details page, you can schedule the pipeline by clicking Schedule.
-
To set notifications on the pipeline, click Settings, and then add a notification.