Template Workspaces
This guide will walk you through using Workspace Variables and Workspace Cloning to implement a template flow.
With each new customer, you may have a baseline of connections, datasets, and configurations that you would like to set up in each customer’s workspace. You can accomplish this goal of “Template Workspaces” by composing 2 features — Workspace Variables and Workspace Cloning.
Workspace Variables
Workspace Variables can be set in the Workspace Settings page, and then used in SQL dataset queries, source credentials, and destination credentials. Once set, variables are referenced as {{ application_vars.my_var }}
.
Setting workspace variables
When creating a workspace variable, you have the option to set it as a secret. Secret workspace variables can only be used within secret fields, such as passwords within connection credentials. They cannot be used in dataset queries. When setting a workspace variable as a secret, the value will be irretrievable after saving. Please ensure you have saved the value in a secure location.
- Navigate to the Workspace you’d like to set the variable for.
- Click on the “Settings” tab.
- Click on the “Admin” tab. Only Organization admins have access to managing workspace variables.
- Click “Add Variable”.
- If the variable is a secret, check the “Secret” checkbox.
- Enter the name and value of the variable.
- Click “Save”.
Using workspace variables in SQL datasets
- Navigate to the Dataset you’d like to use the workspace variable in.
- Click on the “SQL” editor.
- Reference the variable as
{{ application_vars.my_var }}
.
Using workspace variables in connection credentials
- Navigate to the connection you’d like to create via the
Sources
orDestinations
tab. - Click on the “(Advanced) Edit as JSON” button. Workspace variables can only be used in this JSON mode. Note: Only organization admins have access to using variables in connection credentials.
- Reference your variables using the
{{ application_vars.my_var }}
syntax.
Workspace variables can be used in source and destination connections. For destination connections, variables are currently only supported for Census-built credentialed connections. This excludes any Custom Destinations, HTTP Destinations, or destinations that require OAuth to connect. Please reach out if you need to use variables in one of these unsupported destinations.
Workspace Cloning
Workspace Cloning allows you to create a new workspace based on an existing one. This is useful for spinning up new workspaces that have the exact same connections and datasets, or have resources that differ slightly by a workspace variable value.
Workspace Cloning clones the following resources into a new workspace
- SQL datasets and their relationships
- Warehouse managed audiences
- Source connections
- Destination connections
- Datadog integrations
The following resources are not yet supported for cloning. Please contact support if you’d like to be able to clone
- Syncs
- Segments
- Computed columns and column annotations
- Non-SQL datasets (Dbt, Looker, Python, Sigma)
By default, cloning a source will not preserve any Census-generated credentials. This includes credentials like the Athena external ID for connections using Role-based authentication, Census-managed Google service accounts for BigQuery and Google Sheets, and others.
If you’d like to preserve these sorts of credentials on clone, please reach out to us at support@getcensus.com and we’ll enable this for you.
Cloning a Workspace with Workspace Variables
When cloning a workspace, you can specify new values for the workspace variables that are used in the cloned workspace’s resources.
- Navigate to the Organization Dashboard.
- Click on the “Workspaces” tab.
- Click the three dot button on the workspace you’d like to clone, and click Clone.
- Enter the name of the new workspace.
- Enter values for the new workspace’s variables.
- Click “Save”.
Was this page helpful?