Annotation Interface WorkflowScoped


@Target({TYPE,METHOD,FIELD}) @Retention(RUNTIME) @Documented @NormalScope @Inherited public @interface WorkflowScoped
Defines a workflow-scoped CDI context.

A workflow scope is active during the execution of an agent's workflow, spanning trigger, decision, action, and outcome phases. Beans in this scope are created when the workflow starts and destroyed when it completes.

This scope is particularly useful for sharing state across different phases of a workflow execution without requiring explicit parameter passing.

Example Usage


 @Agent
 @WorkflowScoped
 public class DocumentationAgent {
     // Agent is workflow-scoped
 }

 @Agent
 @WorkflowScoped
 public class AnalysisCache {
     // Cache exists for the duration of the workflow
     private Map<String, Object> cache = new HashMap<>();
 }
 
Since:
1.0
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Supports inline instantiation of the WorkflowScoped annotation.