How It Works
When you execute a pipeline using this endpoint:- Lineage Detection: Dune analyzes the query to identify all materialized views it depends on
- Pipeline Construction: A pipeline is automatically built that includes all dependencies in the correct order
- Coordinated Execution: All queries and materialized view refreshes are executed as a single unit
- Status Tracking: Returns a
pipeline_execution_idfor monitoring progress
Key Differences from Query Pipeline Execute
This endpoint differs from the Execute Query Pipeline endpoint:| Feature | Execute Pipeline | Execute Query Pipeline |
|---|---|---|
| Endpoint | POST /v1/pipelines/execute | POST /v1/query/{query_id}/pipeline/execute |
| Query ID | In request body | In URL path |
| Lineage | Automatically includes all materialized views | Executes predefined pipeline |
| Use Case | Dynamic pipeline based on query dependencies | Predefined pipeline execution |
Request Body
The request body accepts:query_id(required): The unique identifier of the query to executeperformance(optional): Execution tier -medium(default) orlargequery_parameters(optional): SQL query parameters as JSON key-value pairs
Use Cases
This endpoint is ideal for:- Dependency Management: Automatically refreshing all materialized views a query depends on
- Consistent Updates: Ensuring all dependent data is fresh before query execution
- Dynamic Pipelines: When you want to execute based on runtime query dependencies
- Simplified Workflow: No need to manually define pipeline structure
Monitoring Pipeline Execution
After executing the pipeline:- Save the returned
pipeline_execution_id - Use the Get Pipeline Execution Status endpoint to monitor progress
- Track the status of each materialized view refresh and query execution
- Retrieve results once the pipeline completes
Example Workflow
This endpoint automatically determines which materialized views need to be refreshed based on the query’s lineage. You don’t need to manually specify dependencies.
Performance Considerations
- Medium tier: Best for most queries with standard dependencies
- Large tier: Use for complex queries with many dependencies or large materialized views
- Credits are consumed based on actual compute resources used for each node in the pipeline
Headers
API Key for the service
Query Parameters
Alternative to using the X-Dune-Api-Key header
Body
application/json
Pipeline execution request
The pipeline definition containing nodes to execute
Response
OK
Unique identifier for the pipeline execution. Use this ID to check the status and retrieve results of the pipeline execution.
Example:
"01HKZJ2683PHF9Q9PHHQ8FW4Q1"