# Troubleshooting a Workflow

Most of the time, your workflow just works - and that’s the point!&#x20;

When something doesn’t look right, the cause is usually something small. This article helps you get comfortable diagnosing those moments quickly.

### **Ask AI**

The easiest way to root cause an error is to chat with the built-in AI expert that has extensive knowledge about the StackAI platform.&#x20;

<figure><img src="https://3697023207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFSlso1Kjob5CLDrh0dVn%2Fuploads%2FgJMcs6KdNQQjMGF38Qja%2FClipboard-20260219-011320-136.gif?alt=media&#x26;token=015f6cbe-654d-4dbe-a076-ec85302431c2" alt=""><figcaption></figcaption></figure>

The Ask AI feature can also help you when there is not an error. It is located at the bottom of the screen, and it can handle advanced tasks, such as updating and adding nodes into the workflow based on your prompt.

### **Inspect Nodes**

The Analytics page provides node-level information to help you deep dive on the data flowing through the workflow and trace any actions taken at various steps.

<figure><img src="https://3697023207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFSlso1Kjob5CLDrh0dVn%2Fuploads%2FOcSjgUbamcuqswHVdiq2%2FAnalytics_nodes_720p.gif?alt=media&#x26;token=fa5b574d-6521-4833-9ac7-002909374571" alt=""><figcaption></figcaption></figure>

### **Inspect Versions**

For each iteration, it is recommended to add a description of the changes for future references.&#x20;

<figure><img src="https://3697023207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFSlso1Kjob5CLDrh0dVn%2Fuploads%2F2504GlxjaE73kNb1nvT3%2FVersion%20history.gif?alt=media&#x26;token=1af91e75-9df5-4d28-860d-294d36fb7001" alt=""><figcaption></figcaption></figure>

Using **Version History**, you can revert back to a previous snapshot of the workflow.&#x20;

<figure><img src="https://3697023207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFSlso1Kjob5CLDrh0dVn%2Fuploads%2FqNFu7UNFkQL0jynPSjG3%2FRevert%20history.gif?alt=media&#x26;token=a0536421-8343-4c0c-ad4f-05ffe1db190e" alt=""><figcaption></figcaption></figure>

### **Ways to Improve Testing**

1. **Test** within the nodes

Some nodes, such as **Python** and **Send HTTP Request**, require iterations with the code and parameters.&#x20;

To speed up the building process, you can run incremental tests directly in the node and save time from running the entire workflow end to end.

<figure><img src="https://3697023207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFSlso1Kjob5CLDrh0dVn%2Fuploads%2FVJV9DsGN3Q25q54XdOA0%2FClipboard-20260213-212005-613.gif?alt=media&#x26;token=c518437e-4b6b-4b66-bbad-e4319ab4ad6f" alt=""><figcaption></figcaption></figure>

Similarly, for many actions, there is a **Test Action** option to see the results.

<figure><img src="https://3697023207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFSlso1Kjob5CLDrh0dVn%2Fuploads%2F1a8ZD7bTWJeLUcfSt9Nt%2Fimage.png?alt=media&#x26;token=f271f360-e86a-4ce7-9131-b7437efaa103" alt=""><figcaption></figcaption></figure>

2. **Pin** and **Skip** nodes

<figure><img src="https://3697023207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFSlso1Kjob5CLDrh0dVn%2Fuploads%2F5hb2j8WtLDBci9ijUlo0%2Fimage.png?alt=media&#x26;token=c619a7ec-3a52-4c0a-8d07-01aa630c1f6d" alt=""><figcaption></figcaption></figure>

**Skip node** allows you to skip some nodes in the workflow while observing the results of the rest of nodes.&#x20;

**Pin node** allows you to fixate the output from large language model (LLM) nodes. LLM responses can vary for the same question due to their nature. Pinning the nodes can help maintain consistency during testing.

### **Enable Preventative Settings**

Builders often encounter two common errors related to the large language model (LLM) nodes when they first get started.

1. The input length exceeded the context window of LLMs.
2. The LLM provider experienced an outage.&#x20;

For each of the common errors, there is a setting in the LLM node to prevent workflow failure. See [LLM node](https://docs.stack-ai.com/stack-ai/workflow-builder/llms/llm-node/advanced-settings) for details on **Safe Context Window** and **Fallback Branch**.
