Skip to content

Example Catalog

The bloge-examples module is the fastest way to understand how BLOGE behaves in real orchestration scenarios. The examples cover beginner quickstarts, production-style DAGs, long-running patterns, editor and observability integrations, streaming pipelines, and anti-pattern references.

Category overview

CategoryWhat it demonstrates
Beginner quickstartsSmallest useful graphs and DSL parity
Integration recipesSpring Boot, observability wiring, and Maven plugin flows
Basic DAG patternsParallel fan-out, branching, retries, timeouts, and fallbacks
Sub-graph examplesNested orchestration and reusable graph segments
Iteration examplesforeach and loop constructs
Streaming examplesStream nodes, buffered edges, and real-time forwarding
Voice / conversational examplesStreaming + branching + session-oriented orchestration
Anti-pattern referencesWhat to avoid and how to fix it

1. Beginner quickstarts

Good starting points when you want to learn the runtime shape quickly:

  • Hello World — one node, minimal Java and DSL flow
  • Two Node Chain — basic dependency edge
  • Error Handling Showcase — explicit failure inspection and fallback behavior

These examples are ideal companions to Getting Started.

Representative snippet from hello-world.bloge:

bloge
graph helloWorld {
  node echo : EchoOperator {
    input {
      message = ctx.message
    }
    timeout = 1s
  }
}

2. Integration recipes

BLOGE also ships examples for framework and tooling integration:

  • Spring Boot starter@BlogeOperator discovery, DSL loading, REST endpoint, and actuator diagnostics
  • Observability wiringMetricsExecutionListener, sample telemetry config, and Grafana assets
  • Maven plugin profile — metadata export and lint execution in a build-oriented setup

Representative snippet from integration/spring/spring-ticket-triage.bloge:

bloge
graph springTicketTriage {
  node classifyTicket : SpringTicketClassifierOperator {
    input {
      ticketId = ctx.ticketId
      message = ctx.message
      customerTier = ctx.customerTier
    }
    timeout = 2s
  }

  node draftReply : SpringReplyDraftOperator {
    depends_on = [classifyTicket]
    input {
      queue = classifyTicket.output.queue
      priorityScore = classifyTicket.output.priorityScore
    }
  }
}

3. Basic DAG patterns

Representative business-oriented DAG examples include:

  • Order Processing — parallel fetch, aggregation, credit check, create-or-reject branch
  • BFF Aggregation — five-way fan-out with differentiated fallback policies
  • Loan Approval — four-way risk checks, transform summary, and three-way decision branch
  • Ticket Routing — customer service flow with sentiment-based routing
  • Online Triage — healthcare-oriented branching after AI pre-diagnosis
  • Shipment Planning — logistics branching after route and carrier evaluation

These examples show how BLOGE keeps service composition, resilience, and branching explicit.

Representative snippet from order-process.bloge:

bloge
graph orderProcess {
  node fetchUser : FetchUserOperator {
    input { userId = ctx.userId }
    timeout = 3s
    retry = { attempts: 2, backoff: 200ms, strategy: exponential }
  }

  node calcPrice : CalcPriceOperator {
    depends_on = [fetchUser, fetchProducts]
  }

  branch on checkCredit.output.approved {
    true -> createOrder
    false -> rejectOrder
  }
}

4. Sub-graph examples

Sub-graphs help keep larger flows decomposed.

Representative examples include:

  • e-commerce order pipeline
  • finance end-to-end loan approval
  • customer service smart ticket handling
  • logistics international shipment flow
  • catering restaurant order pipeline

Use these when a single graph would otherwise turn into a “god graph.”

Representative snippet from order-full-pipeline.bloge:

bloge
graph orderFullPipeline {
  node paymentProcessing : subgraph("payment-processing") {
    depends_on = [validateOrder]
    input {
      orderId = validateOrder.output.orderId
      amount = validateOrder.output.amount
    }
    timeout = 30s
  }

  node inventoryFulfillment : subgraph("inventory-fulfillment") {
    depends_on = [validateOrder]
  }
}

5. Iteration examples

BLOGE also models repeated work through declarative iteration constructs:

  • Parallel batch order processingforeach in parallel
  • Sequential transfer processingforeach ... sequential
  • Status polling — loop with until
  • Cursor pagination — loop with carry
  • Retry with backoff — loop-driven retry control
  • Logistics batch dispatch — foreach plus loop in one graph

Representative snippet from logistics-batch-dispatch.bloge:

bloge
graph logisticsBatchDispatch {
  foreach assignRoutes : (parcel, idx) in fetchParcels.output.parcels {
    node planRoute : RoutePlannerOperator {
      input { parcel = parcel, index = idx }
    }
  }

  loop pollAllDispatched {
    max_iterations = 30
    delay = 10s
    depends_on = [assignRoutes]
    until checkAllStatus.output.allDelivered == true
  }
}

6. Streaming examples

Streaming examples demonstrate stream node, stream foreach, and stream loop behavior:

  • LLM token streaming pipeline
  • streaming batch order processing
  • streaming status monitoring

These examples show how BLOGE can forward items before an entire batch completes.

Representative snippet from streaming-batch.bloge:

bloge
graph streamingBatch {
  node loadOrders : OrderLoader {
    input { customerId = ctx.customerId }
  }

  stream foreach processOrders : item in loadOrders.output.orders {
    buffer = 16
    node processItem : OrderProcessor {
      input { order = item }
    }
  }
}

7. Voice and conversational orchestration

The repository includes a rich set of conversational and voice-centric examples such as:

  • minimal voice pipeline
  • multimodal interaction recording
  • voice contact center
  • voice banking
  • voice telemedicine
  • voice logistics dispatch
  • voice tutoring with feedback loops
  • voice emergency dispatch
  • session / phase / round customer-service flows

These examples demonstrate how streaming, branching, session state, and long-running orchestration can combine.

Representative snippet from voice-pipeline.bloge:

bloge
graph voicePipeline {
  stream node audioCapture : AudioCapture {
    buffer = 64
  }

  stream node speechToText : SpeechToText {
    input { audio = audioCapture.stream }
    buffer = 32
  }

  node textAnalysis : TextAnalyzer {
    depends_on = [speechToText]
    input { transcript = speechToText.output }
  }
}

8. Anti-pattern references

The anti-pattern set is especially useful for review culture and onboarding:

  • excessive node splitting
  • god graph
  • over-broad fallback
  • missing timeout
  • circular dependency

Each example highlights what went wrong and what a more maintainable graph shape looks like.

Representative snippet from antipatterns/missing-timeout.bloge:

bloge
graph missingTimeout {
  node loadReport : LoadReportOperator {
    input {
      reportId = ctx.reportId
    }
  }

  node publishReport : PublishReportOperator {
    depends_on = [loadReport]
    timeout = 1s
  }
}

How to use the examples

A productive learning sequence is:

  1. start with one beginner graph
  2. compare the Java and DSL versions
  3. inspect a larger DAG example such as order processing or loan approval
  4. branch into iteration, streaming, or voice examples depending on your use case
  5. read the anti-patterns before scaling graph authoring across a team

Run examples from the repository

bash
mvn -pl bloge-examples exec:java       -Dexec.mainClass="com.leanowtech.bloge.examples.ecommerce.OrderProcessingExample"

mvn -pl bloge-examples exec:java       -Dexec.mainClass="com.leanowtech.bloge.examples.bff.BffAggregationExample"

Next steps