Conflicts

A Conflict is a scheduling violation detected by the Clockwork engine. Conflicts are created automatically — you never create them manually. They surface when a deadline would be missed, two tasks contend for the same resource, or travel time between locations is insufficient.

When to use client.conflicts

  • Building an operations dashboard that highlights at-risk workflows
  • Automating remediation — e.g., auto-delay a task when a conflict is detected
  • Snoozing non-critical conflicts to reduce noise
  • Integrating with alerting systems via the conflict_detected webhook event

Methods

MethodDescription
list(opts?)List conflicts (optionally filter by resolved status)
get(conflictId)Fetch a single conflict
resolve(conflictId)Mark as manually resolved
snooze(conflictId, input)Snooze until a future time

conflicts.list(opts?)

typescript
// All unresolved conflicts
const { data: conflicts } = await client.conflicts.list({ resolved: false })
 
for (const conflict of conflicts) {
  console.log(conflict.type, conflict.description, conflict.slackViolationSec)
}

Filter options

OptionTypeDescription
projectIdstringFilter to a specific project
resolvedbooleanfalse = unresolved only (default), true = resolved only

conflicts.resolve(conflictId)

typescript
await client.conflicts.resolve('con_abc123')

conflicts.snooze(conflictId, input)

Silences the conflict until the given time. Useful when you know a situation will resolve itself.

typescript
await client.conflicts.snooze('con_abc123', {
  until: '2026-07-01T09:00:00Z',
})

Conflict types

TypeCause
deadline_violatedA task cannot complete before its deadline given current scheduling
resource_contentionTwo tasks are assigned to the same resource at the same time
travel_time_violatedConsecutive tasks require more travel time than is available between them

Responding to conflicts programmatically

typescript
const { data: conflicts } = await client.conflicts.list({ resolved: false })
 
for (const conflict of conflicts) {
  if (conflict.type === 'resource_contention') {
    // Delay one of the conflicting tasks
    await client.tasks.delay(conflict.taskId, { delayMinutes: 60 })
    await client.conflicts.resolve(conflict.id)
  }
 
  if (conflict.type === 'deadline_violated') {
    // Escalate
    await notifyManager({ conflictId: conflict.id, taskId: conflict.taskId })
  }
}

Type reference

typescript
type ConflictType = 'deadline_violated' | 'resource_contention' | 'travel_time_violated'
 
interface Conflict {
  id: string
  taskId: string
  type: ConflictType
  description: string
  affectedActorId: string | null
  slackViolationSec: number
  resolvedAt: string | null
  snoozedUntil: string | null
  notificationSent: boolean
  createdAt: string
}
  • Constraints — attach rules that generate conflicts when violated
  • Opportunities — positive scheduling signals (the complement of conflicts)
  • Events — subscribe to conflict_detected webhook events