Skip to content
Last updated

Creating a Directory of Saved Workflows and Queries

This example creates a workflow that runs a saved job on Treasure Data to import data, runs a query, and then exports query results to an external database or service.

  1. Set up TD Workflows.

  2. Create a directory called wf_of_saved_queries.

$ mkdir wf_of_saved_queries

Add the Workflow Definition File

Add the workflow file itself. In this case, you need to replace the <replaced_with_saved_query_name> with your query's saved name in Treasure Data .

$ cat > saved_queries.dig <<EOF
_export:
  td:
    database: workflow_temp

+data_load_task:
  td_load>: <replace_with_saved_data_connector_job_name>

+query_task:
  td_run>: <replace_with_saved_query_name>
EOF

To find a saved data connector job, you can issue the following command using td-toolbelt via CLI:

$ td connector:list

From your TD Console, you can review the list of saved queries and their definitions.