Learn how to:
- Create and configure streams for data ingestion
- View and update stream settings
- Delete streams when no longer needed
Streams are made available to pipelines as SQL tables using the stream name (for example, SELECT * FROM my_stream).
-
In the Cloudflare dashboard, go to the Basin Pipelines page.
Go to Pipelines ↗ -
Select Create Pipeline to launch the pipeline creation wizard.
-
Complete the wizard to create your stream along with the associated sink and pipeline.
To create a stream, run the basin pipelines streams create command:
npx wrangler basin pipelines streams create <STREAM_NAME>yarn wrangler basin pipelines streams create <STREAM_NAME>pnpm wrangler basin pipelines streams create <STREAM_NAME>Alternatively, to use the interactive setup wizard that helps you configure a stream, sink, and pipeline, run the basin pipelines setup command:
npx wrangler basin pipelines setupyarn wrangler basin pipelines setuppnpm wrangler basin pipelines setupStreams support two approaches for handling data:
- Structured streams: Define a schema with specific fields and data types. Events are validated against the schema.
- Unstructured streams: Accept any valid JSON without validation. These streams have a single
valuecolumn containing the JSON data.
To create a structured stream, provide a schema file:
npx wrangler basin pipelines streams create my-stream --schema-file schema.jsonyarn wrangler basin pipelines streams create my-stream --schema-file schema.jsonpnpm wrangler basin pipelines streams create my-stream --schema-file schema.jsonExample schema file:
{
"fields": [
{
"name": "user_id",
"type": "string",
"required": true
},
{
"name": "amount",
"type": "float64",
"required": false
},
{
"name": "tags",
"type": "list",
"required": false,
"items": {
"type": "string"
}
},
{
"name": "metadata",
"type": "struct",
"required": false,
"fields": [
{
"name": "source",
"type": "string",
"required": false
},
{
"name": "priority",
"type": "int32",
"required": false
}
]
}
]
}Supported data types:
string- Text valuesint32,int64- Integer numbersfloat32,float64- Floating-point numbersbool- Boolean true/falsetimestamp- RFC 3339 timestamps, or numeric values parsed as Unix seconds, milliseconds, or microseconds (depending on unit)json- JSON objectsbinary- Binary data (base64-encoded)list- Arrays of valuesstruct- Nested objects with defined fields
-
In the Cloudflare dashboard, go to Basin Pipelines > Streams.
-
Select a stream to view its associated configuration.
To view a specific stream, run the basin pipelines streams get command with either the stream ID or stream name:
npx wrangler basin pipelines streams get <STREAM_NAME_OR_ID>yarn wrangler basin pipelines streams get <STREAM_NAME_OR_ID>pnpm wrangler basin pipelines streams get <STREAM_NAME_OR_ID>To list all streams in your account, run the basin pipelines streams list command:
npx wrangler basin pipelines streams listyarn wrangler basin pipelines streams listpnpm wrangler basin pipelines streams listYou can update certain HTTP ingest settings after stream creation. Schema modifications are not supported once a stream is created.
-
In the Cloudflare dashboard, go to Basin Pipelines > Streams.
-
Select the stream you want to update.
-
In the Settings tab, go to HTTP Ingest.
-
To turn on or turn off HTTP ingestion, select Enable or Disable.
-
To update authentication and CORS settings, select Edit and modify.
-
Save your changes.
-
In the Cloudflare dashboard, go to Basin Pipelines > Streams.
-
Select the stream you want to delete.
-
In the Settings tab, go to General, and select Delete.
To delete a stream, run the basin pipelines streams delete command:
npx wrangler basin pipelines streams delete <STREAM_ID>yarn wrangler basin pipelines streams delete <STREAM_ID>pnpm wrangler basin pipelines streams delete <STREAM_ID>