# Data Discovery

Routes a data-discovery request to the sub-workflow that handles it. Read the one file in the **Route to** column of the matching row (for example `catalog/overview.md`) before you answer, ask the user anything, or run any command.

## Routing table

| User intent | Route to | When to use |
|-------------|----------|-------------|
| Discover and understand existing catalog data (train / reuse / audit) | `catalog/overview.md` | User says "find a dataset to train/fine-tune on", "I need a dataset for X / to build an X model", "what datasets do I have for X", "is there data about X I can reuse", "find the X table", "explain this dataset/table's schema", "audit / inventory / list the databases or tables in my catalog". Discovers existing SageMaker AI DataSets, Glue tables, or S3 Tables for a purpose and previews them (metadata only). |
| Query, analyze, or export catalog data | `query/overview.md` | User says "query this table", asks an analytic question about a specific table, pastes SQL, or says "write / export / copy this table to S3" or "make this table a SageMaker dataset". Runs Athena on a resolved table only after the user confirms. If the table is not yet identified, start with `catalog/overview.md`. |
| Turn a raw data file into a SageMaker DataSet | `dataset-import/overview.md` | User says "my data is at s3://...", "register this file as a dataset", "import my data file", or names a local file to make into a dataset. Also for references that need a dataset ARN and have only a file. |
| Turn LLM traces already in CloudWatch Logs into a SageMaker DataSet | `cloudwatch-extraction/overview.md` | The source is a CloudWatch log group rather than a file — Bedrock model-invocation logs, a SageMaker endpoint's OpenTelemetry (OTel) inference traces, SageMaker online-eval results, or Bedrock AgentCore runtime OTel spans. User says "query my OpenTelemetry/OTel trace log to an eval/training dataset", "pull my endpoint traces into a dataset", "turn my Bedrock invocation logs into a dataset", "make a dataset from my online-eval results", "turn my AgentCore agent's runtime traces into a dataset", "make an eval set from CloudWatch traces", or names a `/aws/...` (including `/aws/sagemaker/...` and `/aws/bedrock-agentcore/runtimes/...`) trace/invocation/online-eval log group as the source. Prefer this sub-workflow over a hand-rolled raw CloudWatch/Logs-Insights query for extraction-to-dataset; a direct ad-hoc query is fine when the user explicitly asks for one. |

## Rules

- **Do NOT execute discovery from this overview.** The **When to use** column only matches the request. The steps, commands and checkpoints are in the sub-workflow file.
- **One sub-workflow at a time** — do not load multiple sub-workflows simultaneously. A
  sub-workflow may hand off to another reference when its own steps say so (for example
  `catalog/` → `query/`, `query/` → `dataset-import/`, `catalog/` → `../finetuning/`).
