FlowDSL
Studio
Reference

Communication Protocols

All communication protocols supported by FlowDSL — gRPC, HTTP, NATS, Kafka, Redis, ZeroMQ, RabbitMQ, and WebSockets.

FlowDSL is a language for describing communication between nodes. A node declares the protocols it supports via runtime.supports (an array). The specific protocol used for a connection is selected on the edge via the protocol field.

Supported protocols

ProtocolTypeLatencyThroughputStreamingBroker requiredBest for
In-ProcessFunction call~µsHighestN/ANoSame-language transforms
gRPCRPC~msVery highBidirectionalNoCross-language commands, streaming
HTTPRPC~msHighNo (polling)NoLegacy nodes, simple integrations
NATSPub/Sub + RPC~msVery highJetStreamYes (lightweight)Events, service mesh, request/reply
KafkaStreaming~10msHighestContinuousYesData pipelines, audit logs, fan-out
RedisPub/Sub~msHighPub/SubYesBurst smoothing, real-time notifications
ZeroMQBrokerless messaging~µsVery highPatternsNoHigh-perf local messaging, IoT
RabbitMQMessage queue~msHighNoYesWorkflow routing, dead-letter queues
WebSocketBidirectional stream~msHighFull-duplexNoBrowser clients, real-time dashboards

How to choose

text
Is the node in the same process?
  → proc

Need cross-language RPC?
  → gRPC (default, recommended)

Need pub/sub with request/reply?
  → NATS

Need durable stream processing / event sourcing?
  → Kafka

Need burst smoothing / ephemeral messaging?
  → Redis Pub/Sub

Need high-perf brokerless messaging?
  → ZeroMQ

Need advanced routing / dead-letter queues?
  → RabbitMQ

Need browser-facing real-time updates?
  → WebSocket

Legacy system with HTTP-only API?
  → HTTP (not recommended for new nodes)

Strategic guidance

Use caseRecommended protocol
Commands (request/response)gRPC
Events (fire-and-forget)NATS, RabbitMQ
Data pipelines (high-throughput)Kafka
Real-time notificationsRedis, WebSocket
IoT / embeddedZeroMQ
Browser integrationWebSocket

In-Process

No network call. The runtime invokes the node as a direct function call within the same process.

json
{
  "runtime": {
    "supports": ["proc"]
  }
}

No configuration needed. This is automatically selected for direct delivery mode when source and target share the same language runtime.


gRPC

Default protocol. Binary serialization via Protobuf, native bidirectional streaming, automatic code generation.

json
{
  "runtime": {
    "supports": ["grpc"],
    "grpc": {
      "port": 50051,
      "streaming": true,
      "maxConcurrentStreams": 100,
      "tls": true
    }
  }
}

Configuration

FieldTypeDefaultDescription
grpc.portinteger50051gRPC listen port
grpc.streamingbooleanfalseEnable InvokeStream server-streaming
grpc.maxConcurrentStreamsintegerMax concurrent gRPC streams
grpc.tlsbooleanRequire TLS for connections

NodeService contract

protobuf
service NodeService {
  rpc Invoke       (InvokeRequest)  returns (InvokeResponse);
  rpc InvokeStream (InvokeRequest)  returns (stream InvokeResponse);
  rpc Health       (Empty)          returns (HealthResponse);
  rpc Manifest     (Empty)          returns (ManifestResponse);
}
RPCDescription
InvokeUnary request/response
InvokeStreamServer-streaming for LLM and long-running nodes
HealthReadiness check (SERVING / NOT_SERVING)
ManifestAuto-registration — returns the full node manifest

Port conventions

LanguageDefault portEnvironment variable
Go50051FLOWDSL_GRPC_PORT
Python50052FLOWDSL_GRPC_PORT
JavaScript50053FLOWDSL_GRPC_PORT

TLS

Enable TLS by setting grpc.tls: true. The runtime reads certificate/key from FLOWDSL_TLS_CERT and FLOWDSL_TLS_KEY environment variables.


HTTP

REST/JSON over HTTP. Supported for legacy integrations but not recommended for new nodes.

json
{
  "runtime": {
    "supports": ["http"]
  }
}

HTTP nodes expose a POST /invoke endpoint. The runtime sends JSON-serialized packets and expects a JSON response. No streaming support.


NATS

Lightweight, high-performance messaging with pub/sub, request/reply, and queue groups.

json
{
  "runtime": {
    "supports": ["nats"],
    "nats": {
      "url": "nats://localhost:4222",
      "subject": "flowdsl.nodes.my_node",
      "queueGroup": "workers"
    }
  }
}

Configuration

FieldTypeDefaultDescription
nats.urlstring (uri)NATS server URL
nats.subjectstringNATS subject to subscribe/publish on
nats.queueGroupstringQueue group for load balancing across node instances

When to use

  • Service mesh communication with request/reply semantics
  • Event distribution where message ordering per subject is sufficient
  • Lightweight pub/sub without the overhead of Kafka
  • Microservice discovery via subjects

Kafka

Durable stream processing with consumer groups, partitioning, and exactly-once semantics.

json
{
  "runtime": {
    "supports": ["kafka"]
  }
}

Kafka transport is also used by the stream delivery mode. When a node supports kafka, it means the node natively consumes from or produces to Kafka topics. The delivery mode's Kafka usage is configured separately on edges.

When to use

  • High-throughput data pipelines (100K+ msg/sec)
  • Event sourcing and audit logging
  • Fan-out to multiple consumer groups
  • Stream processing with replay capability

Redis Pub/Sub

Fast publish/subscribe over Redis. No message persistence — subscribers must be connected to receive messages.

json
{
  "runtime": {
    "supports": ["redis"],
    "redis": {
      "url": "redis://localhost:6379",
      "channel": "flowdsl.nodes.my_node"
    }
  }
}

Configuration

FieldTypeDefaultDescription
redis.urlstring (uri)Redis server URL
redis.channelstringRedis channel or pattern to subscribe to

When to use

  • Real-time notifications where message loss is acceptable
  • Cache invalidation events
  • Burst smoothing (also used by ephemeral delivery mode)
  • Simple pub/sub without dedicated message broker infrastructure

ZeroMQ

Brokerless, low-latency messaging library. Runs peer-to-peer without a central broker.

json
{
  "runtime": {
    "supports": ["zeromq"],
    "zeromq": {
      "address": "tcp://localhost:5555",
      "pattern": "pushPull"
    }
  }
}

Configuration

FieldTypeDefaultDescription
zeromq.addressstringZeroMQ bind/connect address
zeromq.patternstringMessaging pattern: pubSub, pushPull, or reqRep

Patterns

PatternDescription
pubSubOne-to-many fan-out
pushPullLoad-balanced work distribution
reqRepSynchronous request/reply

When to use

  • Ultra-low-latency messaging (~µs)
  • IoT and embedded systems
  • High-frequency data distribution without broker overhead
  • In-datacenter node communication

RabbitMQ

Full-featured message broker with exchanges, routing keys, and dead-letter queues.

json
{
  "runtime": {
    "supports": ["rabbitmq"],
    "rabbitmq": {
      "url": "amqp://localhost:5672",
      "exchange": "flowdsl.nodes",
      "routingKey": "my_node.invoke",
      "queue": "my_node_tasks"
    }
  }
}

Configuration

FieldTypeDefaultDescription
rabbitmq.urlstring (uri)AMQP connection URL
rabbitmq.exchangestringExchange name
rabbitmq.routingKeystringRouting key for message routing
rabbitmq.queuestringQueue name for consuming

When to use

  • Complex routing logic (topic exchanges, headers routing)
  • Dead-letter queues for failed message handling
  • Priority queues
  • Workflows requiring message acknowledgement and redelivery

WebSocket

Full-duplex bidirectional communication over a single TCP connection.

json
{
  "runtime": {
    "supports": ["websocket"],
    "websocket": {
      "url": "ws://localhost:8080",
      "path": "/nodes/my_node"
    }
  }
}

Configuration

FieldTypeDefaultDescription
websocket.urlstring (uri)WebSocket server URL
websocket.pathstringWebSocket endpoint path

When to use

  • Browser-facing real-time dashboards
  • Live data feeds to frontend clients
  • Nodes that need persistent bidirectional connections
  • Integration with WebSocket-only external services

Protocol resolution

The runtime resolves the actual transport at deploy time based on the delivery mode and node configuration:

Delivery modeTransport resolution
direct (same lang)In-process function call
direct (diff lang)gRPC (transparent upgrade)
ephemeralRedis
checkpointMongoDB
durableMongoDB
streamKafka

The supports field on a node defines which communication protocols the node can use. The flow author selects a specific protocol on each edge via the protocol field. The delivery.mode on an edge defines the delivery semantics — how packets flow between nodes including durability guarantees.

Next steps

Copyright © 2026