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/argo-smart-routing/gotchas.md
1## Best Practices Summary23**Smart Shield Note:** Argo Smart Routing evolving into Smart Shield. Best practices below remain applicable; monitor Cloudflare changelog for Smart Shield updates.451. **Always check editability** before attempting to enable/disable Argo62. **Set up billing notifications** to avoid unexpected costs73. **Combine with Tiered Cache** for maximum performance benefit84. **Use in production only** - disable for dev/staging to control costs95. **Monitor analytics** - require 500+ requests in 48h for detailed metrics106. **Handle errors gracefully** - check for billing, permissions, zone compatibility117. **Test configuration changes** in staging before production128. **Use TypeScript SDK** for type safety and better developer experience139. **Implement retry logic** for API calls in production systems1410. **Document zone-specific settings** for team visibility1516## Common Errors1718### "Argo unavailable"1920**Problem:** API returns error "Argo Smart Routing is unavailable for this zone"2122**Cause:** Zone not eligible or billing not set up2324**Solution:**251. Verify zone has Enterprise or higher plan262. Check billing is configured in Account → Billing273. Ensure payment method is valid and current284. Contact Cloudflare support if eligibility unclear2930### "Cannot enable/disable"3132**Problem:** API call succeeds but status remains unchanged, or `editable: false` in GET response3334**Cause:** Insufficient permissions or zone restrictions3536**Solution:**371. Check API token has `Zone:Argo Smart Routing:Edit` permission382. Verify `editable: true` in GET response before attempting PATCH393. If `editable: false`, check:40- Billing configured for account41- Zone plan includes Argo (Enterprise+)42- No active zone holds or suspensions43- API token has correct scopes4445### `editable: false` Error4647**Problem:** GET request returns `"editable": false`, preventing enable/disable4849**Cause:** Zone-level restrictions from billing, plan, or permissions5051**Solution Pattern:**52```typescript53const status = await client.argo.smartRouting.get({ zone_id: zoneId });5455if (!status.editable) {56// Don't attempt to modify - will fail57console.error('Cannot modify Argo settings:');58console.error('- Check billing is configured');59console.error('- Verify zone has Enterprise+ plan');60console.error('- Confirm API token has Edit permission');61throw new Error('Argo is not editable for this zone');62}6364// Safe to proceed with enable/disable65await client.argo.smartRouting.edit({ zone_id: zoneId, value: 'on' });66```6768### Rate Limiting6970**Problem:** `429 Too Many Requests` error from API7172**Cause:** Exceeded API rate limits (typically 1200 requests per 5 minutes)7374**Solution:**75```typescript76import { RateLimitError } from 'cloudflare';7778try {79await client.argo.smartRouting.edit({ zone_id: zoneId, value: 'on' });80} catch (error) {81if (error instanceof RateLimitError) {82const retryAfter = error.response?.headers.get('retry-after');83console.log(`Rate limited. Retry after ${retryAfter} seconds`);8485// Implement exponential backoff86await new Promise(resolve => setTimeout(resolve, (retryAfter || 60) * 1000));87// Retry request88}89}90```9192## Limits9394| Resource/Limit | Value | Notes |95|----------------|-------|-------|96| Min requests for analytics | 500 in 48h | For detailed metrics via GraphQL |97| Zones supported | Enterprise+ | Check zone plan in dashboard |98| Billing requirement | Must be configured | Before enabling; verify payment method |99| API rate limit | 1200 req / 5 min | Per API token across all endpoints |100| Spectrum apps | No hard limit | Each app can enable Argo independently |101| Traffic counting | Proxied only | Only orange-clouded DNS records count |102| DDoS/WAF exemption | Yes | Mitigated traffic excluded from billing |103| Analytics latency | 1-5 minutes | Real-time metrics not available |104105## Additional Resources106107- [Official Argo Smart Routing Docs](https://developers.cloudflare.com/argo-smart-routing/)108- [Cloudflare Smart Shield](https://developers.cloudflare.com/smart-shield/)109- [API Authentication](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/)110- [Cloudflare TypeScript SDK](https://github.com/cloudflare/cloudflare-typescript)111- [Cloudflare Python SDK](https://github.com/cloudflare/cloudflare-python)112