From 9c24cdeab9f1d970e7e3e7c07b333c38d89a0a21 Mon Sep 17 00:00:00 2001 From: Sanduni Pavithra Date: Fri, 4 Dec 2026 17:29:06 +0530 Subject: [PATCH] docs(platform): state the loop reply rule on dispatchFlowID A step that runs again in a loop must reply on the other side's token: a second dispatch names the flow already started, which keeps the first token, so the step would never complete. --- platform/tasktypes/external_review.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/tasktypes/external_review.go b/platform/tasktypes/external_review.go index 249a027..401f912 100644 --- a/platform/tasktypes/external_review.go +++ b/platform/tasktypes/external_review.go @@ -249,8 +249,10 @@ const flowIDSep = "-" // dispatchFlowID is the ID of the flow taskID starts on the other side to run // workflowID: one per task and workflow, so a task can start several of the other // side's workflows, and a retried dispatch names the same flow. A step that runs again -// replies on the other side's token: a second dispatch of the same workflow from the -// same task names the flow already started. +// in a loop must reply on the other side's token rather than dispatch again: it has a +// new callbackToken, but a second dispatch of the same workflow from the same task +// names the flow already started, which the other side returns still holding the first +// token, so its decision would get 409 and the step would never complete. func dispatchFlowID(taskID, workflowID string) string { return taskID + flowIDSep + workflowID }