FlowDSL
Redelay is the reference FlowDSL runtime for Go and Python. This guide covers the full integration: writing the flow file, binding nodes to handlers, validating, and visualising.
1. Write your flow file
Place a .flowdsl.yaml alongside your service code:
flowdsl: "1.0"
info:
title: My Pipeline
version: "1.0.0"
nodes:
IngestData:
operationId: ingest
kind: source
ProcessData:
operationId: process
kind: action
edges:
- from: IngestData
to: ProcessData
delivery:
mode: durable
packet: DataPayload
components:
packets:
DataPayload:
type: object
properties:
id: { type: string }
value: { type: number }
required: [id, value]
2. Reference your AsyncAPI schema
Redelay auto-generates an AsyncAPI schema at /openapi.json. Reference it from your FlowDSL packets to avoid duplicating schemas:
components:
packets:
DataPayload:
$ref: "https://api.myservice.com/asyncapi.json#/components/schemas/DataPayload"
3. Bind nodes to handlers
Each operationId corresponds to a registered event handler matched by (entity_type, action):
// operationId: process → this handler
bus.Register(&modules.ConsumerRegistration{
Topic: "data.ingested",
GroupID: "pipeline-worker",
Handler: func(ctx context.Context, msg *modules.EventMessage) error {
var p DataPayload
json.Unmarshal(msg.Payload, &p)
return process(ctx, p)
},
})
Python equivalent coming soon.
Node.js equivalent coming soon.
4. Validate
# Validate syntax and structural rules
redelayctl validate my-pipeline.flowdsl.yaml
# Install FlowDSL CLI
npm install -g @flowdsl/cli
# Validate syntax
flowdsl validate my-pipeline.flowdsl.yaml
# Validate packets against live AsyncAPI
flowdsl lint \
--asyncapi https://api.myservice.com/asyncapi.json \
my-pipeline.flowdsl.yaml
5. Expose workflows as subworkflow nodes
Modules that implement FlowDSLProvider automatically get subworkflow nodes generated at
runtime. These nodes appear in the module browser (/modules) and the JSON spec
(/modules.json).
To provide workflows from your module, implement FlowDSLFragments():
func (m *MyModule) FlowDSLFragments() []*ir.Workflow {
return []*ir.Workflow{
{
ID: "my_pipeline",
Name: "My Pipeline",
Triggers: []string{"data.ingested"},
Nodes: []*ir.Node{
{ID: "validate", Name: "Validate", Kind: ir.NodeKindAction},
{ID: "process", Name: "Process", Kind: ir.NodeKindAction},
{ID: "done", Name: "Done", Kind: ir.NodeKindEnd},
},
Edges: []*ir.Edge{
{From: "validate", To: "process"},
{From: "process", To: "done"},
},
},
}
}
The registry auto-generates a subworkflow node with:
- ID:
<module-id>/my-pipeline - Kind:
subworkflow - Input port:
DataIngested(derived from triggerdata.ingested) - Output port:
Output(derived from the terminaldonenode) - WorkflowRef:
my_pipeline
To override the auto-generated node, implement FlowDSLNodesProvider and return a
FlowDSLNode with the same WorkflowRef.
6. Use pre-built FlowDSL node subpackages
Redelay modules ship with ready-made FlowDSL nodes via flowdsl/ subpackages. Enable them
with a blank import alongside the core module:
import (
_ "github.com/redelay/go-framework/modules/auth"
_ "github.com/redelay/go-framework/modules/auth/flowdsl" // 7 nodes
_ "github.com/redelay/go-framework/modules/users"
_ "github.com/redelay/go-framework/modules/users/flowdsl" // 8 nodes
_ "github.com/redelay/go-modules/scheduler"
_ "github.com/redelay/go-modules/scheduler/flowdsl" // 4 nodes
_ "github.com/redelay/go-module-email"
_ "github.com/redelay/go-module-email/flowdsl" // 4 nodes
)
These nodes appear automatically in the module browser (/modules), the JSON spec
(/modules.json), and FlowDSL Studio when connected to your service's MCP endpoint.
For the full node catalog, see the FlowDSL node subpackage reference.
Ingesting external events
There are no per-event source nodes — every event on the bus is consumed via
the single configurable redelay/event-source node (from go-flowdsl/nodes).
Pick the topic from the eventName dropdown; the enum is populated at runtime
from the live module registry.
For external JSON streams (webhooks, NDJSON, raw Kafka/NATS/Redis), pair
redelay/json-stream-source with redelay/json-to-event to decode, map
fields to one of your declared events, and optionally publish to the bus.
See the go-events reference
for settings and mapping syntax.
7. Visualise in Studio
Open studio.flowdsl.com, paste your .flowdsl.yaml, and see the visual diagram. Share the URL with your team.
8. Environment variables
| Variable | Purpose |
|---|---|
ASYNCAPI_URL | URL where Go services fetch the AsyncAPI schema |
SCHEMA_VALIDATION_ENABLED | Validate payloads against schema on consume |