java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.Mixin
software.amazon.awscdk.cfnpropertymixins.services.bedrock.CfnFlowPropsMixin
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable, software.constructs.IMixin

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-03-11T13:19:56.512Z") @Stability(Stable) public class CfnFlowPropsMixin extends Mixin implements software.constructs.IMixin
Creates a prompt flow that you can use to send an input through various steps to yield an output.

You define a flow by configuring nodes, each of which corresponds to a step of the flow, and creating connections between the nodes to create paths to different outputs. You can define the flow in one of the following ways:

  • Define a FlowDefinition in the Definition property.
  • Provide the definition in the DefinitionString property as a JSON-formatted string matching the FlowDefinition property.
  • Provide an Amazon S3 location in the DefinitionS3Location property that matches the FlowDefinition .

If you use the DefinitionString or DefinitionS3Location property, you can use the DefinitionSubstitutions property to define key-value pairs to replace at runtime.

For more information, see How it works and Create a prompt flow in Amazon Bedrock in the Amazon Bedrock User Guide.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.cfnpropertymixins.services.bedrock.*;
 import software.amazon.awscdk.*;
 Object additionalModelRequestFields;
 Object collector;
 FlowDefinitionProperty flowDefinitionProperty_;
 Object input;
 Object iterator;
 Object loopInput;
 IMergeStrategy mergeStrategy;
 Object output;
 CfnFlowPropsMixin cfnFlowPropsMixin = CfnFlowPropsMixin.Builder.create(CfnFlowMixinProps.builder()
         .customerEncryptionKeyArn("customerEncryptionKeyArn")
         .definition(FlowDefinitionProperty.builder()
                 .connections(List.of(FlowConnectionProperty.builder()
                         .configuration(FlowConnectionConfigurationProperty.builder()
                                 .conditional(FlowConditionalConnectionConfigurationProperty.builder()
                                         .condition("condition")
                                         .build())
                                 .data(FlowDataConnectionConfigurationProperty.builder()
                                         .sourceOutput("sourceOutput")
                                         .targetInput("targetInput")
                                         .build())
                                 .build())
                         .name("name")
                         .source("source")
                         .target("target")
                         .type("type")
                         .build()))
                 .nodes(List.of(FlowNodeProperty.builder()
                         .configuration(FlowNodeConfigurationProperty.builder()
                                 .agent(AgentFlowNodeConfigurationProperty.builder()
                                         .agentAliasArn("agentAliasArn")
                                         .build())
                                 .collector(collector)
                                 .condition(ConditionFlowNodeConfigurationProperty.builder()
                                         .conditions(List.of(FlowConditionProperty.builder()
                                                 .expression("expression")
                                                 .name("name")
                                                 .build()))
                                         .build())
                                 .inlineCode(InlineCodeFlowNodeConfigurationProperty.builder()
                                         .code("code")
                                         .language("language")
                                         .build())
                                 .input(input)
                                 .iterator(iterator)
                                 .knowledgeBase(KnowledgeBaseFlowNodeConfigurationProperty.builder()
                                         .guardrailConfiguration(GuardrailConfigurationProperty.builder()
                                                 .guardrailIdentifier("guardrailIdentifier")
                                                 .guardrailVersion("guardrailVersion")
                                                 .build())
                                         .inferenceConfiguration(PromptInferenceConfigurationProperty.builder()
                                                 .text(PromptModelInferenceConfigurationProperty.builder()
                                                         .maxTokens(123)
                                                         .stopSequences(List.of("stopSequences"))
                                                         .temperature(123)
                                                         .topP(123)
                                                         .build())
                                                 .build())
                                         .knowledgeBaseId("knowledgeBaseId")
                                         .modelId("modelId")
                                         .numberOfResults(123)
                                         .orchestrationConfiguration(KnowledgeBaseOrchestrationConfigurationProperty.builder()
                                                 .additionalModelRequestFields(additionalModelRequestFields)
                                                 .inferenceConfig(PromptInferenceConfigurationProperty.builder()
                                                         .text(PromptModelInferenceConfigurationProperty.builder()
                                                                 .maxTokens(123)
                                                                 .stopSequences(List.of("stopSequences"))
                                                                 .temperature(123)
                                                                 .topP(123)
                                                                 .build())
                                                         .build())
                                                 .performanceConfig(PerformanceConfigurationProperty.builder()
                                                         .latency("latency")
                                                         .build())
                                                 .promptTemplate(KnowledgeBasePromptTemplateProperty.builder()
                                                         .textPromptTemplate("textPromptTemplate")
                                                         .build())
                                                 .build())
                                         .promptTemplate(KnowledgeBasePromptTemplateProperty.builder()
                                                 .textPromptTemplate("textPromptTemplate")
                                                 .build())
                                         .rerankingConfiguration(VectorSearchRerankingConfigurationProperty.builder()
                                                 .bedrockRerankingConfiguration(VectorSearchBedrockRerankingConfigurationProperty.builder()
                                                         .metadataConfiguration(MetadataConfigurationForRerankingProperty.builder()
                                                                 .selectionMode("selectionMode")
                                                                 .selectiveModeConfiguration(RerankingMetadataSelectiveModeConfigurationProperty.builder()
                                                                         .fieldsToExclude(List.of(FieldForRerankingProperty.builder()
                                                                                 .fieldName("fieldName")
                                                                                 .build()))
                                                                         .fieldsToInclude(List.of(FieldForRerankingProperty.builder()
                                                                                 .fieldName("fieldName")
                                                                                 .build()))
                                                                         .build())
                                                                 .build())
                                                         .modelConfiguration(VectorSearchBedrockRerankingModelConfigurationProperty.builder()
                                                                 .additionalModelRequestFields(additionalModelRequestFields)
                                                                 .modelArn("modelArn")
                                                                 .build())
                                                         .numberOfRerankedResults(123)
                                                         .build())
                                                 .type("type")
                                                 .build())
                                         .build())
                                 .lambdaFunction(LambdaFunctionFlowNodeConfigurationProperty.builder()
                                         .lambdaArn("lambdaArn")
                                         .build())
                                 .lex(LexFlowNodeConfigurationProperty.builder()
                                         .botAliasArn("botAliasArn")
                                         .localeId("localeId")
                                         .build())
                                 .loop(LoopFlowNodeConfigurationProperty.builder()
                                         .definition(flowDefinitionProperty_)
                                         .build())
                                 .loopController(LoopControllerFlowNodeConfigurationProperty.builder()
                                         .continueCondition(FlowConditionProperty.builder()
                                                 .expression("expression")
                                                 .name("name")
                                                 .build())
                                         .maxIterations(123)
                                         .build())
                                 .loopInput(loopInput)
                                 .output(output)
                                 .prompt(PromptFlowNodeConfigurationProperty.builder()
                                         .guardrailConfiguration(GuardrailConfigurationProperty.builder()
                                                 .guardrailIdentifier("guardrailIdentifier")
                                                 .guardrailVersion("guardrailVersion")
                                                 .build())
                                         .sourceConfiguration(PromptFlowNodeSourceConfigurationProperty.builder()
                                                 .inline(PromptFlowNodeInlineConfigurationProperty.builder()
                                                         .inferenceConfiguration(PromptInferenceConfigurationProperty.builder()
                                                                 .text(PromptModelInferenceConfigurationProperty.builder()
                                                                         .maxTokens(123)
                                                                         .stopSequences(List.of("stopSequences"))
                                                                         .temperature(123)
                                                                         .topP(123)
                                                                         .build())
                                                                 .build())
                                                         .modelId("modelId")
                                                         .templateConfiguration(PromptTemplateConfigurationProperty.builder()
                                                                 .text(TextPromptTemplateConfigurationProperty.builder()
                                                                         .inputVariables(List.of(PromptInputVariableProperty.builder()
                                                                                 .name("name")
                                                                                 .build()))
                                                                         .text("text")
                                                                         .build())
                                                                 .build())
                                                         .templateType("templateType")
                                                         .build())
                                                 .resource(PromptFlowNodeResourceConfigurationProperty.builder()
                                                         .promptArn("promptArn")
                                                         .build())
                                                 .build())
                                         .build())
                                 .retrieval(RetrievalFlowNodeConfigurationProperty.builder()
                                         .serviceConfiguration(RetrievalFlowNodeServiceConfigurationProperty.builder()
                                                 .s3(RetrievalFlowNodeS3ConfigurationProperty.builder()
                                                         .bucketName("bucketName")
                                                         .build())
                                                 .build())
                                         .build())
                                 .storage(StorageFlowNodeConfigurationProperty.builder()
                                         .serviceConfiguration(StorageFlowNodeServiceConfigurationProperty.builder()
                                                 .s3(StorageFlowNodeS3ConfigurationProperty.builder()
                                                         .bucketName("bucketName")
                                                         .build())
                                                 .build())
                                         .build())
                                 .build())
                         .inputs(List.of(FlowNodeInputProperty.builder()
                                 .category("category")
                                 .expression("expression")
                                 .name("name")
                                 .type("type")
                                 .build()))
                         .name("name")
                         .outputs(List.of(FlowNodeOutputProperty.builder()
                                 .name("name")
                                 .type("type")
                                 .build()))
                         .type("type")
                         .build()))
                 .build())
         .definitionS3Location(S3LocationProperty.builder()
                 .bucket("bucket")
                 .key("key")
                 .version("version")
                 .build())
         .definitionString("definitionString")
         .definitionSubstitutions(Map.of(
                 "definitionSubstitutionsKey", "definitionSubstitutions"))
         .description("description")
         .executionRoleArn("executionRoleArn")
         .name("name")
         .tags(Map.of(
                 "tagsKey", "tags"))
         .testAliasTags(Map.of(
                 "testAliasTagsKey", "testAliasTags"))
         .build())
 .strategy(mergeStrategy)
 .build();
 

See Also:
  • Field Details

    • CFN_PROPERTY_KEYS

      @Stability(Stable) protected static final List<String> CFN_PROPERTY_KEYS
  • Constructor Details

    • CfnFlowPropsMixin

      protected CfnFlowPropsMixin(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnFlowPropsMixin

      protected CfnFlowPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnFlowPropsMixin

      @Stability(Stable) public CfnFlowPropsMixin(@NotNull CfnFlowMixinProps props, @Nullable CfnPropertyMixinOptions options)
      Create a mixin to apply properties to AWS::Bedrock::Flow.

      Parameters:
      props - L1 properties to apply. This parameter is required.
      options - Mixin options.
    • CfnFlowPropsMixin

      @Stability(Stable) public CfnFlowPropsMixin(@NotNull CfnFlowMixinProps props)
      Create a mixin to apply properties to AWS::Bedrock::Flow.

      Parameters:
      props - L1 properties to apply. This parameter is required.
  • Method Details

    • applyTo

      @Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct)
      Apply the mixin properties to the construct.

      Specified by:
      applyTo in interface software.constructs.IMixin
      Specified by:
      applyTo in class Mixin
      Parameters:
      construct - This parameter is required.
    • supports

      @Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct)
      Check if this mixin supports the given construct.

      Specified by:
      supports in interface software.constructs.IMixin
      Overrides:
      supports in class Mixin
      Parameters:
      construct - This parameter is required.
    • getProps

      @Stability(Stable) @NotNull protected CfnFlowMixinProps getProps()
    • getStrategy

      @Stability(Stable) @NotNull protected IMergeStrategy getStrategy()