From 937f56a49cbe5ce048d75fd197e00fdd2e3c3ace Mon Sep 17 00:00:00 2001 From: Satya Patel Date: Mon, 20 Apr 2026 08:50:03 -0700 Subject: [PATCH] fix(automations): use _ and epoch ms in deduplicationId MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QStash rejects ":" in deduplicationId ("DeduplicationId cannot contain ':'"). Swap the separator to "_" and drop the ISO8601 string for the epoch ms so the whole key is [a-zA-Z0-9_-], which QStash accepts. Same idempotency semantics — minute-bucket uniqueness per automation. --- apps/api/src/app/api/automations/evaluate/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/app/api/automations/evaluate/route.ts b/apps/api/src/app/api/automations/evaluate/route.ts index 437921c8bd1..f0c8671c087 100644 --- a/apps/api/src/app/api/automations/evaluate/route.ts +++ b/apps/api/src/app/api/automations/evaluate/route.ts @@ -62,7 +62,7 @@ export async function POST(request: Request): Promise { automationId: automation.id, scheduledFor: scheduledFor.toISOString(), }, - deduplicationId: `${automation.id}:${scheduledFor.toISOString()}`, + deduplicationId: `${automation.id}_${scheduledFor.getTime()}`, retries: 2, failureCallback: `${env.NEXT_PUBLIC_API_URL}/api/automations/run-failed`, };