Load ServiceNow data to BigQuery
Build a ServiceNow to BigQuery pipeline with your coding agent. One prompt scaffolds it with the dltHub AI harness, plus the ServiceNow API base URL, auth, endpoints, and incremental loading.
ServiceNow provides a comprehensive REST API for interacting with instance data, supporting both system-level and scripted custom web services. Everything needed to build a working ServiceNow → BigQuery pipeline is on this page: the API's base URL, authentication, endpoints, pagination and incremental field — plus a prompt that hands the whole job to your coding agent.
Build your ServiceNow to BigQuery pipeline
Paste this prompt into Claude, Codex, or Cursor. The agent does the rest.
uvx dlthub-init@latest to build a pipeline from ServiceNow to BigQuery and run it on dltHubThat scaffolds a dltHub workspace and installs the dltHub AI harness — the project rules, the secrets-management skill, and the dlt MCP server your agent needs to work safely. From there it reads the ServiceNow API, proposes the endpoints to load, then writes, runs and validates the pipeline while you review rather than type. Credentials are inspected through MCP tools, so your agent never reads secrets.toml itself. How the LLM-native workflow works →
Prefer to write it yourself? Every fact the agent uses is below.
ServiceNow API at a glance
| Base URL | https://<instance-name>.service-now.com/api |
| Example endpoint | GET api/now/table/{tableName} |
| Records found at | result |
| Authentication | Supports multiple methods including Basic, OAuth 2.0, and API Key authentication — sent in the Authorization header, prefixed Bearer |
| Pagination | Offset-based via sysparm_offset, page size via sysparm_limit (default 10000). Pagination is handled via the Link header, which contains the URLs for the next, prev, first, and last pages. The sysparm_offset parameter represents the starting record index, and sysparm_limit sets the number of records to return. You can suppress the pagination Link header using sysparm_suppress_pagination_header=true. |
| Incremental field | sys_updated_on |
| API reference | https://www.servicenow.com/docs/r/api-reference/rest-api-explorer/c_RESTAPI.html |
These values come from the ServiceNow API reference — the authoritative source if anything here looks out of date.
How do I authenticate with the ServiceNow API?
ServiceNow REST APIs support Basic authentication (using Authorization: Basic <base64_encoded_creds>), OAuth 2.0 (using Authorization: Bearer ), or API Key authentication (using x-sn-apikey as a header or query parameter). Each request must include valid credentials corresponding to the configured authentication method for the specific endpoint.
1. Get your credentials
- Verify the 'API Key and HMAC Authentication' (com.glide.tokenbased_auth) plugin is activated via System Applications > All > Application Manager. \n2. Navigate to 'System Web Services' > 'API Access Policies' > 'Inbound Authentication Profiles' and create a new profile (select 'Create API Key authentication profiles').\n3. Navigate to 'System Web Services' > 'API Access Policies' > 'REST API Key' and create a new key record. Select the associated user and submit to generate the token.\n4. Open the created REST API Key record, use the lock icon to view the token, and copy it immediately (it may not be viewable again). \n5. Create a 'REST API Access Policy' under 'System Web Services' > 'API Access Policies' to associate the profile with specific REST APIs.
2. Add them to .dlt/secrets.toml
[sources.servicenow_source] x-sn-apikey = "REPLACE_ME"
dlt reads this file automatically at runtime. With the harness, the setup-secrets skill prompts you for the values and never handles the raw credential in chat. For production, see setting up credentials with dlt.
What ServiceNow data can I load into BigQuery?
These are the ServiceNow endpoints dlt can load into BigQuery:
| Resource | Endpoint | Method | Data selector | Description |
|---|---|---|---|---|
| table_records | /api/now/table/{tableName} | GET | result | Retrieve multiple records from a table. |
| table_record | /api/now/table/{tableName}/{sys_id} | GET | result | Retrieve a single record by its sys_id. |
| table_meta | /api/now/table/{tableName} | POST | result | Create a new record in a table. |
| table_update | /api/now/table/{tableName}/{sys_id} | PUT | result | Update an existing record in a table. |
| table_delete | /api/now/table/{tableName}/{sys_id} | DELETE | Delete a record from a table. |
How do I load only new ServiceNow records?
ServiceNow exposes sys_updated_on on api/now/table/{tableName}, so dlt can request only the records that changed since the last run. Set it as the cursor_path and dlt tracks the high-water mark for you between runs.
{"name": "table_records", "endpoint": { "path": "api/now/table/{tableName}", "data_selector": "result", "incremental": {"cursor_path": "sys_updated_on", "initial_value": "2024-01-01T00:00:00Z"}, }}
On the first run dlt loads everything from initial_value; on every run after that it requests only what changed and appends with write_disposition="merge" if you set a primary key. See incremental loading.
What does the generated ServiceNow pipeline look like?
A standard dlt REST API pipeline — the same code you would write by hand, loading /api/now/table and /oauth_token.do from the ServiceNow API into BigQuery:
import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def servicenow_source(x_sn_apikey=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://<instance-name>.service-now.com/api", "auth": {"type": "bearer", "token": x_sn_apikey}, }, "resources": [ {"name": "table_records", "endpoint": {"path": "api/now/table/{tableName}", "data_selector": "result"}}, {"name": "table_record", "endpoint": {"path": "api/now/table/{tableName}/{sys_id}", "data_selector": "result"}} ], } yield from rest_api_resources(config) def load_servicenow_to_bigquery() -> None: pipeline = dlt.pipeline( pipeline_name="servicenow_pipeline", destination="bigquery", dataset_name="servicenow_data", ) load_info = pipeline.run(servicenow_source()) print(load_info) if __name__ == "__main__": load_servicenow_to_bigquery()
Run it with uv run python servicenow_pipeline.py. The agent iterates on this until it loads cleanly — you review and approve, rather than write it from scratch.
How do I query ServiceNow data in BigQuery?
dlt creates one table per resource. Query the loaded data with Python or SQL — or ask your agent to, through the MCP server's execute_sql_query tool.
Python (pandas DataFrame):
import dlt data = dlt.pipeline("servicenow_pipeline").dataset() df = data.table_records.df() print(df.head())
SQL:
SELECT * FROM servicenow_data.table_records LIMIT 10;
See querying your data with dataset and exploring it in marimo notebooks.
How do I deploy the ServiceNow to BigQuery pipeline in production?
The pipeline runs locally, which is ideal for prototyping and one-off analysis. When you need it on a schedule, monitored on every load, and shared with your team, deploy the same dlt code on the dltHub platform — no infrastructure to maintain. The prompt above already ends with "run it on dltHub", so your agent can take it there directly.
- Deploy & schedule — run the pipeline as a managed job with automatic retries.
- Monitor — observable job queues, alerting, and load metrics for every run.
- Transform — promote raw ServiceNow loads into governed, documented models.
- Visualize & share — explore data in notebooks and publish live dashboards instead of static screenshots.
What other destinations can I load ServiceNow data to?
dlt loads into any of these — only the destination argument changes:
| Destination | Example value |
|---|---|
| PostgreSQL | "postgres" |
| BigQuery | "bigquery" |
| Snowflake | "snowflake" |
| Redshift | "redshift" |
| Databricks | "databricks" |
| Filesystem (S3, GCS, Azure) | "filesystem" |
Set dlt.pipeline(destination="snowflake") and add credentials in .dlt/secrets.toml. On the dltHub platform the same pipeline runs against a managed Iceberg lakehouse. See the full destinations list.
Next steps
Was this page helpful?
Community Hub
Need more dlt context for ServiceNow to BigQuery?
Request dlt skills, commands, AGENT.md files, and AI-native context.