---
description: Basin is a serverless data analytics platform for ingesting, managing, and querying Apache Iceberg tables stored in R2.
title: Basin
image: https://developers.cloudflare.com/basin/og.png?v=4aac2174eba45ffc
---

[Skip to content](#main-content)

> Documentation Index  
> Fetch the complete documentation index at: https://developers.cloudflare.com/basin/llms.txt  
> Use this file to discover all available pages before exploring further.

# Basin

Last updated Oct 1, 2026|Copy as Markdown| [View as Markdown](https://developers.cloudflare.com/basin/index.md)| [Agent setup](https://developers.cloudflare.com/agent-setup/)

Collect, transform, manage, and query analytics data with a serverless platform built on [Apache Iceberg ↗︎](https://iceberg.apache.org/) and [R2](https://developers.cloudflare.com/r2/).

Note

Basin was formerly known as Cloudflare Data Platform. Cloudflare Pipelines, R2 Data Catalog, and R2 SQL are now named Basin Pipelines, Basin Catalog, and Basin SQL. Existing resources and configurations continue to work.

Basin is an end-to-end analytics data platform that brings ingestion, table management, and distributed SQL together to Cloudflare's Developer Platform. It receives data from applications, infrastructure, devices, and Cloudflare services, transforms events during ingestion, stores them in open Iceberg tables, and makes it queryable with Basin SQL or [compatible external engines](https://developers.cloudflare.com/basin-catalog/config-examples/).

```
---
title: Basin data flow
---
flowchart LR
	pipelines["Basin Pipelines"]
	catalog["Basin Catalog<br/>Apache Iceberg tables"]
	sql["Basin SQL &<br/>compatible external engines"]
	pipelines -->|processes and ingests events| catalog
	catalog -->|queried by| sql

```

With Basin, you can expect to:

- Ingest and transform events without managing streaming infrastructure
- Keep data portable through the open Apache Iceberg standard
- Maintain tables automatically with compaction and snapshot expiration
- Run globally distributed OLAP queries without managing query clusters
- Access tables stored in R2 without [egress fees](https://developers.cloudflare.com/r2/pricing/#egress)

To build your first request analytics workflow, follow the [Basin CLI guide](https://developers.cloudflare.com/basin/get-started/guide/).

---

## Ingest with Basin Pipelines

Use [Basin Pipelines](https://developers.cloudflare.com/basin-pipelines/) to receive events through HTTP endpoints or [Workers bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/). It transforms events with SQL and writes Iceberg tables or files to R2.

Run the setup command to configure a stream, sink, and pipeline:

npmyarnpnpm

```
npx wrangler basin pipelines setup
```

```
yarn wrangler basin pipelines setup
```

```
pnpm wrangler basin pipelines setup
```

[Basin Pipelines documentation](https://developers.cloudflare.com/basin-pipelines/)

Configure streaming ingestion, SQL transformations, and R2 destinations.

Explore Basin Pipelines

---

## Manage your data with Basin Catalog

Use [Basin Catalog](https://developers.cloudflare.com/basin-catalog/) to manage Iceberg metadata in your R2 bucket. It provides an Iceberg REST catalog and automatic table maintenance.

Enable Basin Catalog on an existing R2 bucket:

npmyarnpnpm

```
npx wrangler basin catalog enable YOUR_BUCKET_NAME
```

```
yarn wrangler basin catalog enable YOUR_BUCKET_NAME
```

```
pnpm wrangler basin catalog enable YOUR_BUCKET_NAME
```

[Basin Catalog documentation](https://developers.cloudflare.com/basin-catalog/)

Manage catalogs, maintain tables, and connect compatible Iceberg engines.

Explore Basin Catalog

---

## Query your data with Basin SQL

Use [Basin SQL](https://developers.cloudflare.com/basin-sql/) to run distributed online analytical processing (OLAP) queries across catalog tables. It uses Cloudflare's global network without requiring query clusters.

Query a table in your warehouse with SQL:

npmyarnpnpm

```
npx wrangler basin sql query YOUR_WAREHOUSE_NAME "SELECT * FROM default.events LIMIT 10"
```

```
yarn wrangler basin sql query YOUR_WAREHOUSE_NAME "SELECT * FROM default.events LIMIT 10"
```

```
pnpm wrangler basin sql query YOUR_WAREHOUSE_NAME "SELECT * FROM default.events LIMIT 10"
```

[Basin SQL documentation](https://developers.cloudflare.com/basin-sql/)

Run SQL queries, review supported syntax, and monitor query usage.

Explore Basin SQL

---

## What's new

The latest features and improvements across Basin.

[View Changelog](https://developers.cloudflare.com/changelog/product/basin/)

[Oct 01, 2026Basin Pipelines<h3>Basin Pipelines ingest limit increased to 1 GB/s</h3>Basin Pipelines streams can ingest up to 1 GB/s each, increased from the previous 5 MB/s limit.Read update](https://developers.cloudflare.com/changelog/post/2026-10-01-stream-ingest-limit-increase/) [Oct 01Basin Pipelines<h3>Cloudflare Basin is now generally available</h3>Cloudflare Data Platform is now Basin, bringing generally available ingestion, Iceberg table management, and SQL analytics together on R2.Read more](https://developers.cloudflare.com/changelog/post/2026-10-01-basin-ga/) [Sep 16Basin Catalog<h3>R2 Data Catalog adds table maintenance visibility and manual queueing</h3>View table maintenance schedules and run history, queue compaction from the dashboard, and browse catalogs with an updated layout.Read more](https://developers.cloudflare.com/changelog/post/2026-09-16-table-maintenance-dashboard/) [Aug 03Basin Catalog<h3>Billing is now enabled for R2 Data Catalog</h3>R2 Data Catalog usage is now billed on non-enterprise accounts. R2 Data Catalog usage beyond the included free tier will appear on your next invoice.Read more](https://developers.cloudflare.com/changelog/post/2026-08-03-r2-data-catalog-billing-enabled/) [Aug 03Basin Pipelines<h3>Billing is now enabled for Pipelines</h3>Cloudflare Pipelines usage is now billed on non-enterprise accounts. Pipelines usage beyond the included free tier will appear on your next invoice.Read more](https://developers.cloudflare.com/changelog/post/2026-08-03-pipelines-billing-enabled/) [Aug 03Basin SQL<h3>Billing is now enabled for R2 SQL</h3>R2 SQL usage is now billed on non-enterprise accounts. R2 SQL usage beyond the included free tier will appear on your next invoice.Read more](https://developers.cloudflare.com/changelog/post/2026-08-03-r2-sql-billing-enabled/) [Jul 13Basin Catalog<h3>R2 Data Catalog now supports read-only API tokens</h3>Connect query engines to R2 Data Catalog using read-only API tokensRead more](https://developers.cloudflare.com/changelog/post/2026-07-09-r2-data-catalog-read-only-tokens/) [Jul 13Basin Catalog<h3>R2 Data Catalog compaction now optimizes manifest files</h3>Compaction automatically rewrites and clusters Apache Iceberg manifest files to reduce metadata overhead and speed up query planningRead more](https://developers.cloudflare.com/changelog/post/2026-07-13-r2-data-catalog-manifest-optimization/)

Was this helpful?

YesNo

## On this page

[![](https://developers.cloudflare.com/_astro/logo.te5VL_aD.svg)Docs](https://developers.cloudflare.com/)

```json
{"@context":"https://schema.org","@type":"WebPage","@id":"https://developers.cloudflare.com/basin/#page","headline":"Basin","description":"Basin is a serverless data analytics platform for ingesting, managing, and querying Apache Iceberg tables stored in R2.","url":"https://developers.cloudflare.com/basin/","inLanguage":"en","image":"https://developers.cloudflare.com/basin/og.png?v=4aac2174eba45ffc","dateModified":"2026-10-01","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
```

---

---
description: Ingest, transform, and deliver streaming data to R2 as Apache Iceberg tables or Parquet and JSON files.
title: Basin Pipelines
image: https://developers.cloudflare.com/basin-pipelines/og.png?v=51bf2fd0ad41c63b
---

[Skip to content](#main-content)

> Documentation Index  
> Fetch the complete documentation index at: https://developers.cloudflare.com/basin-pipelines/llms.txt  
> Use this file to discover all available pages before exploring further.

# Basin Pipelines

Last updated Oct 1, 2026|Copy as Markdown| [View as Markdown](https://developers.cloudflare.com/basin-pipelines/index.md)| [Agent setup](https://developers.cloudflare.com/agent-setup/)

Ingest, transform, and load streaming data into Apache Iceberg or Parquet in R2.

Available on Workers Paid plan

Availability and product rename

Basin Pipelines was formerly known as Cloudflare Pipelines. Existing resources and configurations continue to work.

Basin Pipelines ingests events, transforms them with SQL, and delivers them to R2 as [Iceberg tables](https://developers.cloudflare.com/basin-catalog/) or as Parquet and JSON files.

Whether you are processing server logs, mobile application events, IoT telemetry, or clickstream data, Basin Pipelines provides durable ingestion via HTTP endpoints or Worker bindings, SQL-based transformations, and exactly-once delivery to R2. This makes it easy to build analytics-ready data warehouses and lakehouses without managing streaming infrastructure.

Create your first pipeline by following the [getting started guide](https://developers.cloudflare.com/basin-pipelines/getting-started/) or running this [Wrangler](https://developers.cloudflare.com/workers/wrangler/) command:

npmyarnpnpm

```
npx wrangler basin pipelines setup
```

```
yarn wrangler basin pipelines setup
```

```
pnpm wrangler basin pipelines setup
```

---

## Features

[Create your first pipeline](https://developers.cloudflare.com/basin-pipelines/getting-started/)

Build your first pipeline to ingest data via HTTP or Workers, apply SQL transformations, and deliver to R2 as Iceberg tables or Parquet files.

Get started

[Streams](https://developers.cloudflare.com/basin-pipelines/streams/)

Durable, buffered queues that receive events via HTTP endpoints or Worker bindings.

Learn about Streams

[Pipelines](https://developers.cloudflare.com/basin-pipelines/pipelines/)

Connect streams to sinks with SQL transformations that validate, filter, transform, and enrich your data at ingestion time.

Learn about Pipelines

[Sinks](https://developers.cloudflare.com/basin-pipelines/sinks/)

Configure destinations for your data. Write Apache Iceberg tables to Basin Catalog or export as Parquet and JSON files.

Learn about Sinks

[Examples](https://developers.cloudflare.com/basin-pipelines/examples/)

Follow end-to-end examples, including how to fan one stream out into multiple Iceberg tables.

Browse examples

---

## Related products

[R2](https://developers.cloudflare.com/r2/)

Cloudflare R2 Object Storage allows developers to store large amounts of unstructured data without the costly egress bandwidth fees associated with typical cloud storage services.

[Workers](https://developers.cloudflare.com/workers/)

Cloudflare Workers allows developers to build serverless applications and deploy instantly across the globe for exceptional performance, reliability, and scale.

---

## More resources

### [Limits](https://developers.cloudflare.com/basin-pipelines/platform/limits/)

Learn about pipelines limits.

### [@CloudflareDev](https://x.com/cloudflaredev)

Follow @CloudflareDev on Twitter to learn about product announcements, and what is new in Cloudflare Workers.

### [Developer Discord](https://discord.cloudflare.com)

Connect with the Workers community on Discord to ask questions, show what you are building, and discuss the platform with other developers.

Was this helpful?

YesNo

## On this page

[![](https://developers.cloudflare.com/_astro/logo.te5VL_aD.svg)Docs](https://developers.cloudflare.com/)

```json
{"@context":"https://schema.org","@type":"WebPage","@id":"https://developers.cloudflare.com/basin-pipelines/#page","headline":"Basin Pipelines","description":"Ingest, transform, and deliver streaming data to R2 as Apache Iceberg tables or Parquet and JSON files.","url":"https://developers.cloudflare.com/basin-pipelines/","inLanguage":"en","image":"https://developers.cloudflare.com/basin-pipelines/og.png?v=51bf2fd0ad41c63b","dateModified":"2026-10-01","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
```

---

---
description: A managed Apache Iceberg data catalog built directly into R2 buckets.
title: Basin Catalog
image: https://developers.cloudflare.com/basin-catalog/og.png?v=c6a88a025de15231
---

[Skip to content](#main-content)

> Documentation Index  
> Fetch the complete documentation index at: https://developers.cloudflare.com/basin-catalog/llms.txt  
> Use this file to discover all available pages before exploring further.

# Basin Catalog

Last updated Oct 1, 2026|Copy as Markdown| [View as Markdown](https://developers.cloudflare.com/basin-catalog/index.md)| [Agent setup](https://developers.cloudflare.com/agent-setup/)

Availability and product rename

Basin Catalog requires an active [R2 subscription](https://developers.cloudflare.com/r2/get-started/). Your account must also have a [linked payment card](https://developers.cloudflare.com/billing/get-started/create-billing-profile/).

Basin Catalog was formerly known as R2 Data Catalog. Existing configurations and APIs continue to work and will be deprecated in the future.

Basin Catalog is a managed [Apache Iceberg ↗︎](https://iceberg.apache.org/) data catalog built directly into your R2 bucket. It exposes a standard Iceberg REST catalog interface, so you can connect the engines you already use, like [Spark](https://developers.cloudflare.com/basin-catalog/config-examples/spark-scala/), [Snowflake](https://developers.cloudflare.com/basin-catalog/config-examples/snowflake/), and [PyIceberg](https://developers.cloudflare.com/basin-catalog/config-examples/pyiceberg/).

Basin Catalog makes it easy to turn an R2 bucket into a data warehouse or lakehouse for a variety of analytical workloads including log analytics, business intelligence, and data pipelines. R2's zero-egress fee model means that data users and consumers can access and analyze data from different clouds, data platforms, or regions without incurring transfer costs.

To get started with Basin Catalog, refer to the [Basin Catalog: Getting started](https://developers.cloudflare.com/basin-catalog/get-started/).

## What is Apache Iceberg?

[Apache Iceberg ↗︎](https://iceberg.apache.org/) is an open table format designed to handle large-scale analytics datasets stored in object storage. Key features include:

- ACID transactions - Ensures reliable, concurrent reads and writes with full data integrity.
- Optimized metadata - Avoids costly full table scans by using indexed metadata for faster queries.
- Full schema evolution - Allows adding, renaming, and deleting columns without rewriting data.

Iceberg is already [widely supported ↗︎](https://iceberg.apache.org/vendors/) by engines like Apache Spark, Trino, Snowflake, DuckDB, and ClickHouse, with a fast-growing community behind it.

## Why do you need a data catalog?

Although the Iceberg data and metadata files themselves live directly in object storage (like [R2](https://developers.cloudflare.com/r2/)), the list of tables and pointers to the current metadata need to be tracked centrally by a data catalog.

Think of a data catalog as a library's index system. While books (your data) are physically distributed across shelves (object storage), the index provides a single source of truth about what books exist, their locations, and their latest editions. Without this index, readers (query engines) would waste time searching for books, might access outdated versions, or could accidentally shelve new books in ways that make them unfindable.

Similarly, data catalogs ensure consistent, coordinated access, which allows multiple query engines to safely read from and write to the same tables without conflicts or data corruption.

## Learn more

### [Get started](https://developers.cloudflare.com/basin-catalog/get-started/)

Learn how to enable the Basin Catalog on your bucket, load sample data, and run your first query.

### [Managing catalogs](https://developers.cloudflare.com/basin-catalog/manage-catalogs/)

Enable or disable Basin Catalog on your bucket, retrieve configuration details, and authenticate your Iceberg engine.

### [Connect to Iceberg engines](https://developers.cloudflare.com/basin-catalog/config-examples/)

Find detailed setup instructions for Apache Spark and other common query engines.

Was this helpful?

YesNo

## On this page

[![](https://developers.cloudflare.com/_astro/logo.te5VL_aD.svg)Docs](https://developers.cloudflare.com/)

```json
{"@context":"https://schema.org","@type":"WebPage","@id":"https://developers.cloudflare.com/basin-catalog/#page","headline":"Basin Catalog","description":"A managed Apache Iceberg data catalog built directly into R2 buckets.","url":"https://developers.cloudflare.com/basin-catalog/","inLanguage":"en","image":"https://developers.cloudflare.com/basin-catalog/og.png?v=c6a88a025de15231","dateModified":"2026-10-01","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
```

---

---
description: A distributed SQL engine for Basin Catalog
title: Basin SQL
image: https://developers.cloudflare.com/basin-sql/og.png?v=57df7a270078be5d
---

[Skip to content](#main-content)

> Documentation Index  
> Fetch the complete documentation index at: https://developers.cloudflare.com/basin-sql/llms.txt  
> Use this file to discover all available pages before exploring further.

# Basin SQL

Last updated Oct 1, 2026|Copy as Markdown| [View as Markdown](https://developers.cloudflare.com/basin-sql/index.md)| [Agent setup](https://developers.cloudflare.com/agent-setup/)

Query Apache Iceberg tables managed by Basin Catalog using SQL.

Availability and product rename

Basin SQL requires an active [R2 subscription](https://developers.cloudflare.com/r2/get-started/). Your account must also have a [linked payment card](https://developers.cloudflare.com/billing/get-started/create-billing-profile/).

Basin SQL was formerly known as R2 SQL. Existing APIs continue to work and will be deprecated in the future.

Basin SQL is Cloudflare's serverless, distributed, analytics query engine for querying [Apache Iceberg ↗︎](https://iceberg.apache.org/) tables stored in [Basin Catalog](https://developers.cloudflare.com/basin-catalog/). Basin SQL is designed to efficiently query large amounts of data by automatically utilizing file pruning, Cloudflare's distributed compute, and R2 object storage.

npmyarnpnpm

```
npx wrangler basin sql query "YOUR_WAREHOUSE_NAME" "SELECT * FROM default.transactions LIMIT 10"
```

```
yarn wrangler basin sql query "YOUR_WAREHOUSE_NAME" "SELECT * FROM default.transactions LIMIT 10"
```

```
pnpm wrangler basin sql query "YOUR_WAREHOUSE_NAME" "SELECT * FROM default.transactions LIMIT 10"
```

Create an end-to-end data pipeline by following [this step by step guide](https://developers.cloudflare.com/basin-sql/get-started/), which shows you how to stream events into an Apache Iceberg table and query it with Basin SQL.

Was this helpful?

YesNo

## On this page

[![](https://developers.cloudflare.com/_astro/logo.te5VL_aD.svg)Docs](https://developers.cloudflare.com/)

```json
{"@context":"https://schema.org","@type":"WebPage","@id":"https://developers.cloudflare.com/basin-sql/#page","headline":"Basin SQL","description":"A distributed SQL engine for Basin Catalog","url":"https://developers.cloudflare.com/basin-sql/","inLanguage":"en","image":"https://developers.cloudflare.com/basin-sql/og.png?v=57df7a270078be5d","dateModified":"2026-10-01","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
```

---

---
description: Find Basin tutorials and examples organized by workflow goal.
title: Tutorials and examples
image: https://developers.cloudflare.com/basin/tutorials-and-examples/og.png?v=e6208f2f88b3ed83
---

[Skip to content](#main-content)

> Documentation Index  
> Fetch the complete documentation index at: https://developers.cloudflare.com/basin/llms.txt  
> Use this file to discover all available pages before exploring further.

# Tutorials and examples

Last updated Oct 1, 2026|Copy as Markdown| [View as Markdown](https://developers.cloudflare.com/basin/tutorials-and-examples/index.md)| [Agent setup](https://developers.cloudflare.com/agent-setup/)

Use these guides to build workflows or connect existing tools.

## Build streaming workflows

| Goal | Resource |
| --- | --- |
| Explore ingestion examples | [Basin Pipelines examples](https://developers.cloudflare.com/basin-pipelines/examples/) |
| Send one stream to several tables | [Fan out the Bluesky firehose](https://developers.cloudflare.com/basin-pipelines/examples/bluesky-firehose-fanout/) |
| Build a complete analytics workflow | [Build an end-to-end data pipeline](https://developers.cloudflare.com/basin-sql/tutorials/end-to-end-pipeline/) |

## Connect an Iceberg engine

Choose a configuration example for your existing engine:

| Goal | Resource |
| --- | --- |
| Use a local SQL engine | [DuckDB](https://developers.cloudflare.com/basin-catalog/config-examples/duckdb/) |
| Use a distributed SQL engine | [Trino](https://developers.cloudflare.com/basin-catalog/config-examples/trino/) or [StarRocks](https://developers.cloudflare.com/basin-catalog/config-examples/starrocks/) |
| Use Python | [PyIceberg](https://developers.cloudflare.com/basin-catalog/config-examples/pyiceberg/) or [Apache Spark with Python](https://developers.cloudflare.com/basin-catalog/config-examples/spark-python/) |
| Use Scala | [Apache Spark with Scala](https://developers.cloudflare.com/basin-catalog/config-examples/spark-scala/) |
| Use a data warehouse | [Snowflake](https://developers.cloudflare.com/basin-catalog/config-examples/snowflake/) |

For all supported examples, refer to [Connect to Iceberg engines](https://developers.cloudflare.com/basin-catalog/config-examples/).

## Query with Basin SQL

| Goal | Resource |
| --- | --- |
| Run a first Basin SQL query | [Get started with Basin SQL](https://developers.cloudflare.com/basin-sql/get-started/) |
| Browse guided SQL workflows | [Basin SQL tutorials](https://developers.cloudflare.com/basin-sql/tutorials/) |
| Build a transaction analysis workflow | [Build an end-to-end data pipeline](https://developers.cloudflare.com/basin-sql/tutorials/end-to-end-pipeline/) |

Was this helpful?

YesNo

## On this page

[![](https://developers.cloudflare.com/_astro/logo.te5VL_aD.svg)Docs](https://developers.cloudflare.com/)

```json
{"@context":"https://schema.org","@type":"WebPage","@id":"https://developers.cloudflare.com/basin/tutorials-and-examples/#page","headline":"Tutorials and examples","description":"Find Basin tutorials and examples organized by workflow goal.","url":"https://developers.cloudflare.com/basin/tutorials-and-examples/","inLanguage":"en","image":"https://developers.cloudflare.com/basin/tutorials-and-examples/og.png?v=e6208f2f88b3ed83","dateModified":"2026-10-01","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
```

---

---
description: Review Basin access, pricing components, and product limits.
title: Platform
image: https://developers.cloudflare.com/basin/platform/og.png?v=64db52d28169d966
---

[Skip to content](#main-content)

> Documentation Index  
> Fetch the complete documentation index at: https://developers.cloudflare.com/basin/llms.txt  
> Use this file to discover all available pages before exploring further.

# Platform

Last updated Oct 1, 2026|Copy as Markdown| [View as Markdown](https://developers.cloudflare.com/basin/platform/index.md)| [Agent setup](https://developers.cloudflare.com/agent-setup/)

Review access and pricing before planning your workload.

- [Pricing](https://developers.cloudflare.com/basin/platform/pricing/)

## Review limits

Limits vary by product and workload. Review [Pipelines limits](https://developers.cloudflare.com/basin-pipelines/platform/limits/), [SQL limitations](https://developers.cloudflare.com/basin-sql/reference/limitations-best-practices/), and [Catalog limitations](https://developers.cloudflare.com/basin-catalog/manage-catalogs/#limitations).

Was this helpful?

YesNo

## On this page

[![](https://developers.cloudflare.com/_astro/logo.te5VL_aD.svg)Docs](https://developers.cloudflare.com/)

```json
{"@context":"https://schema.org","@type":"WebPage","@id":"https://developers.cloudflare.com/basin/platform/#page","headline":"Platform","description":"Review Basin access, pricing components, and product limits.","url":"https://developers.cloudflare.com/basin/platform/","inLanguage":"en","image":"https://developers.cloudflare.com/basin/platform/og.png?v=64db52d28169d966","dateModified":"2026-10-01","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
```

---

---
description: Compare monthly rates across all Basin products.
title: Pricing
image: https://developers.cloudflare.com/basin/platform/pricing/og.png?v=1e7f03300ed545d3
---

[Skip to content](#main-content)

> Documentation Index  
> Fetch the complete documentation index at: https://developers.cloudflare.com/basin/llms.txt  
> Use this file to discover all available pages before exploring further.

# Pricing

Last updated Oct 1, 2026|Copy as Markdown| [View as Markdown](https://developers.cloudflare.com/basin/platform/pricing/index.md)| [Agent setup](https://developers.cloudflare.com/agent-setup/)

Basin pricing includes Pipelines processing, Catalog operations, and SQL queries. All included usage allocations on this page apply monthly.

R2 storage, read, and write operations add separate charges. This page excludes R2 rates and costs from every table and example. Refer to [R2 pricing](https://developers.cloudflare.com/r2/pricing/).

## [Basin Pipelines](https://developers.cloudflare.com/basin-pipelines/platform/pricing/)

Pipelines charges for SQL transforms and sink delivery. Stream ingress remains free without a usage limit.

| Dimension | Monthly included usage | Additional usage rate |
| --- | --- | --- |
| Stream ingress | Unlimited | Free |
| SQL transforms | 50 GB | $0.04 per GB |
| Sink delivery, JSON | 50 GB shared sink allowance | $0.03 per GB |
| Sink delivery, Parquet or Iceberg | 50 GB shared sink allowance | $0.06 per GB |

Sink billing uses uncompressed data delivered to each destination.

## [Basin Catalog](https://developers.cloudflare.com/basin-catalog/platform/pricing/)

Catalog charges for operations and optional compaction. Both compaction dimensions apply only when compaction is enabled.

| Dimension | Monthly included usage | Additional usage rate |
| --- | --- | --- |
| Catalog operations | 1 million operations | $9 per million operations |
| Compaction data processed | 10 GB | $0.005 per GB |
| Compaction objects processed | 1 million objects | $2 per million objects |

Snapshot expiration does not have a separate charge. Related R2 and Catalog operations may still incur charges.

## [Basin SQL](https://developers.cloudflare.com/basin-sql/platform/pricing/)

SQL charges for compressed data scanned from R2. Each query has a 10 MB minimum billable scan.

| Dimension | Monthly included usage | Additional usage rate |
| --- | --- | --- |
| Compressed data scanned | 10 GB | $0.0025 per GB ($2.50 per TB) |

Queries that fail before or during execution do not incur SQL scan charges. This includes syntax, system, and runtime failures.

Metadata-only operations, including `EXPLAIN`, `SHOW`, and `DESCRIBE`, do not scan data. Related R2 and Catalog operations may still incur charges.

## End-to-end Basin data pipeline

Assume 500 GB enters a stream and is filtered with SQL transforms to deliver 300 GB of uncompressed data to Basin Catalog.

Catalog usage includes 500,000 operations and 20 GB of compaction across 200,000 objects. SQL queries scan 50 GB of compressed data.

Monthly included allocations are otherwise unused. The SQL total already accounts for per-query minimums.

| Product and dimension | Formula | Cost |
| --- | --- | --- |
| Pipelines stream ingress | 500 GB × $0 | $0.00 |
| Pipelines SQL transforms | (500 GB - 50 GB) × $0.04 per GB | $18.00 |
| Pipelines Iceberg sink | (300 GB - 50 GB) × $0.06 per GB | $15.00 |
| **Pipelines subtotal** | $0.00 + $18.00 + $15.00 | **$33.00** |
| Catalog operations | 500,000 operations within included usage | $0.00 |
| Catalog compaction data | (20 GB - 10 GB) × $0.005 per GB | $0.05 |
| Catalog compaction objects | 200,000 objects within included usage | $0.00 |
| **Catalog subtotal** | $0.00 + $0.05 + $0.00 | **$0.05** |
| SQL scans | (50 GB - 10 GB) × $0.0025 per GB | $0.10 |
| **SQL subtotal** | $0.10 | **$0.10** |
| **Total Basin cost** | $33.00 + $0.05 + $0.10 | **$33.15** |

R2 costs are not included in this example.

## Basin Catalog and Basin SQL

Assume 500,000 Catalog operations and 20 GB of compaction across 200,000 objects. SQL queries scan 50 GB of compressed data after per-query minimums.

Monthly included allocations are otherwise unused.

| Product and dimension | Formula | Cost |
| --- | --- | --- |
| Catalog operations | 500,000 operations within included usage | $0.00 |
| Catalog compaction data | (20 GB - 10 GB) × $0.005 per GB | $0.05 |
| Catalog compaction objects | 200,000 objects within included usage | $0.00 |
| **Catalog subtotal** | $0.00 + $0.05 + $0.00 | **$0.05** |
| SQL scans | (50 GB - 10 GB) × $0.0025 per GB | $0.10 |
| **SQL subtotal** | $0.10 | **$0.10** |
| **Pipelines subtotal** | Not used | **$0.00** |
| **Total Basin cost** | $0.05 + $0.10 | **$0.15** |

R2 costs are not included in this example.

## Basin Catalog with DuckDB or Trino

Assume 500,000 Catalog operations and 20 GB of compaction across 200,000 objects. Queries use an external engine instead of Basin SQL.

Monthly included allocations are otherwise unused. Configure [DuckDB](https://developers.cloudflare.com/basin-catalog/config-examples/duckdb/) or [Trino](https://developers.cloudflare.com/basin-catalog/config-examples/trino/) to access the Catalog.

| Product and dimension | Formula | Cost |
| --- | --- | --- |
| Catalog operations | 500,000 operations within included usage | $0.00 |
| Catalog compaction data | (20 GB - 10 GB) × $0.005 per GB | $0.05 |
| Catalog compaction objects | 200,000 objects within included usage | $0.00 |
| **Catalog subtotal** | $0.00 + $0.05 + $0.00 | **$0.05** |
| **Basin SQL subtotal** | Not used | **$0.00** |
| **Total Basin cost** | $0.05 + $0.00 | **$0.05** |

R2 costs are not included in this example.

For billing calculation details, refer to the [Cloudflare billing policy](https://developers.cloudflare.com/billing/understand/billing-policy/).

Was this helpful?

YesNo

## On this page

[![](https://developers.cloudflare.com/_astro/logo.te5VL_aD.svg)Docs](https://developers.cloudflare.com/)

```json
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/basin/platform/pricing/#page","headline":"Pricing","description":"Compare monthly rates across all Basin products.","url":"https://developers.cloudflare.com/basin/platform/pricing/","inLanguage":"en","image":"https://developers.cloudflare.com/basin/platform/pricing/og.png?v=1e7f03300ed545d3","dateModified":"2026-10-01","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
```

---

---
description: Record Worker requests with Basin Pipelines, store them in Basin Catalog, and count requests by path with Basin SQL.
title: CLI
image: https://developers.cloudflare.com/basin/get-started/guide/og.png?v=fc90943fcbbb8163
---

[Skip to content](#main-content)

> Documentation Index  
> Fetch the complete documentation index at: https://developers.cloudflare.com/basin/llms.txt  
> Use this file to discover all available pages before exploring further.

# CLI

Last updated Oct 1, 2026|Copy as Markdown| [View as Markdown](https://developers.cloudflare.com/basin/get-started/guide/index.md)| [Agent setup](https://developers.cloudflare.com/agent-setup/)

Build a request analytics pipeline with Wrangler.

Record requests to a Cloudflare Worker with Basin Pipelines, store them as an Apache Iceberg table in Basin Catalog, and count requests by path with Basin SQL.

`Worker → Basin Pipelines → Basin Catalog → Basin SQL`

## Prerequisites

- A Cloudflare account with Workers Paid and R2 enabled. Refer to [Basin Pipelines pricing](https://developers.cloudflare.com/basin-pipelines/platform/pricing/) and [Basin SQL pricing](https://developers.cloudflare.com/basin-sql/platform/pricing/) for availability and usage details.
- [Node.js and npm ↗︎](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm). The Worker starter installs Wrangler for you.
- An [R2 Account API token](https://developers.cloudflare.com/r2/api/tokens/) with **Admin Read & Write** permission. Create it from **R2 object storage** > **Overview** > **Manage API tokens**. Keep the token private. The setup command requests it, and Basin SQL uses the same token.

## Create and query request data

1. Create a JavaScript Hello World Worker with [C3 ↗︎](https://github.com/cloudflare/workers-sdk/tree/main/packages/create-cloudflare):npmyarnpnpm

   ```
   npm create cloudflare@latest -- hello-world-pipeline --type=hello-world --lang=js --no-deploy --no-git --accept-defaults
   ```

   ```
   yarn create cloudflare hello-world-pipeline --type=hello-world --lang=js --no-deploy --no-git --accept-defaults
   ```

   ```
   pnpm create cloudflare@latest hello-world-pipeline --type=hello-world --lang=js --no-deploy --no-git --accept-defaults
   ```

   Go to the project directory:

   ```sh
   cd hello-world-pipeline
   ```

   The starter creates `src/index.js` and `wrangler.jsonc`. If Wrangler requests authentication during the next step, log in:npmyarnpnpm

   ```
   npx wrangler login
   ```

   ```
   yarn wrangler login
   ```

   ```
   pnpm wrangler login
   ```


2. Create a stream, sink, and pipeline with the interactive setup:npmyarnpnpm

   ```
   npx wrangler basin pipelines setup --name request_events
   ```

   ```
   yarn wrangler basin pipelines setup --name request_events
   ```

   ```
   pnpm wrangler basin pipelines setup --name request_events
   ```

   In the setup prompts:
   - Turn off the HTTP endpoint. This Worker sends events through a binding.
   - Build the schema interactively with one required `string` field named `path`.
   - Select **Data Catalog (Iceberg)** and **Advanced**. Enter a unique R2 bucket name, such as `request-events-<UNIQUE_SUFFIX>`. Use namespace `default` and table `request_events`.
   - Enter your R2 Account API token. Accept the default compression and 100 MB file size, then set the roll interval to 60 seconds.
   - Confirm resource creation and select **Simple ingestion** for the pipeline SQL.

   Save the bucket name and the **stream ID** shown in the setup output. The Worker binding uses the stream ID, not the pipeline ID. If you missed it, list the streams and find `request_events_stream`:npmyarnpnpm

   ```
   npx wrangler basin pipelines streams list
   ```

   ```
   yarn wrangler basin pipelines streams list
   ```

   ```
   pnpm wrangler basin pipelines streams list
   ```


3. Add a `pipelines` property inside the root object of `wrangler.jsonc`. Replace `<STREAM_ID>` with the stream ID from setup, and keep the other generated properties:

   ```jsonc
   {
     "pipelines": [
       {
         "binding": "EVENTS",
         "stream": "<STREAM_ID>"
       }
     ]
   }
   ```

   ```toml
   [[pipelines]]
   binding = "EVENTS"
   stream = "<STREAM_ID>"
   ```

   In `src/index.js`, add one line before the existing response. The Worker still returns `Hello World!`:

   *src/index.jsjs*

   

   ```js
   export default {
   	async fetch(request, env, ctx) {
   		await env.EVENTS.send([{ path: new URL(request.url).pathname }]);
   		return new Response("Hello World!");
   	},
   };
   ```

   *src/index.tsts*

   

   ```ts
   export default {
     async fetch(request, env, ctx) {
       await env.EVENTS.send([{ path: new URL(request.url).pathname }]);
       return new Response("Hello World!");
     },
   };
   ```

   The binding handles ingestion authentication. Do not add your R2 API token to the Worker or `wrangler.jsonc`.
4. Deploy the Worker:npmyarnpnpm

   ```
   npx wrangler deploy
   ```

   ```
   yarn wrangler deploy
   ```

   ```
   pnpm wrangler deploy
   ```

   Open the URL printed by Wrangler at `/` and `/example`. Both paths display `Hello World!`, and each request records its path. Refresh `/` to record another request.
5. Get the warehouse name associated with your R2 bucket:npmyarnpnpm

   ```
   npx wrangler basin catalog get <YOUR_BUCKET>
   ```

   ```
   yarn wrangler basin catalog get <YOUR_BUCKET>
   ```

   ```
   pnpm wrangler basin catalog get <YOUR_BUCKET>
   ```

   Set the token in your terminal session, then count requests by path:

   ```sh
   export WRANGLER_BASIN_SQL_AUTH_TOKEN="<YOUR_R2_ACCOUNT_API_TOKEN>"
   ```

   npmyarnpnpm

   ```
   npx wrangler basin sql query "<WAREHOUSE_NAME>" "SELECT path, COUNT(*) AS requests FROM default.request_events GROUP BY path ORDER BY requests DESC"
   ```

   ```
   yarn wrangler basin sql query "<WAREHOUSE_NAME>" "SELECT path, COUNT(*) AS requests FROM default.request_events GROUP BY path ORDER BY requests DESC"
   ```

   ```
   pnpm wrangler basin sql query "<WAREHOUSE_NAME>" "SELECT path, COUNT(*) AS requests FROM default.request_events GROUP BY path ORDER BY requests DESC"
   ```

   Replace `<WAREHOUSE_NAME>` with the value from the catalog command. The results should include `/` and `/example` with request counts. Other paths, such as `/favicon.ico`, may also appear. If the table is not found or returns no rows, wait a few minutes for the first file to be written, then run the query again.

## Next steps

Add a timestamp, request method, or country to the events after your first query works. For more detail, refer to [Basin Pipelines getting started](https://developers.cloudflare.com/basin-pipelines/getting-started/), [Basin Catalog getting started](https://developers.cloudflare.com/basin-catalog/get-started/), [Basin SQL getting started](https://developers.cloudflare.com/basin-sql/get-started/), and [Workers bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/).

Was this helpful?

YesNo

## On this page

[![](https://developers.cloudflare.com/_astro/logo.te5VL_aD.svg)Docs](https://developers.cloudflare.com/)

```json
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/basin/get-started/guide/#page","headline":"CLI","description":"Record Worker requests with Basin Pipelines, store them in Basin Catalog, and count requests by path with Basin SQL.","url":"https://developers.cloudflare.com/basin/get-started/guide/","inLanguage":"en","image":"https://developers.cloudflare.com/basin/get-started/guide/og.png?v=fc90943fcbbb8163","dateModified":"2026-10-01","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
```

---

---
description: Use example prompts to send Worker, Cloudflare service, and application events through Basin Pipelines to Basin Catalog and Basin SQL.
title: Prompt an agent to build with Basin
image: https://developers.cloudflare.com/basin/get-started/prompting/og.png?v=ca4de2305646432d
---

[Skip to content](#main-content)

> Documentation Index  
> Fetch the complete documentation index at: https://developers.cloudflare.com/basin/llms.txt  
> Use this file to discover all available pages before exploring further.

# Prompt an agent to build with Basin

Last updated Oct 1, 2026|Copy as Markdown| [View as Markdown](https://developers.cloudflare.com/basin/get-started/prompting/index.md)| [Agent setup](https://developers.cloudflare.com/agent-setup/)

Describe the events you want to collect and the question you want to answer. Your coding agent can instrument a Worker or application, send events to Basin Pipelines, write an Iceberg table in Basin Catalog, and query it with Basin SQL.

`Source → Basin Pipelines → Basin Catalog → Basin SQL`

## Try a first prompt

Copy this prompt to build a request analytics workflow from a Hello World Worker:

```txt
Start with the JavaScript Hello World Worker. Use basin pipelines setup to create a stream with one required string field named path, a simple-ingestion pipeline, and a Basin Catalog table named default.request_events. Add one Worker binding call that sends new URL(request.url).pathname on each request while keeping the Hello World response. Deploy it, visit / and /example, then count requests by path with Basin SQL. Keep the resources so I can inspect them.
```

For the full working procedure, follow the [Basin CLI guide](https://developers.cloudflare.com/basin/get-started/guide/).

## Give your agent current documentation

Connect the [Cloudflare documentation Model Context Protocol (MCP) server ↗︎](https://docs.mcp.cloudflare.com/mcp) to your editor or agent. It can retrieve current commands, binding fields, permissions, and limits. The [Cloudflare Observability MCP server ↗︎](https://observability.mcp.cloudflare.com/mcp) can help inspect Worker logs and exceptions. Neither connection grants account access or replaces checks of Basin Pipelines delivery and Basin SQL results.

Point your agent to the [Basin Pipelines](https://developers.cloudflare.com/basin-pipelines/), [Basin Catalog](https://developers.cloudflare.com/basin-catalog/), and [Basin SQL](https://developers.cloudflare.com/basin-sql/) documentation before it creates resources.

## Choose a data source

Choose an ingestion path before asking the agent to write code:

| Data source | Recommended path |
| --- | --- |
| Requests or application events handled by a Worker | Send a small JSON record through a [Basin Pipelines stream binding](https://developers.cloudflare.com/basin-pipelines/streams/writing-to-streams/#send-via-workers). The binding handles ingestion authentication. |
| Activity involving D1, Queues, R2, Workers AI, or another Cloudflare service | Instrument the Worker or application that uses the service. Record the outcome and only the fields needed for analysis. |
| Events from an external application | Use an [authenticated stream HTTP endpoint](https://developers.cloudflare.com/basin-pipelines/streams/writing-to-streams/#send-via-http) with a token that has **Basin Pipelines Send** permission. |

Do not assume a service exposes a direct Basin Pipelines source. If it does not, collect events where your application uses that service.

If you combine sources, use separate tables unless their schemas match. Verify fields and shared identifiers before joining records with Basin SQL. Otherwise, compare aggregates over a time window.

Pipelines SQL uses `INSERT INTO sink SELECT ... FROM stream` to transform and route incoming records. Use Basin SQL for `GROUP BY`, joins, and reports after data reaches an Iceberg table. A plain R2 JSON or Parquet sink is not a Basin SQL table.

## More example prompts

### Add telemetry to an existing Worker

```txt
Instrument my existing Worker to record the route, response status, and request duration in a Basin Pipelines stream. Preserve the response and avoid request bodies, tokens, and client IP addresses. Write the events to a Basin Catalog Iceberg table, then use Basin SQL to count requests and errors by route. Show how to verify that events reach the table.
```

### Measure D1 operations

```txt
In the Worker that uses D1, record a short operation label, success or failure, and elapsed time for each database operation. Send these records through a Basin Pipelines stream binding to a Basin Catalog Iceberg table. Do not include SQL parameters or result data. Use Basin SQL to compare operation counts and error rates. Keep the existing database behavior intact.
```

### Track Queue processing

```txt
Instrument my Queue consumer Worker to record the message type, processing outcome, and duration through a Basin Pipelines stream binding. Do not store message bodies or secrets. Write the events to a Basin Catalog Iceberg table and use Basin SQL to count successful and failed processing attempts. Preserve the consumer's existing retry behavior.
```

### Route an existing stream

```txt
Take my existing Basin Pipelines stream of JSON application events and write purchases and signups to separate Basin Catalog tables. Inspect the real stream schema, then use supported Pipelines INSERT INTO ... SELECT statements to route records. Provide Basin SQL queries that count each event type. Preserve the existing stream and explain which sinks and tables you create.
```

### Ingest external JSON events

```txt
My external service sends JSON events over HTTP. Create an authenticated Basin Pipelines stream endpoint and an Iceberg sink in Basin Catalog. Show a minimal request, the required Basin Pipelines Send token permission, one Basin SQL validation query, and how to detect dropped events. Keep tokens out of source files and URLs.
```

### Track R2 object activity

```txt
In the Worker that reads and writes R2 objects, record the operation type, outcome, and duration through a Basin Pipelines stream binding. Do not record object contents, credentials, or full object keys. Write the events to a Basin Catalog Iceberg table and use Basin SQL to count operations and failures by type. Preserve existing R2 behavior.
```

## Reusable base prompt

Replace the text inside `<user_prompt>` with your data source, the fields you need, and the question you want to answer. The tags organize instructions for your agent; they are not part of a Cloudflare configuration.

```txt
<system_context>
You are building a Cloudflare Basin workflow. Check current Cloudflare documentation for Basin Pipelines, Basin Catalog, Basin SQL, Workers, and any source service before choosing commands or APIs.
</system_context>

<source_selection>
Choose the path that fits the request:
- Worker events: use a Basin Pipelines stream binding and await env.STREAM.send([record]). Configure the binding with a stream ID using the "stream" field in wrangler.jsonc.
- Activity involving D1, Queues, R2, Workers AI, or another Cloudflare service: instrument the Worker or application that performs the operation. Inspect its code and choose a small event schema.
- External application events: use an authenticated HTTP stream endpoint.
Do not invent a direct service connector. Keep separate sources in separate tables unless their schemas match.
</source_selection>

<basin_rules>
- When the goal includes Basin SQL, write Apache Iceberg tables through a Basin Catalog sink. A plain R2 JSON or Parquet sink is different.
- Use the current Wrangler commands: basin pipelines setup, basin catalog get <BUCKET_NAME>, and basin sql query <WAREHOUSE_NAME> <SQL>. Set WRANGLER_BASIN_SQL_AUTH_TOKEN for SQL queries. Keep the "stream" binding field; do not use the deprecated "pipeline" field.
- Use Pipelines SQL for supported ingestion transforms and routing. Use Basin SQL for aggregations, joins, and analysis after data lands.
- Inspect the actual application events and stream schema before naming columns. Verify a shared key before joining sources.
- Do not place tokens in Worker code, wrangler.jsonc, URLs, or generated documentation. Worker bindings handle ingestion authentication. Scope tokens for HTTP ingestion, catalog writes, and SQL queries.
- Keep event records minimal and avoid sensitive request fields unless required.
</basin_rules>

<verification>
Show the resources and files needed for the chosen path. Provide one small sample event and a query against the actual warehouse and namespace.table. Verify source ingestion, the Iceberg table, and the Basin SQL result. Check Basin Pipelines metrics and user errors if rows are missing. Allow a few minutes for the first Iceberg file. State what you tested and what still needs account access.
</verification>

<user_prompt>
Describe the data source, event fields, and question to answer.
</user_prompt>
```

## Verify the result

1. Confirm that the Worker or application sent an event to the stream. A successful Worker `send()` confirms ingestion, not a table row.
2. Confirm that Basin Pipelines writes to a Basin Catalog Iceberg sink. Check records and files written in [Pipelines metrics](https://developers.cloudflare.com/basin-pipelines/observability/metrics/).
3. Run a small `SELECT ... LIMIT 10` query with [Basin SQL](https://developers.cloudflare.com/basin-sql/query-data/). If the table is missing or empty, wait for the first file roll and retry.
4. If rows are still missing, inspect [Pipelines user error metrics](https://developers.cloudflare.com/basin-pipelines/observability/metrics/#user-error-metrics) for missing fields, type mismatches, parse failures, and null values.

Was this helpful?

YesNo

## On this page

[![](https://developers.cloudflare.com/_astro/logo.te5VL_aD.svg)Docs](https://developers.cloudflare.com/)

```json
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/basin/get-started/prompting/#page","headline":"Prompt an agent to build with Basin","description":"Use example prompts to send Worker, Cloudflare service, and application events through Basin Pipelines to Basin Catalog and Basin SQL.","url":"https://developers.cloudflare.com/basin/get-started/prompting/","inLanguage":"en","image":"https://developers.cloudflare.com/basin/get-started/prompting/og.png?v=ca4de2305646432d","dateModified":"2026-10-01","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
```
