Skip to content

Commit 16ba04d

Browse files
committed
fix(v2): document both provenances of a reported paused run status
1 parent 6931ea6 commit 16ba04d

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

apps/docs/openapi-v2-workflows.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3929,7 +3929,7 @@
39293929
"failed",
39303930
"cancelled"
39313931
],
3932-
"description": "Current or terminal run status. `redacting` is transient, reported while the output of a finished run is being scrubbed. `paused` is reported while the run is waiting at a human-in-the-loop pause point."
3932+
"description": "Current or terminal run status. `redacting` is transient, reported while the output of a finished run is being scrubbed. `paused` covers two states a client may need to tell apart: the run is waiting at a human-in-the-loop pause point, or a resume attempt did not run to completion and the run is waiting to be resumed again (automatically when a retry is scheduled). Read the `paused` object on the single-run response to distinguish them."
39333933
},
39343934
"trigger": {
39353935
"type": "string",
@@ -4070,7 +4070,7 @@
40704070
"cancelled",
40714071
"queued"
40724072
],
4073-
"description": "Current or terminal run status. `redacting` is transient, reported while the output of a finished run is being scrubbed. `paused` is reported while the run is waiting at a human-in-the-loop pause point."
4073+
"description": "Current or terminal run status. `redacting` is transient, reported while the output of a finished run is being scrubbed. `paused` covers two states a client may need to tell apart: the run is waiting at a human-in-the-loop pause point, or a resume attempt did not run to completion and the run is waiting to be resumed again (automatically when a retry is scheduled). Read the `paused` object on the single-run response to distinguish them."
40744074
},
40754075
"trigger": {
40764076
"anyOf": [

apps/sim/lib/api/contracts/v2/workflows.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -983,12 +983,13 @@ export const v2ResumeWorkflowContract = defineRouteContract({
983983
})
984984

985985
const RUN_STATUS_DESCRIPTION =
986-
'Current or terminal run status. `redacting` is transient, reported while the output of a finished run is being scrubbed. `paused` is reported while the run is waiting at a human-in-the-loop pause point.'
986+
'Current or terminal run status. `redacting` is transient, reported while the output of a finished run is being scrubbed. `paused` covers two states a client may need to tell apart: the run is waiting at a human-in-the-loop pause point, or a resume attempt did not run to completion and the run is waiting to be resumed again (automatically when a retry is scheduled). Read the `paused` object on the single-run response to distinguish them.'
987987

988988
/**
989989
* The list projection passes `workflow_execution_logs.status` through except where it
990990
* overlays `paused` for a run holding a `paused` or `partially_resumed` row in
991-
* `paused_executions`. Both branches land in the persisted set, so the reported enum is
991+
* `paused_executions` — so a reported `paused` is either that overlay or the persisted
992+
* value a failed resume attempt left behind. Both branches land in the persisted set, so the reported enum is
992993
* derived from it — a value missing here fails the response parse, and because list
993994
* validation is whole-page one such row turns an entire page into a 500. `queued` is not
994995
* reportable: a run still only in the job queue has no log row to list.

packages/db/schema.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,8 @@ export const workflowExecutionLogs = pgTable(
411411
),
412412

413413
level: text('level').notNull(), // 'info' | 'error'
414-
status: text('status').notNull().default('running'), // see PERSISTED_WORKFLOW_EXECUTION_STATUSES in apps/sim/lib/logs/types.ts
414+
/** See `PERSISTED_WORKFLOW_EXECUTION_STATUSES` in `apps/sim/lib/logs/types.ts`. */
415+
status: text('status').notNull().default('running'),
415416
trigger: text('trigger').notNull(), // 'api' | 'webhook' | 'schedule' | 'manual' | 'chat'
416417

417418
startedAt: timestamp('started_at').notNull(),

0 commit comments

Comments
 (0)