FlowNodeConfigurationProperty Struct
Contains configurations for a node in your flow.
For more information, see Node types in a flow 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 { aws_bedrock as bedrock } from 'aws-cdk-lib';
declare const additionalModelRequestFields: any;
declare const collector: any;
declare const flowNodeConfigurationProperty_: bedrock.CfnFlow.FlowNodeConfigurationProperty;
declare const input: any;
declare const iterator: any;
declare const loopInput: any;
declare const output: any;
const flowNodeConfigurationProperty: bedrock.CfnFlow.FlowNodeConfigurationProperty = {
agent: {
agentAliasArn: 'agentAliasArn',
},
collector: collector,
condition: {
conditions: [{
name: 'name',
// the properties below are optional
expression: 'expression',
}],
},
inlineCode: {
code: 'code',
language: 'language',
},
input: input,
iterator: iterator,
knowledgeBase: {
knowledgeBaseId: 'knowledgeBaseId',
// the properties below are optional
guardrailConfiguration: {
guardrailIdentifier: 'guardrailIdentifier',
guardrailVersion: 'guardrailVersion',
},
inferenceConfiguration: {
text: {
maxTokens: 123,
stopSequences: ['stopSequences'],
temperature: 123,
topP: 123,
},
},
modelId: 'modelId',
numberOfResults: 123,
orchestrationConfiguration: {
additionalModelRequestFields: additionalModelRequestFields,
inferenceConfig: {
text: {
maxTokens: 123,
stopSequences: ['stopSequences'],
temperature: 123,
topP: 123,
},
},
performanceConfig: {
latency: 'latency',
},
promptTemplate: {
textPromptTemplate: 'textPromptTemplate',
},
},
promptTemplate: {
textPromptTemplate: 'textPromptTemplate',
},
rerankingConfiguration: {
type: 'type',
// the properties below are optional
bedrockRerankingConfiguration: {
modelConfiguration: {
modelArn: 'modelArn',
// the properties below are optional
additionalModelRequestFields: additionalModelRequestFields,
},
// the properties below are optional
metadataConfiguration: {
selectionMode: 'selectionMode',
// the properties below are optional
selectiveModeConfiguration: {
fieldsToExclude: [{
fieldName: 'fieldName',
}],
fieldsToInclude: [{
fieldName: 'fieldName',
}],
},
},
numberOfRerankedResults: 123,
},
},
},
lambdaFunction: {
lambdaArn: 'lambdaArn',
},
lex: {
botAliasArn: 'botAliasArn',
localeId: 'localeId',
},
loop: {
definition: {
connections: [{
name: 'name',
source: 'source',
target: 'target',
type: 'type',
// the properties below are optional
configuration: {
conditional: {
condition: 'condition',
},
data: {
sourceOutput: 'sourceOutput',
targetInput: 'targetInput',
},
},
}],
nodes: [{
name: 'name',
type: 'type',
// the properties below are optional
configuration: flowNodeConfigurationProperty_,
inputs: [{
expression: 'expression',
name: 'name',
type: 'type',
// the properties below are optional
category: 'category',
}],
outputs: [{
name: 'name',
type: 'type',
}],
}],
},
},
loopController: {
continueCondition: {
name: 'name',
// the properties below are optional
expression: 'expression',
},
// the properties below are optional
maxIterations: 123,
},
loopInput: loopInput,
output: output,
prompt: {
sourceConfiguration: {
inline: {
modelId: 'modelId',
templateConfiguration: {
text: {
text: 'text',
// the properties below are optional
inputVariables: [{
name: 'name',
}],
},
},
templateType: 'templateType',
// the properties below are optional
inferenceConfiguration: {
text: {
maxTokens: 123,
stopSequences: ['stopSequences'],
temperature: 123,
topP: 123,
},
},
},
resource: {
promptArn: 'promptArn',
},
},
// the properties below are optional
guardrailConfiguration: {
guardrailIdentifier: 'guardrailIdentifier',
guardrailVersion: 'guardrailVersion',
},
},
retrieval: {
serviceConfiguration: {
s3: {
bucketName: 'bucketName',
},
},
},
storage: {
serviceConfiguration: {
s3: {
bucketName: 'bucketName',
},
},
},
};
Properties
agentoptionalIResolvable | CfnFlow.AgentFlowNodeConfigurationPropertyagentoptionaltyping.Union[IResolvable, AgentFlowNodeConfigurationProperty]agentoptionalIResolvableAgentoptionalIResolvableAgentoptionalinterface{}#Invokes an alias of an agent and returns the response.
collectoroptionalanycollectoroptionalAnycollectoroptionalObjectCollectoroptionalobjectCollectoroptionalinterface{}#Collects an iteration of inputs and consolidates them into an array of outputs.
conditionoptionalIResolvable | CfnFlow.ConditionFlowNodeConfigurationPropertyconditionoptionaltyping.Union[IResolvable, ConditionFlowNodeConfigurationProperty]conditionoptionalIResolvableConditionoptionalIResolvableConditionoptionalinterface{}#Defines conditions that lead to different branches of the flow.
inlineCodeoptionalIResolvable | CfnFlow.InlineCodeFlowNodeConfigurationPropertyinline_codeoptionaltyping.Union[IResolvable, InlineCodeFlowNodeConfigurationProperty]inlineCodeoptionalIResolvableInlineCodeoptionalIResolvableInlineCodeoptionalinterface{}#Inline code nodes let you write and execute code directly within your flow, enabling data transformations, custom logic, and integrations without needing an external Lambda function.
The first node in the flow. inputs can't be specified for this node.
iteratoroptionalanyiteratoroptionalAnyiteratoroptionalObjectIteratoroptionalobjectIteratoroptionalinterface{}#notes
Takes an input that is an array and iteratively sends each item of the array as an output to the following node. The size of the array is also returned in the output.
The output flow node at the end of the flow iteration will return a response for each member of the array. To return only one response, you can include a collector node downstream from the iterator node.
knowledgeBaseoptionalIResolvable | CfnFlow.KnowledgeBaseFlowNodeConfigurationPropertyknowledge_baseoptionaltyping.Union[IResolvable, KnowledgeBaseFlowNodeConfigurationProperty]knowledgeBaseoptionalIResolvableKnowledgeBaseoptionalIResolvableKnowledgeBaseoptionalinterface{}#Queries a knowledge base and returns the retrieved results or generated response.
lambdaFunctionoptionalIResolvable | CfnFlow.LambdaFunctionFlowNodeConfigurationPropertylambda_functionoptionaltyping.Union[IResolvable, LambdaFunctionFlowNodeConfigurationProperty]lambdaFunctionoptionalIResolvableLambdaFunctionoptionalIResolvableLambdaFunctionoptionalinterface{}#Invokes an AWS Lambda function.
lexoptionalIResolvable | CfnFlow.LexFlowNodeConfigurationPropertylexoptionaltyping.Union[IResolvable, LexFlowNodeConfigurationProperty]lexoptionalIResolvableLexoptionalIResolvableLexoptionalinterface{}#Invokes an Amazon Lex bot to identify the intent of the input and return the intent as the output.
loopoptionalIResolvable | CfnFlow.LoopFlowNodeConfigurationPropertyloopoptionaltyping.Union[IResolvable, LoopFlowNodeConfigurationProperty]loopoptionalIResolvableLoopoptionalIResolvableLoopoptionalinterface{}#loopControlleroptionalIResolvable | CfnFlow.LoopControllerFlowNodeConfigurationPropertyloop_controlleroptionaltyping.Union[IResolvable, LoopControllerFlowNodeConfigurationProperty]loopControlleroptionalIResolvableLoopControlleroptionalIResolvableLoopControlleroptionalinterface{}#loopInputoptionalanyloop_inputoptionalAnyloopInputoptionalObjectLoopInputoptionalobjectLoopInputoptionalinterface{}#outputoptionalanyoutputoptionalAnyoutputoptionalObjectOutputoptionalobjectOutputoptionalinterface{}#The last node in the flow. outputs can't be specified for this node.
promptoptionalIResolvable | CfnFlow.PromptFlowNodeConfigurationPropertypromptoptionaltyping.Union[IResolvable, PromptFlowNodeConfigurationProperty]promptoptionalIResolvablePromptoptionalIResolvablePromptoptionalinterface{}#Runs a prompt and generates the model response as the output. You can use a prompt from Prompt management or you can configure one in this node.
retrievaloptionalIResolvable | CfnFlow.RetrievalFlowNodeConfigurationPropertyretrievaloptionaltyping.Union[IResolvable, RetrievalFlowNodeConfigurationProperty]retrievaloptionalIResolvableRetrievaloptionalIResolvableRetrievaloptionalinterface{}#Retrieves data from an Amazon S3 location and returns it as the output.
storageoptionalIResolvable | CfnFlow.StorageFlowNodeConfigurationPropertystorageoptionaltyping.Union[IResolvable, StorageFlowNodeConfigurationProperty]storageoptionalIResolvableStorageoptionalIResolvableStorageoptionalinterface{}#Stores an input in an Amazon S3 location.