Behaviour for workflow serialization to various graph formats.
Implements serializers for:
- Mermaid (flowcharts and sequence diagrams)
- DOT (Graphviz)
- Cytoscape.js (JSON elements)
- Edgelist (simple edge pairs)
Usage
# Serialize workflow structure (excludes memory/runtime state)
Runic.Workflow.Serializer.Mermaid.serialize(workflow)
# Serialize causal reactions (for sequence diagrams)
Runic.Workflow.Serializer.Mermaid.serialize_causal(workflow)Edge Labels
The workflow graph uses a multigraph with labeled edges:
:flow- Static dataflow connections between steps:component_of- Component hierarchy (with :kind in properties):produced/:state_produced/:reduced- Causal memory edges:matchable/:runnable/:ran/:satisfied- Runtime state edges
Summary
Functions
Returns causal memory edges for sequence diagram generation.
Escapes special characters for Mermaid labels.
Returns flow edges only (static dataflow, no memory).
Groups vertices by their parent component using :component_of edges. Returns a map of %{component => [child_vertices]}.
Returns all vertices that are invokable nodes (not facts or memory).
Returns Mermaid CSS class based on node type.
Returns a unique, Mermaid-safe node ID for a vertex.
Returns a display label for a vertex node.
Returns the node shape for Mermaid based on node type.
Types
Callbacks
@callback serialize(Runic.Workflow.t(), serialization_opts()) :: String.t() | map() | list()
Functions
Returns causal memory edges for sequence diagram generation.
Escapes special characters for Mermaid labels.
Returns flow edges only (static dataflow, no memory).
Groups vertices by their parent component using :component_of edges. Returns a map of %{component => [child_vertices]}.
Returns all vertices that are invokable nodes (not facts or memory).
Returns Mermaid CSS class based on node type.
Returns a unique, Mermaid-safe node ID for a vertex.
Returns a display label for a vertex node.
Returns the node shape for Mermaid based on node type.