Hi just wondering if it is normal for an autotask to return with the status pending?
I’m running a transaction on Goerli testnet with an autotask. When the transaction is finished the autotask should return the transaction hash. However sometimes it just returns in a pending state (even if the transaction is successful) without the transaction hash which breaks my current coding logic.
Any advice on how to solve / get around this issue?
When an autotask is triggered by a webhook, the handler waits for a response. If the requests take too long to complete, the handler will time out, resulting in a pending state.
Even though the autotask will continue to run in the background and eventually succeed, the window in which it needs to return a response will have been timed out by then.
We will be working to resolve this issue in the future. However, in the meantime, it would be useful to understand why your autotask is taking so long to execute. By any chance, are you waiting for the transaction to be mined? In case you do, its worth noting that the relayer will take care of resubmissions if necessary.
How long does the handler wait? This seems to be happening for me after ~20 seconds. I am indeed waiting for the transaction to be mined. I’m doing this because Im using the Autotasks in combination with Apache Airflow. So the result of the transaction is vital in telling airflow if it should proceed to the next step. If i do not wait for the contract to be minded then autotask returns success even if the final transaction ends up failing.
The handler will remain open for about 25 seconds before timing out.
Rest assured, we will be working on something in the future to allow users to access the autotask status even after the handler connection has timed out.
For now however, would it be possible to introduce a new step in Airflow (if the autotask ends up pending) that pings another webhook autotask that can query the state of the transaction?
You could use the relayer-client to query the state of the transaction and simply loop this query until it is mined.