# How do I handle a failed task?

When working with workflows in MESA, you may encounter some failed tasks on the [Activity tab](/workflow-activity.md) or by [manually running your workflow](/workflow-builder/testing.md). The workflow will not process the automation completely if an error occurs during any tasks of the workflow.

Follow the steps below on how to troubleshoot an error that occurs during any tasks of the workflow.

### Manual Run Feature <a href="#test" id="test"></a>

While using MESA's [Manual Run feature](/workflow-builder/testing.md), you may encounter some failed tasks. This Manual Run feature is available in the Trigger step of your workflow or the Run workflow button in the Builder tab.

<figure><img src="/files/zrekMbjTtt5bb1wH9tTa" alt=""><figcaption></figcaption></figure>

If you see an error appearing like below, you can check the error message under the failed task. In this example, the error message states "Please select a connection."

<figure><img src="/files/AoijC5dGDb89MOVFN18Q" alt=""><figcaption></figcaption></figure>

Switch to the **Logs** view in the task options of a run to get more information regarding how the manual run processed. Go back to the **Activity** tab once you are done viewing.

<figure><img src="/files/198IrMDNJopjNXF0Exmk" alt=""><figcaption></figcaption></figure>

In this particular case, you will need to select or create a [connection](https://docs.getmesa.com/going-further/credentials) and fill out the Spreadsheet or Sheet Name in the Google Sheets Create Row step. You would make these changes in the Builder tab and save your changes.

Go back to the task in the Activity and click **Replay from this task** in the Task options. Check to see if your changes have resolved the error.

### Logging debug mode <a href="#debug" id="debug"></a>

If you find that you are still unable to resolve the error, you can do additional troubleshooting by turning on Logging debug mode in the workflow's Acitivity tab.

1\. In the Activity tab, turn on **Debug Logs** while troubleshooting any errors. You can turn off debug logs mode once you are done with troubleshooting.

<figure><img src="/files/U0zFMosFfL511g7TQ6Ni" alt=""><figcaption></figcaption></figure>

2\. Scroll or search within the **Activity** tab and locate the failed task which will contain an **Error** status on the left-hand side.

3\. Click on the checkbox to the left of the task to select it.

<figure><img src="/files/NRIkkotjk2xLZJhGr6cL" alt=""><figcaption></figcaption></figure>

4\. Replay the entire workflow starting from the [Trigger](/workflow-builder/triggers.md) while Logging debug mode is turned on. You can click on the Bulk actions while the run is selected. Click **Replay entire workflow** to replay the run.

<figure><img src="/files/6zTB7DCkTxCGhDP6wAeT" alt=""><figcaption></figcaption></figure>

5\. MESA provides a more detailed layout under the [Logs](/workflow-activity/logs.md) page. Logs enable you to search for past tasks or to view an entire chain of actions and their information for a specific task. You click on the Run Options (three-vertical-dot icon) on the selected run and click on **Logs**.

<figure><img src="/files/Rq0dvp5hq1DQDkJUMZLX" alt=""><figcaption></figcaption></figure>

Since **Logging** and **Logging debug mode** are turned on, you will see more information related to the failed task appear.

The messages with the red **Error** tag will be the most important to review.

<figure><img src="/files/vORmQ7h5GElGbYZfREtk" alt=""><figcaption></figcaption></figure>

7\. Once you have made adjustments to your workflow to fix the error, you can replay the failed task.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.getmesa.com/frequently-asked-questions/how-do-i-handle-a-failed-task.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
