Skip to content

Conversation

@khizer-flow
Copy link

@khizer-flow khizer-flow commented Jan 21, 2026

This PR adds the initial draft for the Business Documentation as discussed in issue #330.

Changes:

Drafted Sections 2 (Platform Capabilities) & 3 (Core Features): Conducted a deep-dive analysis of BBT.Workflow.Domain and BBT.Workflow.Execution to map business features to actual code implementations.

Technical Validation: Verified key architectural claims against the source code, including:

Multi-tenancy: Confirmed schema isolation via RuntimeOptions and SyncSchemaValidator.

Scripting: Confirmed Roslyn-based dynamic execution via IScriptEngine.

Reliability: Documented the Aether Inbox/Outbox pattern implementation in Infrastructure.

Auto-transitions: Clarified the RequiresNew transaction scope logic for chained transitions.

Executive Summary: Included a placeholder draft for Section 1, ready for collaboration to align with specific business value propositions.

Next Steps:

Review of the technical accuracy in Sections 2-5.

Collaborative refinement of the Executive Summary (Section 1) to finalize the business messaging.

Summary by Sourcery

Add a business-focused overview document for the vNext Workflow Engine describing its architecture, capabilities, and core features.

Documentation:

  • Introduce an initial business overview for the vNext Workflow Engine covering value propositions, platform capabilities, and core features.
  • Document multi-tenant architecture, hierarchical workflows, scripting, auto-transitions, and integration/operational capabilities for technical and product stakeholders.

Summary by CodeRabbit

  • Documentation
    • Added comprehensive business overview documentation for the Workflow Engine platform, detailing capabilities including workflow definitions, execution patterns, multi-tenant architecture with SubFlows support, core features like dynamic scripting and auto transitions, REST and Dapr integrations, plus operational considerations for observability and health monitoring.

✏️ Tip: You can customize this high-level summary in your review settings.

@khizer-flow khizer-flow requested review from a team as code owners January 21, 2026 16:56
@khizer-flow khizer-flow requested a review from mokoker January 21, 2026 16:56
@sourcery-ai
Copy link

sourcery-ai bot commented Jan 21, 2026

Reviewer's Guide

Adds a new business-facing overview document for the vNext Workflow Engine that explains platform capabilities, core features, integration, and operational aspects, all tied explicitly to underlying .NET implementation details and architectural components.

Sequence diagram for auto transition chaining with RequiresNew unit of work

sequenceDiagram
  participant API as OrchestrationAPI
  participant Engine as ExecutionHost
  participant Ctx as WorkflowExecutionContext
  participant Runner as ITransitionRunner
  participant Script as IScriptEngine
  participant AutoEval as IAutoConditionEvaluator
  participant Pipe as PipelineDirectives
  participant UoW as UnitOfWorkRequiresNew

  API->>Engine: TriggerTransition(instanceId, transitionId)
  Engine->>Ctx: CreateExecutionContext(domain, instanceId, workflowId)
  Engine->>Runner: Run(Ctx, initialTransition)

  loop EvaluateAutoTransition
    Runner->>Script: CreateScriptContext(instance, workflow, headers, taskResponse)
    Script-->>Runner: ScriptContext
    Runner->>AutoEval: Evaluate(Transition.Rule, ScriptContext)
    AutoEval-->>Runner: ConditionResult
    alt ConditionResult is Satisfied
      Runner->>Pipe: Set NextTransition
      Runner-->>Engine: Completed with NextTransition
      Engine->>UoW: BeginScopeRequiresNew(domain, instanceId)
      UoW->>Runner: Run(Ctx, Pipe.NextTransition)
      UoW-->>Engine: Commit
    else No further auto transition
      Runner-->>Engine: Completed without NextTransition
    end
  end

  Engine-->>API: TransitionPipelineResult
Loading

Class diagram for core workflow definition and execution types

classDiagram
  class Workflow {
    +Guid Id
    +string Name
    +List~State~ States
    +List~Transition~ SharedTransitions
    +Transition FindTransitionInContext(Guid stateId, Guid transitionId)
  }

  class State {
    +Guid Id
    +string Name
    +List~Transition~ Transitions
    +SubFlow SubFlow
    +Transition DefaultAutoTransition
  }

  class Transition {
    +Guid Id
    +string Name
    +TriggerType TriggerType
    +string Rule
    +List~string~ AvailableIn
  }

  class SubFlow {
    +Guid WorkflowId
    +bool IsBlocking
    +string ScriptCodeInput
    +string ScriptCodeOutput
  }

  class WorkflowExecutionContext {
    +string Domain
    +Guid InstanceId
    +Guid WorkflowId
  }

  class RuntimeOptions {
    +List~RuntimeSysSchemaInfo~ SystemSchemas
  }

  class RuntimeSysSchemaInfo {
    +string SchemaName
    +string DbContextType
  }

  class SyncSchemaValidator {
    +Validate(RuntimeOptions options)
  }

  class IScriptEngine {
    +Compile(string code)
    +Execute(ScriptContext context)
  }

  class ScriptContext {
    +object Instance
    +Workflow Workflow
    +Dictionary~string,string~ Headers
    +object TaskResponse
  }

  class ScriptContextFactory {
    +Create(object instance, Workflow workflow, Dictionary~string,string~ headers, object taskResponse)
  }

  class IAutoConditionEvaluator {
    +ConditionResult Evaluate(string rule, ScriptContext context)
  }

  class ITransitionRunner {
    +Run(WorkflowExecutionContext context, Transition transition)
  }

  class PipelineDirectives {
    +Transition NextTransition
    +bool HasNext
  }

  class IDomainDiscoveryResolver {
    +ServiceEndpoint Resolve(string domain)
  }

  class DomainRegistrationService {
    +Register(string domain, ServiceEndpoint endpoint)
  }

  class DaprServiceTaskInvoker {
    +Invoke(ServiceEndpoint endpoint, object payload)
  }

  class DaprBindingTaskInvoker {
    +InvokeBinding(string bindingName, object payload)
  }

  Workflow "1" --> "*" State
  Workflow "1" --> "*" Transition : SharedTransitions
  State "1" --> "*" Transition
  State "0..1" --> "1" SubFlow
  SubFlow "1" --> "1" Workflow : ChildWorkflow

  WorkflowExecutionContext "1" --> "1" Workflow

  RuntimeOptions "1" --> "*" RuntimeSysSchemaInfo
  SyncSchemaValidator --> RuntimeOptions

  ScriptContextFactory --> ScriptContext
  ScriptContext "1" --> "1" Workflow
  IScriptEngine --> ScriptContext

  IAutoConditionEvaluator --> ScriptContext
  ITransitionRunner --> WorkflowExecutionContext
  ITransitionRunner --> Transition
  ITransitionRunner --> PipelineDirectives

  IDomainDiscoveryResolver --> DomainRegistrationService
  DaprServiceTaskInvoker --> IDomainDiscoveryResolver
  DaprBindingTaskInvoker --> IDomainDiscoveryResolver
Loading

Flow diagram for hierarchical SubFlow execution

flowchart LR
  Start([Parent workflow state enters])
  CheckSubFlow{State has SubFlow?}
  NoSubFlow[Execute state tasks and wait for trigger]
  Configure[Configure SubFlow execution type]
  Blocking{IsBlocking SubFlow?}
  StartChild[Start child workflow instance]
  ParentWait[Parent waits for child completion]
  ParentContinue[Parent continues without waiting]
  ChildRunning[[Child workflow executes]]
  ChildComplete{Child completes or fails}
  MapOutput[Map child output via ScriptCodeOutput]
  UpdateParent[Update parent instance data]
  ResumeParent[Resume parent workflow and evaluate next transitions]

  Start --> CheckSubFlow
  CheckSubFlow -- No --> NoSubFlow
  CheckSubFlow -- Yes --> Configure
  Configure --> Blocking

  Blocking -- Yes --> StartChild
  StartChild --> ParentWait
  ParentWait --> ChildRunning
  ChildRunning --> ChildComplete
  ChildComplete --> MapOutput
  MapOutput --> UpdateParent
  UpdateParent --> ResumeParent

  Blocking -- No --> StartChild
  StartChild --> ParentContinue
  ParentContinue --> ResumeParent

  NoSubFlow --> ResumeParent
  ResumeParent --> End([State finished])
Loading

File-Level Changes

Change Details Files
Introduce a business/technical overview document for the vNext Workflow Engine.
  • Create a new Markdown document describing the vNext Workflow Engine’s purpose, target audience, and key value propositions
  • Document platform capabilities including workflow definition model, state machine behavior, multi-tenant architecture, hierarchical workflows, and async execution pipeline
  • Describe core features such as the Roslyn-based scripting engine, auto-transitions behavior, and service discovery integration
  • Summarize integration capabilities via REST, Dapr, and event-driven messaging
  • Outline operational features like OpenTelemetry-based observability and health monitoring endpoints
docs/business/overview.md

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@gemini-code-assist
Copy link

Summary of Changes

Hello @khizer-flow, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces the foundational business overview documentation for the vNext Workflow Engine. It provides a comprehensive, technically validated description of the engine's platform capabilities, core features, integration points, and operational aspects, aiming to bridge the gap between business requirements and technical implementation. The document serves as an initial draft, with specific sections marked for future collaborative refinement.

Highlights

  • Business Documentation Draft: Initial draft of the vNext Workflow Engine Business Overview document has been added, detailing Platform Capabilities and Core Features.
  • Technical Validation: Key architectural claims, including multi-tenancy, dynamic scripting, reliability patterns, and auto-transitions, have been thoroughly validated against the actual code implementation.
  • Multi-tenancy Architecture: The document confirms schema isolation via RuntimeOptions and SyncSchemaValidator, and describes distributed locking mechanisms using domain-aware keys.
  • Dynamic C# Scripting Engine: Details the Roslyn-based dynamic C# scripting engine, emphasizing its context-awareness, dependency injection support, and on-the-fly execution capabilities.
  • Reliability with Inbox/Outbox: The implementation of the Aether Inbox/Outbox pattern for reliable asynchronous execution, backed by MessagingDbContext, is documented.
  • Auto-Transitions Logic: Clarifies the RequiresNew transaction scope logic for chained auto-transitions, ensuring proper isolation during workflow progression.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'review'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

A new business overview documentation file was added to describe the vNext Workflow Engine architecture, capabilities, and operational patterns. The document covers platform features, state machine policies, execution models, integration points, and multi-tenant design without introducing code changes.

Changes

Cohort / File(s) Summary
Business Documentation
docs/business/overview.md
New file documenting vNext Workflow Engine business context, architecture patterns, platform capabilities (JSON-first definitions, Builder API, graph resolution), features (dynamic C# scripting, auto transitions, service discovery), integration points (REST, Dapr), and operational concerns (OpenTelemetry, health endpoints)

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related issues

  • Issue #330: Directly addresses the addition of business-focused vNext Workflow Engine documentation covering architecture and platform capabilities as requested.

Suggested reviewers

  • tsimsekburgan

Poem

🐰 A business tale, so crisp and bright,
Of workflows dancing day and night,
With Roslyn's spark and Dapr's grace,
We've mapped this grand engine's place!
Documentation hops along with glee,
The vNext vision, for all to see ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a new business overview documentation file with validated technical details, which matches the PR objective of introducing initial business documentation with technical validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@deepsource-io
Copy link

deepsource-io bot commented Jan 21, 2026

Here's the code health analysis summary for commits 0b293ea..00b9378. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource C# LogoC#✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Some of the stronger guarantees (“guarantee data integrity and isolation”, “preventing cross-tenant data leakage at the API boundary”) might be better framed more precisely (e.g., describing the mechanisms and typical failure modes) to avoid over-promising behavior that still depends on correct usage and deployment.
  • Where you reference specific types/members (e.g., Workflow.Create(), FindTransitionInContext, IAutoConditionEvaluator, DomainRegistrationService), consider aligning the terminology with actual current signatures and namespaces or qualifying when names are illustrative, so the doc doesn’t become misleading if the code evolves.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Some of the stronger guarantees (“guarantee data integrity and isolation”, “preventing cross-tenant data leakage at the API boundary”) might be better framed more precisely (e.g., describing the mechanisms and typical failure modes) to avoid over-promising behavior that still depends on correct usage and deployment.
- Where you reference specific types/members (e.g., `Workflow.Create()`, `FindTransitionInContext`, `IAutoConditionEvaluator`, `DomainRegistrationService`), consider aligning the terminology with actual current signatures and namespaces or qualifying when names are illustrative, so the doc doesn’t become misleading if the code evolves.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive business overview document for the vNext Workflow Engine, effectively detailing its architecture, capabilities, and core features. The document successfully integrates validated technical details, mapping business functionalities to their underlying code implementations, which aligns well with the stated objectives of the PR. The structure is clear, and the content is informative for the target audience. The document provides a good balance between high-level business value propositions and specific technical insights, such as multi-tenancy, scripting, and auto-transitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant