Analyze Handshake Metadata
Analyze device session metadata and identify errors during flow execution
Attestr Studio platform provides a debug API which gives the detailed metadata, state and execution sequence of the flow in the context of a device session. This is particularly useful in identifying errors during a flow execution after error handler is triggered.
To get the handshake metadata, use the Execution Result API with a query parameter called mode=debug. The modified URL will be https://api.attestr.com/api/{version}/public/flowx/handshake/{handshakeId}?mode=debug
The response contains following additional information.
key | Description | Min Version | Max Version |
---|---|---|---|
stageMetadata | Metadata describing input, output and error at every stage. Null if handshake is archived. | v1 | |
requests | Sequence of messages shared with Attestr Servers. Null if handshake is archived. | v1 | |
metadata | Information about device, user agent and ip address. Null if handshake is archived. | v1 | |
state | Final state of variables post flow execution. Null if handshake is archived. | v1 | |
client | The app client Id used to create the handshake | v1 | |
clientKey | The client key used to generate handshake | v1 | |
created | The unix timestamp when handshake was created | v1 | |
updated | The unix timestamp when handshake was last updated | v1 |
Stage Metadata
After a stage completes, the stage metadata is updated with the state of the variables and state of input parameters for all other stages. This acts as a snapshot of the state of the flow after each step in the flow. Stage metadata has the following structure.
{
"stageId_1": {
state: {
stages: {
'stageId_1': {
Input keys specific to the stage and corresponding values set by any assignments'
},
'stageId_2': {
}
},
variables: {
Values for each variable defined in the flow.
}
}
input: '<Input keys specific to stage and corresponding values as specified by user>'
output: '<Output of the stage if stage is successfully run>'
error: '<Error if any during the stage execution>'
requestId: 'Unique requestId used for internal tracing purposes',
condition: '<Null or condition id which returned true if this stage is a logical stage>'
},
"stageId_2": {
state: '..',
input: '..',
output: '..',
error: '..',
requestId: '..'
}
}
State
State object is the final state of the flow after all the stages in the flow are complete. State object contains input key values for every stage and values for all the variables defined in the flow. It has following structure.
{
variables: {
Values for each variable defined in the flow.
},
stages: {
stageId_1: {
Input keys specific to the stage and corresponding values at the end of the flow.
}
}
}
Requests
Attestr uses sockets to connect to its servers and set of messages are exchanged between the device and back end servers as the flow progresses on user's device. Below flow chart describes a typical flow messages sequence.

The requests object contains a sequence of all these messages that are exchanged. This gives a clear picture of the screen by screen flow and every action that was performed by the user on the device. Also in the case of an error, it records the exact step at which flow halted. Requests has the following structure.
[
{
"_id": "<Unique request Id>",
"stage": '<Current stage id. Null if it is the start of the flow>',
"type": "<Message name>",
"initiated": "<Timestamp when request was initiated from device>",
"gwRequestId": "<Unique Attestr GWRequest Id for internal tracing>",
"payload": "Payload if any received from the device",
"response": {
// Response object containing HTTP status code 200 if request was successfully processed else set as null.
"httpStatusCode": 200
},
"error": {
// error object if an error occured while processing the request else set as null.
code: "<Error codes defined by Attestr specific to every stage>",
httpStatusCode: "<Equivalent http status code of the error>",
message: "Localized error message string as per user locale",
retry: "Flag indicating if this error is recoverable or not."
}
},
{
..
}
]
Metadata
Metadata object contains the device and user agent information. Below is a sample metadata json.
{
"ip": "49.37.154.36",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36",
"connection": "BOB3LdarBcwCGiA="
}
All these values combined together constitute a device session metadata and help customers figure out runtime errors if any and find the root cause of those errors.