Skip to main content

Transport Layer Overview

The Stepflow Protocol supports multiple transport mechanisms to accommodate different deployment scenarios. Each transport maintains the same JSON-RPC message format while providing different connectivity patterns, performance characteristics, and operational requirements.

This page covers transport characteristics and implementation details. For detailed JSON-RPC message structure and field specifications, see Message Format. For transport configuration, see Configuration.

Transport Types

Both transports use the same JSON-RPC messages described in the Message Format documentation, but differ in how the messages are transmitted. Currently, they both use JSON as the serialization format, but other serialization formats (eg., messagepack, protobuf) may be supported in the future.

STDIO Transport

Process-based communication using standard input/output streams

  • Use Case: Local component servers running as subprocesses
  • Connectivity: Bidirectional communication over stdin/stdout
  • Lifecycle: Managed by the Stepflow runtime (process spawning/termination)
  • Performance: Low latency, high throughput for local operations
  • Scaling: One process per plugin instance

See Configuration Documentation for transport configuration details.

HTTP Transport

Network-based communication using HTTP and Server-Sent Events

  • Use Case: Distributed component servers, microservices architecture
  • Connectivity: HTTP requests with optional SSE for bidirectional communication
  • Lifecycle: Independent server processes managed separately
  • Performance: Network-dependent latency, excellent for distributed systems
  • Scaling: Horizontal scaling with load balancing

See Configuration Documentation for transport configuration details.

Transport Comparison

FeatureSTDIOHTTP
LatencyVery LowLow-Medium
ThroughputHighMedium-High
DistributionLocal OnlyNetwork
Process ManagementRuntime ManagedExternal
Session IsolationProcess-basedOptional MCP
BidirectionalNativeSSE-based
Error RecoveryProcess RestartConnection Retry
DevelopmentSimpleMore Complex

Transport-Specific Considerations

STDIO Transport

  • Line-delimited JSON: Each message is a single line terminated by \n
  • UTF-8 encoding: All text must be valid UTF-8
  • Buffer limits: Limited by OS pipe buffer sizes (typically 64KB)
  • Process lifecycle: Component server process lifecycle tied to connection

HTTP Transport

  • HTTP POST: JSON-RPC requests sent as POST to configured URL
  • Content-Type: application/json; charset=utf-8
  • Response correlation: HTTP request-response pairs maintain correlation
  • Session management: Optional MCP-style session negotiation for isolation

Bidirectional Communication

Both transports support bidirectional communication, allowing component servers to make requests back to the runtime during execution.

STDIO Bidirectional

Uses the same stdin/stdout channels with JSON-RPC request/response correlation:

HTTP Bidirectional

Uses Server-Sent Events (SSE) for server-to-runtime requests:

Next Steps