Add execution tags

This document shows you how to add tags to Dataform core SQLX files to categorize your SQL workflow.

To organize components of your SQL workflow into collections, you can add custom tags to SQLX files of the following types:

  • table
  • view
  • incremental
  • assertion
  • operations

During workflow execution, you can execute only files with a selected tag.

With Cloud Composer or Workflows together with Cloud Scheduler, you can create a schedule that executes a Dataform workflow with a selected tag at a specific interval.

Before you begin

  1. In the Google Cloud console, go to the Dataform page.

    Go to the Dataform page

  2. Select or create a repository.

  3. Select or create a development workspace.

  4. Define a SQLX file of any of the following types:

Required roles

To get the permissions that you need to add a tag to a table, ask your administrator to grant you the Dataform Editor (roles/dataform.editor) IAM role on workspaces. For more information about granting roles, see Manage access to projects, folders, and organizations.

You might also be able to get the required permissions through custom roles or other predefined roles.

Add a tag

You can add multiple tags to a SQLX file.

To add a tag to a SQLX file, follow these steps:

  1. Go to your development workspace.
  2. In the Files pane, expand definitions/.
  3. Select a SQLX file.
  4. In the config block, add a tag in the following format:

    tags: ["CUSTOM_TAG"]
    

    Replace CUSTOM_TAG with your tag.

  5. Optional: To add multiple tags, separate them with a comma ,.

  6. Optional: Click Format.

The following code sample shows the user_counts view with the daily and hourly tags:

config {
  type: "view",
  name: "user_counts",
  tags: ["daily", "hourly"]
}

What's next