Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Comprehensive Cloudflare platform skill covering Workers, D1, R2, KV, AI, Durable Objects, and security.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/pipelines/gotchas.md
1# Pipelines Gotchas23## Critical Issues45### Events Silently Dropped67**Most common issue.** Events accepted (HTTP 200) but never appear in sink.89**Causes:**101. Schema validation fails - structured streams drop invalid events silently112. Waiting for roll interval (10-300s) - expected behavior1213**Solution:** Validate client-side with Zod:14```typescript15const EventSchema = z.object({ user_id: z.string(), amount: z.number() });16try {17const validated = EventSchema.parse(rawEvent);18await env.STREAM.send([validated]);19} catch (e) { /* get immediate feedback */ }20```2122### Pipelines Are Immutable2324Cannot modify SQL after creation. Must delete and recreate.2526```bash27npx wrangler pipelines delete old-pipeline28npx wrangler pipelines create new-pipeline --sql "..."29```3031**Tip:** Use version naming (`events-pipeline-v1`) and keep SQL in version control.3233### Worker Binding Not Found3435**`env.STREAM is undefined`**36371. Use **stream ID** (not pipeline ID) in `wrangler.jsonc`382. Redeploy after adding binding3940```bash41npx wrangler pipelines streams list # Get stream ID42npx wrangler deploy43```4445## Common Errors4647| Error | Cause | Fix |48|-------|-------|-----|49| Events not in R2 | Roll interval not elapsed | Wait 10-300s, check `roll_interval` |50| Schema validation failures | Type mismatch, missing fields | Validate client-side |51| Rate limit (429) | >5 MB/s per stream | Batch events, request increase |52| Payload too large (413) | >1 MB request | Split into smaller batches |53| Cannot delete stream | Pipeline references it | Delete pipelines first |54| Sink credential errors | Token expired | Recreate sink with new credentials |5556## Limits (Open Beta)5758| Resource | Limit |59|----------|-------|60| Streams/Sinks/Pipelines per account | 20 each |61| Payload size | 1 MB |62| Ingest rate per stream | 5 MB/s |63| Event retention | 24 hours |64| Recommended batch size | 100 events |6566## SQL Limitations6768- **No JOINs** - single stream per pipeline69- **No window functions** - basic SQL only70- **No subqueries** - must use `INSERT INTO ... SELECT ... FROM`71- **No schema evolution** - cannot modify after creation7273## Debug Checklist7475- [ ] Stream exists: `npx wrangler pipelines streams list`76- [ ] Pipeline healthy: `npx wrangler pipelines get <ID>`77- [ ] SQL syntax matches schema78- [ ] Worker redeployed after binding added79- [ ] Waited for roll interval80- [ ] Accepted vs processed count matches (no validation drops)81