> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blockx.chaintable.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Query results and handle failures

> Decide what to do after task, connection, or write failures.

Track the task identifier together with its EVM chain, input block or bundle, and target table. Those values let you connect execution results to the data you intended to produce.

## Keep the running connection

After submission, keep `WatchTasks` attached to the selected Worker. The stream sends a current snapshot and then the terminal update. Reconnect within the configured grace period after an interruption. `GetTaskResult` can inspect a result but does not keep a running task attached.

## Read the terminal result

| Check | Action |
| - | - |
| Task is still `RUNNING` | Continue watching |
| Task is `SUCCEEDED` | Inspect the selected Writer Plugin result |
| Task is `FAILED` | Read the failure code, message, and retryability |
| Task is unknown | Verify the Worker and task identifier; consider result retention |

For `ReturnValueHandler`, read the returned outputs. For table writes, retain the writer statistics and any `job_id`, then confirm storage readiness separately.

## Decide whether to repeat work

1. Distinguish an RPC or connection failure from a returned task failure.
2. Query the original task when the submission outcome is uncertain.
3. Fix input, function, or configuration errors before repeating.
4. Inspect the existing write state if the task reached its Writer Plugin.
5. Create new work only after deciding that another execution is appropriate.

A repeated identifier on the same Worker can return the existing result during its retention window. It does not force the failed task to execute again. A new identifier can produce another write.

## Locate the failure

| Stage | Inspect |
| - | - |
| Input | Source table, block or bundle availability, and configuration |
| Function | Input fields, explicit EVM context, audit findings, and contract errors |
| Output | Target schema, Writer Plugin configuration, and write-job state |
| Connection | Proxy, selected Worker, and Watch lifetime |

## Continue reading

* [Execution semantics and results](/concepts/execution-semantics)
* [Results and errors reference](/reference/results-and-errors)
* [Observability](/components/observability)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.