---
title: "Get query pipeline"
method: GET
path: "/v1/query/{query_id}/pipeline"
---

# Get query pipeline

`GET /v1/query/{query_id}/pipeline`

Builds a query pipeline from the specified query and returns the pipeline definition containing all the nested materialized views that the query depends on. A pipeline allows you to chain multiple queries together and execute them as a single unit.

## Path parameters

- `query_id` integer, required

## Query parameters

- `api_key` string
- `performance` string
- `query_parameters` string

## Headers

- `X-Dune-Api-Key` string, required

## Response `200`

OK

- ModelsGetQueryPipelineResponse
  - `pipeline` ModelsPipeline
    - `nodes` ModelsPipelineNode[] — List of nodes in the pipeline. Nodes are executed in dependency order.
      - `dependencies` integer[] — List of node IDs that this node depends on. Nodes are executed in dependency order.
      - `id` integer — Unique identifier of the node in the pipeline
      - `materialized_view_refresh` ModelsPipelineMaterializedViewRefreshNode
        - `name` string — Name of the materialized view to refresh
        - `performance` 'small' | 'medium' | 'large' — The performance engine tier the refresh will be run on. Can be `small`, `medium`, or `large`.
      - `query_execution` ModelsPipelineQueryExecutionNode
        - `performance` 'small' | 'medium' | 'large' — The performance engine tier the execution will be run on. Can be `small`, `medium`, or `large`.
        - `query_id` integer — Unique identifier of the query to execute
        - `query_parameters` object — SQL Query parameters in json key-value pairs. Each parameter is to be provided in key-value pairs. This enables you to execute a parameterized query with the provided values for your parameter keys.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.dev/dune/apis/duneapi.md) · [All operations](https://skmtc.dev/dune/apis/duneapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/dune/duneapi/revisions/f3a7a865f95b/schema)
