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

# Loop lockouts in workflows

> Understand what causes workflow loops in the HoopAI platform, how they are detected and prevented, and how to redesign workflows to avoid circular triggers.

When a workflow triggers itself repeatedly, the HoopAI platform detects the loop and locks out the workflow to protect your account and system resources. This guide explains why loop lockouts happen, how to resolve them, and how to design workflows that avoid circular triggers.

***

## How Hoop detects workflow loops

Hoop monitors workflow executions in real time. If a workflow fires more than **50 times within 60 seconds** on the same record or contact, the system flags it as a loop and automatically disables the workflow.

When a lockout occurs:

* The workflow status changes to **Locked — Loop Detected**
* All queued executions for that workflow are cancelled
* You receive a notification in the **Notifications** panel and via email

<Warning>
  A locked workflow will not resume on its own. You must manually review the trigger logic, fix the issue, and re-enable the workflow.
</Warning>

***

## Common causes of workflow loops

| Cause                                            | Example                                                                                                                   | Fix                                                                         |
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| Workflow updates a field that re-triggers itself | A workflow triggers on "Contact Updated" and then updates the contact record                                              | Add a filter condition so the workflow only fires on specific field changes |
| Two workflows triggering each other              | Workflow A updates a deal, which triggers Workflow B, which updates the contact, which re-triggers Workflow A             | Consolidate the logic into a single workflow or add guard conditions        |
| Webhook loop                                     | An outbound webhook sends data to an external system that pushes data back into Hoop via API, re-triggering the workflow  | Add a flag field (e.g., "processed") and filter it out on the trigger       |
| Tag-based triggers without exclusion             | A workflow triggers on "Tag Added" and adds another tag, which fires a different workflow that adds the original tag back | Use a single tag-add action and exclude contacts who already have the tag   |

***

## Resolving a locked workflow

<Steps>
  <Step title="Locate the locked workflow">
    Go to **Automation > Workflows**. Locked workflows display a red **Loop Detected** badge. Click on the workflow to open it.
  </Step>

  <Step title="Review the execution log">
    Open the **Execution History** tab. Look at the timestamps and actions to identify which step is creating the loop. Pay attention to the trigger event and the actions that modify the same record.
  </Step>

  <Step title="Fix the trigger or action">
    Modify the workflow to break the circular dependency. Common fixes include:

    * Adding a filter condition to the trigger (e.g., "only if field X changed")
    * Adding a **Wait** step to throttle execution
    * Using a custom field as a "processed" flag and excluding records that already have it set
  </Step>

  <Step title="Re-enable the workflow">
    After making changes, click **Save** and then toggle the workflow status back to **Active**. Monitor the execution log closely for the next few minutes to confirm the loop is resolved.
  </Step>
</Steps>

***

## Designing loop-safe workflows

<Tip>
  The simplest way to prevent loops is to never let a workflow modify the same field or object that its trigger monitors.
</Tip>

Follow these best practices:

1. **Use specific trigger filters** — Instead of triggering on "Contact Updated," trigger on a specific field change like "Status changed to Active"
2. **Add a processed flag** — Create a custom field such as `workflow_processed` and set it to `true` at the end of your workflow. Add a trigger filter to skip contacts where this field is already `true`
3. **Consolidate related automations** — If two workflows need to modify each other's trigger objects, merge them into one workflow with conditional branches
4. **Use the "Run Once" option** — Enable the "Run once per contact" setting when the workflow should only execute a single time for each record
5. **Test with a single contact** — Before activating a workflow, run it manually on one test contact and check the execution log for repeated firings

***

## FAQs

<AccordionGroup>
  <Accordion title="Will I lose data when a workflow is locked out?">
    Actions that already completed before the lockout are not rolled back. However, any queued or in-progress executions at the time of lockout are cancelled. Review the execution log to determine which contacts were affected and take manual action if needed.
  </Accordion>

  <Accordion title="Can I increase the loop detection threshold?">
    No. The threshold is a system-level safeguard and cannot be adjusted per account. If your legitimate use case requires high-frequency workflow execution, restructure the workflow to batch operations or use API-based automation instead.
  </Accordion>

  <Accordion title="How do I know which workflow caused the loop?">
    Check **Automation > Workflows** for the red **Loop Detected** badge. You can also review the **Audit Log** under **Settings** to see all workflow executions in chronological order, which helps trace cross-workflow loops.
  </Accordion>

  <Accordion title="Can I set up an alert before a lockout happens?">
    Hoop does not currently offer pre-lockout warnings. However, you can monitor workflow execution counts in the **Execution History** tab. If you notice a workflow running unusually often, investigate the trigger logic before it reaches the lockout threshold.
  </Accordion>
</AccordionGroup>
