Reusability

Reusability means designing flows, Say nodes, and routing logic once and using them across multiple journeys—instead of copying and pasting.

Build once → reuse everywhere

YAML Anchors & Aliases

YAML anchors (&) let you define a block once. YAML aliases (*) let you reuse that block elsewhere.

Think of them as copy‑by‑reference for YAML blocks.

Use YAML's native reuse mechanism:

nodes:    
      - api_call_1:    
          type: api    
          integration: API1    
          method: method1    
          exits:    
            success:    
              next: next1    
            failure:    
              next: api_failure # Route to shared error node    
         
      - api_call_2:    
          type: api    
          integration: API2    
          method: method2    
          exits:    
            success:    
              next: next2    
            failure:    
              next: api_failure # Same error node    
         
      # Shared error handling node    
      - api_failure:    
          type: say    
          message: I couldn't reach our systems. Let me connect you with someone.    
          next: transfer_agent   

Node Inheritance (Standard YAML Feature)

YAML does not have true object‑oriented inheritance, this uses native YAML anchors (&name) and merge keys (<<: *name) - not YFlow-specific syntax.

  • Anchors (&)

  • Aliases (*)

  • Merge key (<)

Together, these allow one node to inherit properties from another node and override only what’s different.

Optional, but useful for reducing repetition:

Components

Components are fully specified but deferred to a future implementation spike. See YFLOW_SPEC_COMPONENTS.md for the complete component design including:

  • Component definition (entries/exits with typed variables)

  • Component node (type: component) with variable mapping

  • Execution isolation (own variable space and LLM memory)

  • Routing syntax (next: node:entry, exit:name)

  • Customer v2 data structure mapping

  • Say Node future enhancements (voice override, speed, i18n)

Last updated

Was this helpful?