When you invoke a flow, you can view the trace to see the inputs to and outputs from each node. The trace helps you track the path from the input to the response that it ultimately returns. You can use the trace to troubleshoot errors that occur, to identify steps that lead to an unexpected outcome or performance bottleneck, and to consider ways in which you can improve the flow.
To view the trace, do the following:
-
In the console, follow the steps in the Console tab at Test a flow in Amazon Bedrock and choose Show trace in the response from flow invocation.
-
In the API, set the
enableTrace
field totrue
in an InvokeFlow request. EachflowOutputEvent
in the response is returned alongside aflowTraceEvent
.
Each trace event includes the name of the node that either received an input or yielded an output and the date at time at which the input or output was processed. Select a tab to learn more about a type of trace event:
This type of trace identifies which conditions are satisfied for a condition node and helps you identify the branch or branches of the flow that are activated during the invocation. The following JSON object shows what a FlowTraceEvent looks like for the result of a condition node:
{
"trace": {
"conditionNodeOutputTrace": {
"nodeName": "string",
"satisfiedConditions": [
{
"conditionName": "string"
},
...
],
"timestamp": timestamp
}
}
}