Automations
Loop Protection

Loop Protection

Because automation actions can trigger other actions (for example, applying a tag fires a tag-applied trigger, which can add a second tag), it is possible to accidentally build infinite automation loops.

Gordon CRM includes built-in safety mechanisms to protect system performance and prevent runaway chains.


The Circular Loop Hazard

Consider this scenario:

  • Rule A: When tag Lead is applied → Add tag Prospect.
  • Rule B: When tag Prospect is applied → Add tag Lead.

Without safety controls, this would create an infinite cycle, applying tags back and forth forever and crashing the application. To prevent this, Gordon CRM employs two protection strategies.


Strategy 1: The Depth Limiter

The automation engine tracks the "depth" of cascades. Every time an action triggers another rule, the depth increases:

Trigger fires (Depth: 0)
  → Action: Add Tag A
    → Cascade 1: Tag A applied (Depth: 1)
      → Action: Add Tag B
        → Cascade 2: Tag B applied (Depth: 2)
          → Action: Add Tag C
            → Cascade 3: Tag C applied (Depth: 3)
              → Action: Add Tag D (ABORT)

The system limit is 3 cascades. If a chain goes deeper than 3 steps, the system automatically aborts the sequence to protect workspace performance.

Depth-Limit Notifications

If a chain is stopped, the system generates an alert in your Notification Center:

Automation chain depth limit reached The automation engine stopped after 4 chain steps to prevent an infinite loop. Trigger: tag applied "Prospect". Blocked automation: "When tag Prospect added → Add tag Lead".

How to Resolve Circular Loops

If you receive a depth-limit notification:

  1. Click the View Automations link inside the notification.
  2. Search for tag-based rules that trigger each other (e.g., Tag A triggers Tag B, and Tag B triggers Tag A).
  3. Deactivate or delete one of the conflicting rules.
  4. Navigate to your Tags list and click the badge to view your Dependency Tracking connections.

Strategy 2: Idempotency Controls

The system's second line of defense is built into the actions themselves:

  • Adding Tags: If you apply a tag that a contact already has, the action is marked as a no-op. Because the contact's tag list didn't change, the system does not fire a cascading trigger.
  • Removing Tags: Similarly, removing a tag that isn't present does not fire a tag-removed trigger.

In practice, idempotency catches most simple circular loops immediately (at depth 2), while the depth limiter acts as a safety net for longer or complex chains.


Loop Protection Scenarios

ScenarioSystem Behavior
A → B → A (Circular Loop)Stopped immediately at Step 2 by idempotency (Tag A is already present).
A → B → C → D → E (Long Chain)Stopped at Step 4 by the Depth Limiter (depth exceeds 3).
A → A (Self-Referencing)Stopped at Step 1 by idempotency (Tag A is already present).

Best Practices

  1. Keep chains short: Aim to resolve your workflows within 1–2 cascade levels.
  2. Avoid circular rules: Never set up Tag A to apply Tag B if Tag B is configured to apply Tag A.
  3. Review notifications: Treat depth-limit notifications as critical warnings that your rules need structural adjustments.

Related