> For the complete documentation index, see [llms.txt](https://docs.redivis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.redivis.com/guides/analyze-data-in-a-workflow/example-workflows/using-synthetic-data.md).

# Using synthetic data

When working with high-risk or restricted data, you can develop and test a workflow using a synthetic dataset before running the workflow on the non-synthetic dataset. In this example, we'll use a synthetic version of the CMS Patient Data to develop an analysis, then switch the data source to the corresponding non-synthetic dataset.&#x20;

{% embed url="<https://stanfordphs.redivis.com/datasets/7c8v-a18078dx6>" %}

{% embed url="<https://stanfordphs.redivis.com/datasets/3jkm-0tyt0n0v7>" %}

## 1. Create a Workflow

[Create a new workflow](/guides/analyze-data-in-a-workflow.md) and add the CMS Synthetic Patient Dataset as a data source.

<div data-with-frame="true"><figure><img src="https://1672950126-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LVodLwUXgJUGcm5Cvso%2Fuploads%2FV2mK0fzNhoKXAOpcjYlT%2Fstanfordphs.redivis.com_datasets_7c8v-a18078dx6.png?alt=media&amp;token=cd50ae23-e895-40aa-8af4-61ccc357bf77" alt=""><figcaption></figcaption></figure></div>

The synthetic dataset provides the tables and variables needed to develop the analysis without requiring access to the underlying patient data.

## 2. Build and test your analysis pipeline

Use the synthetic dataset to [build your workflow](https://docs.redivis.com/guides/analyze-data-in-a-workflow/example-workflows/pages/bo1ysFcttJEhasfakhYF#id-2.-transform-data) as you normally would. For example, you might use the patient and claims data to identify patients who meet a particular set of criteria and summarize their claims by year.

Add the necessary transforms and notebooks to your workflow, then run the workflow to verify that your analysis produces the expected results.

<div data-with-frame="true"><figure><img src="https://1672950126-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LVodLwUXgJUGcm5Cvso%2Fuploads%2FiWFLMDa4akTHw8vpzEfd%2Fredivis.com_workflows_py4r-6zdfdx1yp_dataSources_8f8j-9wjp6mdrj%20(7).png?alt=media&amp;token=37bc74f5-6a0c-4d42-89fe-6a0a1b58dba6" alt=""><figcaption></figcaption></figure></div>

At this stage, you can make changes and iterate on your analysis without working with the restricted dataset.

## 3. Replace with the non-synthetic dataset

Once the workflow is ready, [replace the synthetic dataset](/guides/analyze-data-in-a-workflow/switch-data-sources.md#switch-to-a-different-dataset) with the corresponding CMS patient dataset. The dataset can be replaced by you or another user with edit access to the workflow and data access to the dataset

To replace the dataset, navigate to the dataset node, open the **More** menu in the resource bar, and select **Replace dataset**. Search for the non-synthetic dataset and select it as the new data source.&#x20;

<div data-with-frame="true"><figure><img src="https://1672950126-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LVodLwUXgJUGcm5Cvso%2Fuploads%2FZTCw0Apd2N29koqaTagW%2Fredivis.com_workflows_py4r-6zdfdx1yp_dataSources_8f8j-9wjp6mdrj%20(8).png?alt=media&amp;token=a9b1f6cf-d9d7-4eae-b2b3-ffd2e7dbda58" alt=""><figcaption></figcaption></figure></div>

Then align each table used in your workflow to the corresponding tables in the non-synthetic dataset

<div data-with-frame="true"><figure><img src="https://1672950126-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LVodLwUXgJUGcm5Cvso%2Fuploads%2FXAFaLEYnLgwsEf59RIZL%2Fredivis.com_workflows_py4r-6zdfdx1yp_dataSources_8f8j-9wjp6mdrj%20(9).png?alt=media&amp;token=cd53f70e-34ac-4af7-973b-ec07b3121bc3" alt=""><figcaption></figcaption></figure></div>

Because the variables in the patient data have a compatible structure, you can preserve the transforms and notebooks you developed using the synthetic data.

If you do not have data access to the non-synthtic dataset, you will not be able to view its data or tables that you do not have access to. You can [apply for access](/guides/discover-and-access-data/apply-to-access-restricted-data.md), if appropriate, or have an administrator with access replace the dataset and run it on your behalf.

## 4. Verify your workflow

Review the workflow to make sure that the expected tables and variables are available in the non-synthetic dataset and that the existing transformations still apply.

Make any necessary updates before running the workflow.

## 5. Run the workflow

Once you've verified the data source and made any necessary updates, some nodes will be [stale](/reference/workflows/create-and-edit-workflows.md#stale-nodes). [Rerun the workflow](/reference/workflows/create-and-edit-workflows.md#run-all) to apply the changes and materialize the updated results. To update all nodes at once, select **Run all stale nodes** from the workflow's **Map** menu.

<div data-with-frame="true"><figure><img src="https://1672950126-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LVodLwUXgJUGcm5Cvso%2Fuploads%2FojUZU8Ive9qrRNCN1t7k%2Fredivis.com_workflows_py4r-6zdfdx1yp_transforms_j9g5-atgmazwc1%20(2).png?alt=media&amp;token=bf5929d3-48e4-405a-bf01-22c24fefb9bc" alt=""><figcaption></figcaption></figure></div>

The workflow now runs using the CMS patient data rather than the synthetic data used during development.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.redivis.com/guides/analyze-data-in-a-workflow/example-workflows/using-synthetic-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
