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"
          )
        ),
        nodeActionTrace = list(
          nodeName = "string",
          operationName = "string",
          operationRequest = list(),
          operationResponse = list(),
          requestId = "string",
          serviceName = "string",
          timestamp = as.POSIXct(
            "2015-01-01"
          )
        ),
        nodeDependencyTrace = list(
          nodeName = "string",
          timestamp = as.POSIXct(
            "2015-01-01"
          ),
          traceElements = list(
            agentTraces = list(
              list(
                agentAliasId = "string",
                agentId = "string",
                agentVersion = "string",
                callerChain = list(
                  list(
                    agentAliasArn = "string"
                  )
                ),
                collaboratorName = "string",
                eventTime = as.POSIXct(
                  "2015-01-01"
                ),
                sessionId = "string",
                trace = list(
                  customOrchestrationTrace = list(
                    event = list(
                      text = "string"
                    ),
                    traceId = "string"
                  ),
                  failureTrace = list(
                    failureCode = 123,
                    failureReason = "string",
                    metadata = list(
                      clientRequestId = "string",
                      endTime = as.POSIXct(
                        "2015-01-01"
                      ),
                      operationTotalTimeMs = 123,
                      startTime = as.POSIXct(
                        "2015-01-01"
                      ),
                      totalTimeMs = 123,
                      usage = list(
                        inputTokens = 123,
                        outputTokens = 123
                      )
                    ),
                    traceId = "string"
                  ),
                  guardrailTrace = list(
                    action = "INTERVENED"|"NONE",
                    inputAssessments = list(
                      list(
                        contentPolicy = list(
                          filters = list(
                            list(
                              action = "BLOCKED",
                              confidence = "NONE"|"LOW"|"MEDIUM"|"HIGH",
                              type = "INSULTS"|"HATE"|"SEXUAL"|"VIOLENCE"|"MISCONDUCT"|"PROMPT_ATTACK"
                            )
                          )
                        ),
                        sensitiveInformationPolicy = list(
                          piiEntities = list(
                            list(
                              action = "BLOCKED"|"ANONYMIZED",
                              match = "string",
                              type = "ADDRESS"|"AGE"|"AWS_ACCESS_KEY"|"AWS_SECRET_KEY"|"CA_HEALTH_NUMBER"|"CA_SOCIAL_INSURANCE_NUMBER"|"CREDIT_DEBIT_CARD_CVV"|"CREDIT_DEBIT_CARD_EXPIRY"|"CREDIT_DEBIT_CARD_NUMBER"|"DRIVER_ID"|"EMAIL"|"INTERNATIONAL_BANK_ACCOUNT_NUMBER"|"IP_ADDRESS"|"LICENSE_PLATE"|"MAC_ADDRESS"|"NAME"|"PASSWORD"|"PHONE"|"PIN"|"SWIFT_CODE"|"UK_NATIONAL_HEALTH_SERVICE_NUMBER"|"UK_NATIONAL_INSURANCE_NUMBER"|"UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER"|"URL"|"USERNAME"|"US_BANK_ACCOUNT_NUMBER"|"US_BANK_ROUTING_NUMBER"|"US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER"|"US_PASSPORT_NUMBER"|"US_SOCIAL_SECURITY_NUMBER"|"VEHICLE_IDENTIFICATION_NUMBER"
                            )
                          ),
                          regexes = list(
                            list(
                              action = "BLOCKED"|"ANONYMIZED",
                              match = "string",
                              name = "string",
                              regex = "string"
                            )
                          )
                        ),
                        topicPolicy = list(
                          topics = list(
                            list(
                              action = "BLOCKED",
                              name = "string",
                              type = "DENY"
                            )
                          )
                        ),
                        wordPolicy = list(
                          customWords = list(
                            list(
                              action = "BLOCKED",
                              match = "string"
                            )
                          ),
                          managedWordLists = list(
                            list(
                              action = "BLOCKED",
                              match = "string",
                              type = "PROFANITY"
                            )
                          )
                        )
                      )
                    ),
                    metadata = list(
                      clientRequestId = "string",
                      endTime = as.POSIXct(
                        "2015-01-01"
                      ),
                      operationTotalTimeMs = 123,
                      startTime = as.POSIXct(
                        "2015-01-01"
                      ),
                      totalTimeMs = 123,
                      usage = list(
                        inputTokens = 123,
                        outputTokens = 123
                      )
                    ),
                    outputAssessments = list(
                      list(
                        contentPolicy = list(
                          filters = list(
                            list(
                              action = "BLOCKED",
                              confidence = "NONE"|"LOW"|"MEDIUM"|"HIGH",
                              type = "INSULTS"|"HATE"|"SEXUAL"|"VIOLENCE"|"MISCONDUCT"|"PROMPT_ATTACK"
                            )
                          )
                        ),
                        sensitiveInformationPolicy = list(
                          piiEntities = list(
                            list(
                              action = "BLOCKED"|"ANONYMIZED",
                              match = "string",
                              type = "ADDRESS"|"AGE"|"AWS_ACCESS_KEY"|"AWS_SECRET_KEY"|"CA_HEALTH_NUMBER"|"CA_SOCIAL_INSURANCE_NUMBER"|"CREDIT_DEBIT_CARD_CVV"|"CREDIT_DEBIT_CARD_EXPIRY"|"CREDIT_DEBIT_CARD_NUMBER"|"DRIVER_ID"|"EMAIL"|"INTERNATIONAL_BANK_ACCOUNT_NUMBER"|"IP_ADDRESS"|"LICENSE_PLATE"|"MAC_ADDRESS"|"NAME"|"PASSWORD"|"PHONE"|"PIN"|"SWIFT_CODE"|"UK_NATIONAL_HEALTH_SERVICE_NUMBER"|"UK_NATIONAL_INSURANCE_NUMBER"|"UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER"|"URL"|"USERNAME"|"US_BANK_ACCOUNT_NUMBER"|"US_BANK_ROUTING_NUMBER"|"US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER"|"US_PASSPORT_NUMBER"|"US_SOCIAL_SECURITY_NUMBER"|"VEHICLE_IDENTIFICATION_NUMBER"
                            )
                          ),
                          regexes = list(
                            list(
                              action = "BLOCKED"|"ANONYMIZED",
                              match = "string",
                              name = "string",
                              regex = "string"
                            )
                          )
                        ),
                        topicPolicy = list(
                          topics = list(
                            list(
                              action = "BLOCKED",
                              name = "string",
                              type = "DENY"
                            )
                          )
                        ),
                        wordPolicy = list(
                          customWords = list(
                            list(
                              action = "BLOCKED",
                              match = "string"
                            )
                          ),
                          managedWordLists = list(
                            list(
                              action = "BLOCKED",
                              match = "string",
                              type = "PROFANITY"
                            )
                          )
                        )
                      )
                    ),
                    traceId = "string"
                  ),
                  orchestrationTrace = list(
                    invocationInput = list(
                      actionGroupInvocationInput = list(
                        actionGroupName = "string",
                        apiPath = "string",
                        executionType = "LAMBDA"|"RETURN_CONTROL",
                        function = "string",
                        invocationId = "string",
                        parameters = list(
                          list(
                            name = "string",
                            type = "string",
                            value = "string"
                          )
                        ),
                        requestBody = list(
                          content = list(
                            list(
                              list(
                                name = "string",
                                type = "string",
                                value = "string"
                              )
                            )
                          )
                        ),
                        verb = "string"
                      ),
                      agentCollaboratorInvocationInput = list(
                        agentCollaboratorAliasArn = "string",
                        agentCollaboratorName = "string",
                        input = list(
                          returnControlResults = list(
                            invocationId = "string",
                            returnControlInvocationResults = list(
                              list(
                                apiResult = list(
                                  actionGroup = "string",
                                  agentId = "string",
                                  apiPath = "string",
                                  confirmationState = "CONFIRM"|"DENY",
                                  httpMethod = "string",
                                  httpStatusCode = 123,
                                  responseBody = list(
                                    list(
                                      body = "string",
                                      images = list(
                                        list(
                                          format = "png"|"jpeg"|"gif"|"webp",
                                          source = list(
                                            bytes = raw
                                          )
                                        )
                                      )
                                    )
                                  ),
                                  responseState = "FAILURE"|"REPROMPT"
                                ),
                                functionResult = list(
                                  actionGroup = "string",
                                  agentId = "string",
                                  confirmationState = "CONFIRM"|"DENY",
                                  function = "string",
                                  responseBody = list(
                                    list(
                                      body = "string",
                                      images = list(
                                        list(
                                          format = "png"|"jpeg"|"gif"|"webp",
                                          source = list(
                                            bytes = raw
                                          )
                                        )
                                      )
                                    )
                                  ),
                                  responseState = "FAILURE"|"REPROMPT"
                                )
                              )
                            )
                          ),
                          text = "string",
                          type = "TEXT"|"RETURN_CONTROL"
                        )
                      ),
                      codeInterpreterInvocationInput = list(
                        code = "string",
                        files = list(
                          "string"
                        )
                      ),
                      invocationType = "ACTION_GROUP"|"KNOWLEDGE_BASE"|"FINISH"|"ACTION_GROUP_CODE_INTERPRETER"|"AGENT_COLLABORATOR",
                      knowledgeBaseLookupInput = list(
                        knowledgeBaseId = "string",
                        text = "string"
                      ),
                      traceId = "string"
                    ),
                    modelInvocationInput = list(
                      foundationModel = "string",
                      inferenceConfiguration = list(
                        maximumLength = 123,
                        stopSequences = list(
                          "string"
                        ),
                        temperature = 123.0,
                        topK = 123,
                        topP = 123.0
                      ),
                      overrideLambda = "string",
                      parserMode = "DEFAULT"|"OVERRIDDEN",
                      promptCreationMode = "DEFAULT"|"OVERRIDDEN",
                      text = "string",
                      traceId = "string",
                      type = "PRE_PROCESSING"|"ORCHESTRATION"|"KNOWLEDGE_BASE_RESPONSE_GENERATION"|"POST_PROCESSING"|"ROUTING_CLASSIFIER"
                    ),
                    modelInvocationOutput = list(
                      metadata = list(
                        clientRequestId = "string",
                        endTime = as.POSIXct(
                          "2015-01-01"
                        ),
                        operationTotalTimeMs = 123,
                        startTime = as.POSIXct(
                          "2015-01-01"
                        ),
                        totalTimeMs = 123,
                        usage = list(
                          inputTokens = 123,
                          outputTokens = 123
                        )
                      ),
                      rawResponse = list(
                        content = "string"
                      ),
                      reasoningContent = list(
                        reasoningText = list(
                          signature = "string",
                          text = "string"
                        ),
                        redactedContent = raw
                      ),
                      traceId = "string"
                    ),
                    observation = list(
                      actionGroupInvocationOutput = list(
                        metadata = list(
                          clientRequestId = "string",
                          endTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          operationTotalTimeMs = 123,
                          startTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          totalTimeMs = 123,
                          usage = list(
                            inputTokens = 123,
                            outputTokens = 123
                          )
                        ),
                        text = "string"
                      ),
                      agentCollaboratorInvocationOutput = list(
                        agentCollaboratorAliasArn = "string",
                        agentCollaboratorName = "string",
                        metadata = list(
                          clientRequestId = "string",
                          endTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          operationTotalTimeMs = 123,
                          startTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          totalTimeMs = 123,
                          usage = list(
                            inputTokens = 123,
                            outputTokens = 123
                          )
                        ),
                        output = list(
                          returnControlPayload = list(
                            invocationId = "string",
                            invocationInputs = list(
                              list(
                                apiInvocationInput = list(
                                  actionGroup = "string",
                                  actionInvocationType = "RESULT"|"USER_CONFIRMATION"|"USER_CONFIRMATION_AND_RESULT",
                                  agentId = "string",
                                  apiPath = "string",
                                  collaboratorName = "string",
                                  httpMethod = "string",
                                  parameters = list(
                                    list(
                                      name = "string",
                                      type = "string",
                                      value = "string"
                                    )
                                  ),
                                  requestBody = list(
                                    content = list(
                                      list(
                                        properties = list(
                                          list(
                                            name = "string",
                                            type = "string",
                                            value = "string"
                                          )
                                        )
                                      )
                                    )
                                  )
                                ),
                                functionInvocationInput = list(
                                  actionGroup = "string",
                                  actionInvocationType = "RESULT"|"USER_CONFIRMATION"|"USER_CONFIRMATION_AND_RESULT",
                                  agentId = "string",
                                  collaboratorName = "string",
                                  function = "string",
                                  parameters = list(
                                    list(
                                      name = "string",
                                      type = "string",
                                      value = "string"
                                    )
                                  )
                                )
                              )
                            )
                          ),
                          text = "string",
                          type = "TEXT"|"RETURN_CONTROL"
                        )
                      ),
                      codeInterpreterInvocationOutput = list(
                        executionError = "string",
                        executionOutput = "string",
                        executionTimeout = TRUE|FALSE,
                        files = list(
                          "string"
                        ),
                        metadata = list(
                          clientRequestId = "string",
                          endTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          operationTotalTimeMs = 123,
                          startTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          totalTimeMs = 123,
                          usage = list(
                            inputTokens = 123,
                            outputTokens = 123
                          )
                        )
                      ),
                      finalResponse = list(
                        metadata = list(
                          clientRequestId = "string",
                          endTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          operationTotalTimeMs = 123,
                          startTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          totalTimeMs = 123,
                          usage = list(
                            inputTokens = 123,
                            outputTokens = 123
                          )
                        ),
                        text = "string"
                      ),
                      knowledgeBaseLookupOutput = list(
                        metadata = list(
                          clientRequestId = "string",
                          endTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          operationTotalTimeMs = 123,
                          startTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          totalTimeMs = 123,
                          usage = list(
                            inputTokens = 123,
                            outputTokens = 123
                          )
                        ),
                        retrievedReferences = list(
                          list(
                            content = list(
                              audio = list(
                                s3Uri = "string",
                                transcription = "string"
                              ),
                              byteContent = "string",
                              row = list(
                                list(
                                  columnName = "string",
                                  columnValue = "string",
                                  type = "BLOB"|"BOOLEAN"|"DOUBLE"|"NULL"|"LONG"|"STRING"
                                )
                              ),
                              text = "string",
                              type = "TEXT"|"IMAGE"|"ROW"|"AUDIO"|"VIDEO",
                              video = list(
                                s3Uri = "string",
                                summary = "string"
                              )
                            ),
                            location = list(
                              confluenceLocation = list(
                                url = "string"
                              ),
                              customDocumentLocation = list(
                                id = "string"
                              ),
                              kendraDocumentLocation = list(
                                uri = "string"
                              ),
                              s3Location = list(
                                uri = "string"
                              ),
                              salesforceLocation = list(
                                url = "string"
                              ),
                              sharePointLocation = list(
                                url = "string"
                              ),
                              sqlLocation = list(
                                query = "string"
                              ),
                              type = "S3"|"WEB"|"CONFLUENCE"|"SALESFORCE"|"SHAREPOINT"|"CUSTOM"|"KENDRA"|"SQL",
                              webLocation = list(
                                url = "string"
                              )
                            ),
                            metadata = list(
                              list()
                            )
                          )
                        )
                      ),
                      repromptResponse = list(
                        source = "ACTION_GROUP"|"KNOWLEDGE_BASE"|"PARSER",
                        text = "string"
                      ),
                      traceId = "string",
                      type = "ACTION_GROUP"|"AGENT_COLLABORATOR"|"KNOWLEDGE_BASE"|"FINISH"|"ASK_USER"|"REPROMPT"
                    ),
                    rationale = list(
                      text = "string",
                      traceId = "string"
                    )
                  ),
                  postProcessingTrace = list(
                    modelInvocationInput = list(
                      foundationModel = "string",
                      inferenceConfiguration = list(
                        maximumLength = 123,
                        stopSequences = list(
                          "string"
                        ),
                        temperature = 123.0,
                        topK = 123,
                        topP = 123.0
                      ),
                      overrideLambda = "string",
                      parserMode = "DEFAULT"|"OVERRIDDEN",
                      promptCreationMode = "DEFAULT"|"OVERRIDDEN",
                      text = "string",
                      traceId = "string",
                      type = "PRE_PROCESSING"|"ORCHESTRATION"|"KNOWLEDGE_BASE_RESPONSE_GENERATION"|"POST_PROCESSING"|"ROUTING_CLASSIFIER"
                    ),
                    modelInvocationOutput = list(
                      metadata = list(
                        clientRequestId = "string",
                        endTime = as.POSIXct(
                          "2015-01-01"
                        ),
                        operationTotalTimeMs = 123,
                        startTime = as.POSIXct(
                          "2015-01-01"
                        ),
                        totalTimeMs = 123,
                        usage = list(
                          inputTokens = 123,
                          outputTokens = 123
                        )
                      ),
                      parsedResponse = list(
                        text = "string"
                      ),
                      rawResponse = list(
                        content = "string"
                      ),
                      reasoningContent = list(
                        reasoningText = list(
                          signature = "string",
                          text = "string"
                        ),
                        redactedContent = raw
                      ),
                      traceId = "string"
                    )
                  ),
                  preProcessingTrace = list(
                    modelInvocationInput = list(
                      foundationModel = "string",
                      inferenceConfiguration = list(
                        maximumLength = 123,
                        stopSequences = list(
                          "string"
                        ),
                        temperature = 123.0,
                        topK = 123,
                        topP = 123.0
                      ),
                      overrideLambda = "string",
                      parserMode = "DEFAULT"|"OVERRIDDEN",
                      promptCreationMode = "DEFAULT"|"OVERRIDDEN",
                      text = "string",
                      traceId = "string",
                      type = "PRE_PROCESSING"|"ORCHESTRATION"|"KNOWLEDGE_BASE_RESPONSE_GENERATION"|"POST_PROCESSING"|"ROUTING_CLASSIFIER"
                    ),
                    modelInvocationOutput = list(
                      metadata = list(
                        clientRequestId = "string",
                        endTime = as.POSIXct(
                          "2015-01-01"
                        ),
                        operationTotalTimeMs = 123,
                        startTime = as.POSIXct(
                          "2015-01-01"
                        ),
                        totalTimeMs = 123,
                        usage = list(
                          inputTokens = 123,
                          outputTokens = 123
                        )
                      ),
                      parsedResponse = list(
                        isValid = TRUE|FALSE,
                        rationale = "string"
                      ),
                      rawResponse = list(
                        content = "string"
                      ),
                      reasoningContent = list(
                        reasoningText = list(
                          signature = "string",
                          text = "string"
                        ),
                        redactedContent = raw
                      ),
                      traceId = "string"
                    )
                  ),
                  routingClassifierTrace = list(
                    invocationInput = list(
                      actionGroupInvocationInput = list(
                        actionGroupName = "string",
                        apiPath = "string",
                        executionType = "LAMBDA"|"RETURN_CONTROL",
                        function = "string",
                        invocationId = "string",
                        parameters = list(
                          list(
                            name = "string",
                            type = "string",
                            value = "string"
                          )
                        ),
                        requestBody = list(
                          content = list(
                            list(
                              list(
                                name = "string",
                                type = "string",
                                value = "string"
                              )
                            )
                          )
                        ),
                        verb = "string"
                      ),
                      agentCollaboratorInvocationInput = list(
                        agentCollaboratorAliasArn = "string",
                        agentCollaboratorName = "string",
                        input = list(
                          returnControlResults = list(
                            invocationId = "string",
                            returnControlInvocationResults = list(
                              list(
                                apiResult = list(
                                  actionGroup = "string",
                                  agentId = "string",
                                  apiPath = "string",
                                  confirmationState = "CONFIRM"|"DENY",
                                  httpMethod = "string",
                                  httpStatusCode = 123,
                                  responseBody = list(
                                    list(
                                      body = "string",
                                      images = list(
                                        list(
                                          format = "png"|"jpeg"|"gif"|"webp",
                                          source = list(
                                            bytes = raw
                                          )
                                        )
                                      )
                                    )
                                  ),
                                  responseState = "FAILURE"|"REPROMPT"
                                ),
                                functionResult = list(
                                  actionGroup = "string",
                                  agentId = "string",
                                  confirmationState = "CONFIRM"|"DENY",
                                  function = "string",
                                  responseBody = list(
                                    list(
                                      body = "string",
                                      images = list(
                                        list(
                                          format = "png"|"jpeg"|"gif"|"webp",
                                          source = list(
                                            bytes = raw
                                          )
                                        )
                                      )
                                    )
                                  ),
                                  responseState = "FAILURE"|"REPROMPT"
                                )
                              )
                            )
                          ),
                          text = "string",
                          type = "TEXT"|"RETURN_CONTROL"
                        )
                      ),
                      codeInterpreterInvocationInput = list(
                        code = "string",
                        files = list(
                          "string"
                        )
                      ),
                      invocationType = "ACTION_GROUP"|"KNOWLEDGE_BASE"|"FINISH"|"ACTION_GROUP_CODE_INTERPRETER"|"AGENT_COLLABORATOR",
                      knowledgeBaseLookupInput = list(
                        knowledgeBaseId = "string",
                        text = "string"
                      ),
                      traceId = "string"
                    ),
                    modelInvocationInput = list(
                      foundationModel = "string",
                      inferenceConfiguration = list(
                        maximumLength = 123,
                        stopSequences = list(
                          "string"
                        ),
                        temperature = 123.0,
                        topK = 123,
                        topP = 123.0
                      ),
                      overrideLambda = "string",
                      parserMode = "DEFAULT"|"OVERRIDDEN",
                      promptCreationMode = "DEFAULT"|"OVERRIDDEN",
                      text = "string",
                      traceId = "string",
                      type = "PRE_PROCESSING"|"ORCHESTRATION"|"KNOWLEDGE_BASE_RESPONSE_GENERATION"|"POST_PROCESSING"|"ROUTING_CLASSIFIER"
                    ),
                    modelInvocationOutput = list(
                      metadata = list(
                        clientRequestId = "string",
                        endTime = as.POSIXct(
                          "2015-01-01"
                        ),
                        operationTotalTimeMs = 123,
                        startTime = as.POSIXct(
                          "2015-01-01"
                        ),
                        totalTimeMs = 123,
                        usage = list(
                          inputTokens = 123,
                          outputTokens = 123
                        )
                      ),
                      rawResponse = list(
                        content = "string"
                      ),
                      traceId = "string"
                    ),
                    observation = list(
                      actionGroupInvocationOutput = list(
                        metadata = list(
                          clientRequestId = "string",
                          endTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          operationTotalTimeMs = 123,
                          startTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          totalTimeMs = 123,
                          usage = list(
                            inputTokens = 123,
                            outputTokens = 123
                          )
                        ),
                        text = "string"
                      ),
                      agentCollaboratorInvocationOutput = list(
                        agentCollaboratorAliasArn = "string",
                        agentCollaboratorName = "string",
                        metadata = list(
                          clientRequestId = "string",
                          endTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          operationTotalTimeMs = 123,
                          startTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          totalTimeMs = 123,
                          usage = list(
                            inputTokens = 123,
                            outputTokens = 123
                          )
                        ),
                        output = list(
                          returnControlPayload = list(
                            invocationId = "string",
                            invocationInputs = list(
                              list(
                                apiInvocationInput = list(
                                  actionGroup = "string",
                                  actionInvocationType = "RESULT"|"USER_CONFIRMATION"|"USER_CONFIRMATION_AND_RESULT",
                                  agentId = "string",
                                  apiPath = "string",
                                  collaboratorName = "string",
                                  httpMethod = "string",
                                  parameters = list(
                                    list(
                                      name = "string",
                                      type = "string",
                                      value = "string"
                                    )
                                  ),
                                  requestBody = list(
                                    content = list(
                                      list(
                                        properties = list(
                                          list(
                                            name = "string",
                                            type = "string",
                                            value = "string"
                                          )
                                        )
                                      )
                                    )
                                  )
                                ),
                                functionInvocationInput = list(
                                  actionGroup = "string",
                                  actionInvocationType = "RESULT"|"USER_CONFIRMATION"|"USER_CONFIRMATION_AND_RESULT",
                                  agentId = "string",
                                  collaboratorName = "string",
                                  function = "string",
                                  parameters = list(
                                    list(
                                      name = "string",
                                      type = "string",
                                      value = "string"
                                    )
                                  )
                                )
                              )
                            )
                          ),
                          text = "string",
                          type = "TEXT"|"RETURN_CONTROL"
                        )
                      ),
                      codeInterpreterInvocationOutput = list(
                        executionError = "string",
                        executionOutput = "string",
                        executionTimeout = TRUE|FALSE,
                        files = list(
                          "string"
                        ),
                        metadata = list(
                          clientRequestId = "string",
                          endTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          operationTotalTimeMs = 123,
                          startTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          totalTimeMs = 123,
                          usage = list(
                            inputTokens = 123,
                            outputTokens = 123
                          )
                        )
                      ),
                      finalResponse = list(
                        metadata = list(
                          clientRequestId = "string",
                          endTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          operationTotalTimeMs = 123,
                          startTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          totalTimeMs = 123,
                          usage = list(
                            inputTokens = 123,
                            outputTokens = 123
                          )
                        ),
                        text = "string"
                      ),
                      knowledgeBaseLookupOutput = list(
                        metadata = list(
                          clientRequestId = "string",
                          endTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          operationTotalTimeMs = 123,
                          startTime = as.POSIXct(
                            "2015-01-01"
                          ),
                          totalTimeMs = 123,
                          usage = list(
                            inputTokens = 123,
                            outputTokens = 123
                          )
                        ),
                        retrievedReferences = list(
                          list(
                            content = list(
                              audio = list(
                                s3Uri = "string",
                                transcription = "string"
                              ),
                              byteContent = "string",
                              row = list(
                                list(
                                  columnName = "string",
                                  columnValue = "string",
                                  type = "BLOB"|"BOOLEAN"|"DOUBLE"|"NULL"|"LONG"|"STRING"
                                )
                              ),
                              text = "string",
                              type = "TEXT"|"IMAGE"|"ROW"|"AUDIO"|"VIDEO",
                              video = list(
                                s3Uri = "string",
                                summary = "string"
                              )
                            ),
                            location = list(
                              confluenceLocation = list(
                                url = "string"
                              ),
                              customDocumentLocation = list(
                                id = "string"
                              ),
                              kendraDocumentLocation = list(
                                uri = "string"
                              ),
                              s3Location = list(
                                uri = "string"
                              ),
                              salesforceLocation = list(
                                url = "string"
                              ),
                              sharePointLocation = list(
                                url = "string"
                              ),
                              sqlLocation = list(
                                query = "string"
                              ),
                              type = "S3"|"WEB"|"CONFLUENCE"|"SALESFORCE"|"SHAREPOINT"|"CUSTOM"|"KENDRA"|"SQL",
                              webLocation = list(
                                url = "string"
                              )
                            ),
                            metadata = list(
                              list()
                            )
                          )
                        )
                      ),
                      repromptResponse = list(
                        source = "ACTION_GROUP"|"KNOWLEDGE_BASE"|"PARSER",
                        text = "string"
                      ),
                      traceId = "string",
                      type = "ACTION_GROUP"|"AGENT_COLLABORATOR"|"KNOWLEDGE_BASE"|"FINISH"|"ASK_USER"|"REPROMPT"
                    )
                  )
                )
              )
            )
          )
        ),
        nodeInputTrace = list(
          fields = list(
            list(
              category = "LoopCondition"|"ReturnValueToLoopStart"|"ExitLoop",
              content = list(
                document = list()
              ),
              executionChain = list(
                list(
                  index = 123,
                  nodeName = "string",
                  type = "Iterator"|"Loop"
                )
              ),
              nodeInputName = "string",
              source = list(
                expression = "string",
                nodeName = "string",
                outputFieldName = "string"
              ),
              type = "String"|"Number"|"Boolean"|"Object"|"Array"
            )
          ),
          nodeName = "string",
          timestamp = as.POSIXct(
            "2015-01-01"
          )
        ),
        nodeOutputTrace = list(
          fields = list(
            list(
              content = list(
                document = list()
              ),
              next = list(
                list(
                  inputFieldName = "string",
                  nodeName = "string"
                )
              ),
              nodeOutputName = "string",
              type = "String"|"Number"|"Boolean"|"Object"|"Array"
            )
          ),
          nodeName = "string",
          timestamp = as.POSIXct(
            "2015-01-01"
          )
        )
      )
    ),
    internalServerException = list(
      message = "string",
      reason = "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"
    )
  )
)