Skip to main content
Advanced reference for how Overcut manages multiple triggers, prevents conflicts, and handles complex execution scenarios.
For basic trigger setup, see Triggers and Workflow Execution Control.

Multiple Trigger Behavior

Mention Triggers

Any @overcut mention triggers ALL workflows with mention trigger type.

Slash Commands

Each slash command triggers only its specific workflow and can terminate active agent steps.

Sequential Execution

All workflows for the same PR/issue run one at a time, ordered by priority.

Event Merging

Multiple triggers of the same queued workflow merge into a single execution.

Key Concepts

Trigger Specificity

  • Mention (@overcut): Triggers ALL mention workflows regardless of text after mention
  • Slash Command (/review): Triggers only the specific workflow registered for that command
  • Event Triggers: Each workflow has one primary trigger type (e.g., pull_request_opened)

Slash Command Termination

Slash commands have special power to interrupt active work:
1

Graceful Termination

Active agent steps (both agent.run and agent.session) receive termination signal
2

Grace Period

Agents get 5 minutes to complete current operation before stopping
3

Session Cleanup

Active sessions are cleared immediately and stop receiving new comments
4

New Workflow

Slash command workflow queues or starts normally
Example:
User: "@overcut help with this bug"  → Session starts
User: "Can you explain line 45?"     → Routes to session
User: "/review"                      → Terminates session, starts review

Parallel Execution & Locking

Resource-Based Locking

Overcut ensures workflows don’t conflict by locking execution per resource:

Sequential per Resource

Only one workflow runs per issue/PR at a time to prevent conflicts

Parallel Across Resources

Different issues/PRs can run workflows simultaneously

How Locking Works

Same Resource = Sequential Execution:
# All workflows for PR #123 run one at a time
PR #123 opened     → Starts immediately
Comment on PR #123 → Queued (waits for first to finish)
Label on PR #123   → Queued (waits in line)
Review on PR #123  → Queued (waits in line)
Different Resources = Parallel Execution:
# These run simultaneously
PR #123 workflow   ✅ Running
Issue #456 workflow ✅ Running  
PR #789 workflow   ✅ Running

Queue Management & Deduplication

Intelligent Event Merging

When the same workflow is triggered multiple times while queued, events automatically merge to prevent redundant executions:
1

Duplicate Detection

System checks if the same workflow is already queued for the same lock key
2

Event Merging

New trigger merges with existing queued workflow instead of creating duplicate

Priority-Based Processing

Queued workflows are processed by priority, then first-in-first-out:
PriorityDescriptionProcessing Order
1 (High)Critical workflowsProcessed first
5 (Default)Standard workflowsDefault priority
10 (Low)Background tasksProcessed last

Automatic Deduplication

When the same workflow is triggered multiple times while queued, events automatically merge:
# Example: Auto-triage workflow with issue_labeled trigger
10:01 - Label "bug" added     → Execution starts (running)
10:02 - Label "critical" added → Queued (first still running)  
10:03 - Label "security" added → Merged with queued execution
10:05 - First completes       → Queued execution runs with all labels

Advanced Queue Features

Delayed Execution

Workflows can be configured with delays to batch rapid events:
name: "Batch Comment Analysis"
trigger:
  type: "issue_commented"
  settings:
    delaySeconds: 30  # Wait 30 seconds before processing

steps:
  - name: "analyze-comments"
    type: "agent"
    instruction: "Analyze recent comment activity"
Benefits:
  • Batches rapid-fire events (multiple comments, labels)
  • Reduces redundant executions
  • Allows time for related events to merge

Priority Configuration

Control execution order with priority settings (1-100 scale):
PriorityUse CaseExample
1-3Critical workflowsSecurity scans, incident response
4-6Normal workflowsCode reviews, standard automation
7-100Background tasksDocumentation, metrics collection
name: "Security Scan"
priority: 1  # Runs first
trigger:
  type: "pull_request_opened"

Multiple Mention Workflows

If you have multiple workflows with mention trigger, all will be triggered by any @overcut mention:
# Both triggered by "@overcut help me"
- name: "Quick Help" (priority: 5)
- name: "Full Analysis" (priority: 8)
Solution: Use slash commands for specificity:
  • /help → triggers only Quick Help
  • /analyze → triggers only Full Analysis

Event Sequence Example

10:01 - PR opened           → "Initial Review" starts (priority: 5)
10:02 - Label "security"    → "Security Scan" queued (priority: 1)  
10:03 - Comment "@overcut"  → "Help" queued (priority: 5)
10:05 - Initial Review done → Security Scan starts (highest priority)
10:07 - Security Scan done  → Help starts

Best Practices

Use Priorities Wisely

Reserve 1-3 for critical workflows, use default (5) for most cases.

Design for Interruption

Expect users to use slash commands to change direction mid-workflow.

Leverage Merging

Trust automatic event merging to reduce redundant executions.

Choose Right Triggers

Use slash commands for specific actions, mentions for general help.

FAQ

Yes! Sequential execution only applies to the same PR or issue. Different resources can have workflows running simultaneously.
Only when a workflow is queued (waiting to run), not while it’s running. If workflow A is running and triggered twice more, the second trigger queues and the third merges with it.
You can terminate agent steps using either comments or UI controls:Via Comments:
  • /done: Completes the current agent session step and continues to the next workflow step
  • /quit: Terminates the entire workflow immediately
Via UI (Execution Logs):
  • Complete Step button: Requests the agent to complete and return results ASAP
  • Quit Workflow button: Terminates all running steps and marks the workflow as canceled
Comment commands are processed immediately before the agent receives them, while UI buttons send termination requests to the running agent.
  • Mentions (@overcut): Trigger all mention workflows, route to active sessions
  • Slash commands (/review): Trigger specific workflow, terminate active agent steps