Add bounded Stage PREPARE workflow with transactional leased outbox

This commit is contained in:
devops committed 2026-10-23 12:53:06 +00:00
1 parent 4b17a6fcc3
commit 09e8a890e0
9 files changed
+1150 -17

No files matched your search

+17
View File
@@ -1232,3 +1232,20 @@ model OrchestrationKillSwitch {
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz()
@@map("orchestration_kill_switches")
}
// Transactional dispatch intent. Lease tokens are server-only fencing credentials.
model PrepareWorkflowOutbox {
id String @id @default(uuid()) @db.Uuid
taskId String @unique @map("task_id") @db.Uuid
status String @default("PENDING") @db.VarChar(20)
attempts Int @default(0)
leaseOwner String? @map("lease_owner") @db.VarChar(100)
leaseToken String? @map("lease_token") @db.Uuid
leaseUntil DateTime? @map("lease_until") @db.Timestamptz()
heartbeatAt DateTime? @map("heartbeat_at") @db.Timestamptz()
runId String? @map("run_id") @db.Uuid
reservationId String? @map("reservation_id") @db.Uuid
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz()
@@index([status, leaseUntil])
@@map("prepare_workflow_outbox")
}