

# Connecting to Workday Live Data Query

You can create a data connection to Workday Live Data Query to run real-time SQL queries against the current data in your Workday tenant from notebooks and Visual ETL in Amazon SageMaker Unified Studio, without copying or moving the data. Workday Live Data Query is a feature of Workday Data Cloud. For queries over large historical datasets that Workday refreshes on a schedule, use Workday Data Connect instead. For more information, see [Connecting to Workday Data Connect](connecting-workday-data-connect.md).

## Prerequisites
<a name="workday-ldq-prerequisites"></a>

Before you create the connection, complete the following in your Workday tenant. For more information, see [Get Started with Workday Live Data Query](https://doc.workday.com/admin-guide/en-us/workday-data-cloud/data-out/workday-live-data-query-/workday-live-data-query.html) in the Workday documentation:
+ Set up an Integration System User (ISU) in your Workday tenant. The ISU must belong to an unconstrained integration system security group that has View Only permission on the domains that secure the tables and fields you want to read. For more information, see [Set Up Live Data Query ISU Authentication in Workday](https://doc.workday.com/admin-guide/en-us/workday-data-cloud/data-out/workday-live-data-query-/set-up-live-data-query-isu-authentication.html?toc=2.1.1) in the Workday documentation.
+ Register an API client for the ISU with the JWT Bearer Grant client grant type and an x509 public certificate, and select Include Workday Owned Scope. Keep the matching RSA private key in PEM format. For more information, see [Generate Public and Private Keys for Workday Live Data Query](https://doc.workday.com/admin-guide/en-us/workday-data-cloud/data-out/workday-live-data-query-/generate-public-and-private-keys-for-workday-live-.html?toc=2.1.7) in the Workday documentation.
+ Confirm the tables and fields you want to query are available in the Data Cloud Catalog. For more information, see [Data Cloud Catalog](https://doc.workday.com/admin-guide/en-us/workday-data-cloud/data-out/data-cloud-catalog.html?toc=2.0) in the Workday documentation.

## Steps to connect to Workday Live Data Query from Amazon SageMaker Unified Studio
<a name="steps-to-connect-to-workday-live-data-query"></a>

1. In the navigation pane, choose **Connections**.

1. Choose **Create connection**.

1. In the gallery, select **Workday Live Data Query**.

1. For **Name**, enter a name for the connection. Optionally, enter a **Description**.

1. Under **Connection properties**, provide the following:

   1. **Host** - The Workday host for your tenant, in the format `<workspace-url>.myworkday.com`.

   1. **Port** - The port used to reach the Workday host, typically `443`.

1. Under **Authentication**, for **Credential source**, choose one of the following:

   1. **Custom OAuth 2.0** - Enter your Workday credentials to store them in a new AWS Secrets Manager secret. Provide the Token URL, Client ID, Workday integration system user, and Private key PEM described in the following list.

   1. **AWS Secrets Manager** - Choose an existing secret in AWS Secrets Manager that contains the credentials.

1. For the **Custom OAuth 2.0** credential source, provide the following:

   1. **Token URL** - The Workday access token endpoint for your tenant, in the format `https://<workspace-url>.myworkday.com/ccx/oauth2/<tenant>/token`.

   1. **Client ID** - The OAuth 2.0 client ID of your Workday tenant. For example, `MThmMWI3YWEtZDZjMS00MzRmLTliZWBeMzg4ZjI2NmI1MjFl4`.

   1. **Workday integration system user** - The user that the signed JWT is issued for. For example, `demo-isu`.

   1. **Private key PEM** - The private key, in PEM format, used to sign the JWT token. Include the `-----BEGIN PRIVATE KEY-----` and `-----END PRIVATE KEY-----` lines.

1. Choose **Create connection**.

## Troubleshooting
<a name="troubleshooting-workday-live-data-query"></a>

**The connection fails with an authentication error**  
Check that the Client ID and Workday integration system user are correct, and that the private key matches the x509 certificate registered for the API client in Workday. The private key must be in PEM format with its line breaks.

**A query returns no data or a table is not found**  
The data that you can query depends on the View Only domain permissions granted to the ISU's security group in your Workday tenant. Tables and fields that the ISU can't access aren't returned. If you change the ISU's security permissions, Workday can take up to 15 minutes to apply the change.