Cloudflare Deployment

Run SummonFlow on the edge with Cloudflare Workers and Durable Objects.

Why Cloudflare

Cloudflare Workers with Durable Objects provide globally distributed WebSocket handling. Each Durable Object maintains state for a set of channels, giving you edge-native routing without managing servers.

This is the best option if you need connections handled as close to your users as possible with minimal latency.

Architecture

Worker

Handles incoming WebSocket upgrades, routes connections to the correct Durable Object based on app key.

Durable Object

Manages channel state, subscriber lists, and message broadcasting for a set of channels. State persists across requests.

Configuration

# wrangler.toml
name = "summon-flow"
main = "src/index.ts"

[[durable_objects.bindings]]
name = "CHANNEL_MANAGER"
class_name = "ChannelManager"

Trade-offs

  • Lower latency for globally distributed users.
  • No Redis needed for fanout — Durable Objects handle state.
  • More complex deployment than Railway.
  • Durable Object limits apply (128 MB memory, 30s CPU per request).