feat(workflows): stamp runs with revision and improve history preview

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-20 22:31:18 +07:00
co-authored by Cursor
parent f68376587e
commit 84f29057df
10 changed files with 521 additions and 63 deletions
+3
View File
@@ -65,6 +65,7 @@ function nowIso() {
* input?: unknown,
* parentRunId?: string | null,
* status?: "queued" | "running",
* workflowRevision?: number | null,
* }} opts
*/
export async function startRun({
@@ -75,6 +76,7 @@ export async function startRun({
input = null,
parentRunId = null,
status = "queued",
workflowRevision = null,
}) {
const id = randomUUID();
const now = nowIso();
@@ -91,6 +93,7 @@ export async function startRun({
queued_at: isQueued ? now : null,
input: serialize(input),
parent_run_id: parentRunId ?? null,
workflow_revision: workflowRevision ?? null,
});
return { id, started_at: now, queued_at: isQueued ? now : null };
}