# 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.

* [Create a Workflow Directory](#creating-a-directory-of-saved-workflows-and-queries)
* [Add the Workflow Definition File](#add-the-workflow-definition-file)


1. Set up Treasure Workflows.
2. Create a directory called wf_of_saved_queries.



```bash
$ 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 .


```bash
$ 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:


```bash
$ td connector:list
```

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