Skip to content

Invoke Flow

bedrockagentruntime_invoke_flow R Documentation

Invokes an alias of a flow to run the inputs that you specify and return the output of each node as a stream

Description

Invokes an alias of a flow to run the inputs that you specify and return the output of each node as a stream. If there's an error, the error is returned. For more information, see Test a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

The CLI doesn't support streaming operations in Amazon Bedrock, including invoke_flow.

Usage

bedrockagentruntime_invoke_flow(enableTrace, executionId,
  flowAliasIdentifier, flowIdentifier, inputs,
  modelPerformanceConfiguration)

Arguments

enableTrace

Specifies whether to return the trace for the flow or not. Traces track inputs and outputs for nodes in the flow. For more information, see Track each step in your prompt flow by viewing its trace in Amazon Bedrock.

executionId

The unique identifier for the current flow execution. If you don't provide a value, Amazon Bedrock creates the identifier for you.

flowAliasIdentifier

[required] The unique identifier of the flow alias.

flowIdentifier

[required] The unique identifier of the flow.

inputs

[required] A list of objects, each containing information about an input into the flow.

modelPerformanceConfiguration

Model performance settings for the request.

Value

A list with the following syntax:

list(
  executionId = "string",
  responseStream = list(
    accessDeniedException = list(
      message = "string"
    ),
    badGatewayException = list(
      message = "string",
      resourceName = "string"
    ),
    conflictException = list(
      message = "string"
    ),
    dependencyFailedException = list(
      message = "string",
      resourceName = "string"
    ),
    flowCompletionEvent = list(
      completionReason = "SUCCESS"|"INPUT_REQUIRED"
    ),
    flowMultiTurnInputRequestEvent = list(
      content = list(
        document = list()
      ),
      nodeName = "string",
      nodeType = "FlowInputNode"|"FlowOutputNode"|"LambdaFunctionNode"|"KnowledgeBaseNode"|"PromptNode"|"ConditionNode"|"LexNode"
    ),
    flowOutputEvent = list(
      content = list(
        document = list()
      ),
      nodeName = "string",
      nodeType = "FlowInputNode"|"FlowOutputNode"|"LambdaFunctionNode"|"KnowledgeBaseNode"|"PromptNode"|"ConditionNode"|"LexNode"
    ),
    flowTraceEvent = list(
      trace = list(
        conditionNodeResultTrace = list(
          nodeName = "string",
          satisfiedConditions = list(
            list(
              conditionName = "string"
            )
          ),
          timestamp = as.POSIXct(
            "2015-01-01"
          )
        ),
        nodeInputTrace = list(
          fields = list(
            list(
              content = list(
                document = list()
              ),
              nodeInputName = "string"
            )
          ),
          nodeName = "string",
          timestamp = as.POSIXct(
            "2015-01-01"
          )
        ),
        nodeOutputTrace = list(
          fields = list(
            list(
              content = list(
                document = list()
              ),
              nodeOutputName = "string"
            )
          ),
          nodeName = "string",
          timestamp = as.POSIXct(
            "2015-01-01"
          )
        )
      )
    ),
    internalServerException = list(
      message = "string"
    ),
    resourceNotFoundException = list(
      message = "string"
    ),
    serviceQuotaExceededException = list(
      message = "string"
    ),
    throttlingException = list(
      message = "string"
    ),
    validationException = list(
      message = "string"
    )
  )
)

Request syntax

svc$invoke_flow(
  enableTrace = TRUE|FALSE,
  executionId = "string",
  flowAliasIdentifier = "string",
  flowIdentifier = "string",
  inputs = list(
    list(
      content = list(
        document = list()
      ),
      nodeInputName = "string",
      nodeName = "string",
      nodeOutputName = "string"
    )
  ),
  modelPerformanceConfiguration = list(
    performanceConfig = list(
      latency = "standard"|"optimized"
    )
  )
)