The following error JSON is generated from the Add Row To Table block in your automation:
The session specified in the request does not exist or is invalid due to a transient error.
In this article, we will provide you with a test case, along with an Automation JSON, and walk you through how to reproduce the error. We will explain how to troubleshoot it and what the error means.
Our test automation opens a session to an Excel file, creates two sheets, and inside each sheet creates a table with data from a loop.
There will be two loops. Each loop adds 57 rows to the table on each sheet.
After the first loop is done, we create the second sheet with its table, but this time before adding 57 rows again to the table, we sleep for five minutes before continuing the automation execution.
When the five minutes pass and we try to add 57 rows using the Add Row To Table block we get the following error:
The session specified in the request does not exist or is invalid due to a transient error.
Why the use of the sleep block? We are mimicking a pause in the automation where we are not using the workbook session, a pause could be another block that takes a few minutes to process and respond back.
Why The Error Happens
The error occurs after idling and when not using the workbook session inside the Automation. The test using the Sleep block indicates the idle timeout occurs after five minutes of inactivity.
By the time we returned to adding rows with the Add Row Block, the workbook session was no longer active.
Review the chronological order and identify gaps between blocks where you do not use the Microsoft Excel blocks for a few minutes, but when you expect to have a workbook session open. Then reduce these gaps so that no more than five minutes pass and the workbook session cannot reach its idle timeout.
Alternatively, if you identify a block which takes up to or longer than five minutes to return a response, consider using a close workbook session block before this block, and follow it up with an open workbook session block to renew the session after the block that takes time to respond is done executing.
That way we will have a fresh workbook session to work with.