Skip to content

Commit 3f5f38f

Browse files
committed
fix(api): keep rerunFromBlockId out of the resume response's error schema
1 parent de42e7a commit 3f5f38f

3 files changed

Lines changed: 59 additions & 23 deletions

File tree

‎apps/docs/openapi-v2-workflows.json‎

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17195,7 +17195,7 @@
1719517195
"type": "string"
1719617196
},
1719717197
"rerunFromBlockId": {
17198-
"description": "Block a rerun of this failure starts from (`run.entry` of type `block` naming it, with this run as `sourceRunId`): the failing block, or the outermost loop or parallel holding it, since a run cannot start inside one. Set by Execute workflow from the graph the run executed and by Get workflow run from the saved draft; absent elsewhere, whenever `blockId` is, and when that graph no longer has the block.",
17198+
"description": "Block a rerun of this failure starts from (`run.entry` of type `block` naming it, with this run as `sourceRunId`): the failing block, or the outermost loop or parallel holding it, since a run cannot start inside one. Set by Execute workflow from the graph the run executed and by Get workflow run from the saved draft, whenever `blockId` is and that graph still has the block.",
1719917199
"type": "string"
1720017200
}
1720117201
},
@@ -18514,7 +18514,40 @@
1851418514
"error": {
1851518515
"anyOf": [
1851618516
{
18517-
"$ref": "#/components/schemas/ExecutionError"
18517+
"type": "object",
18518+
"properties": {
18519+
"message": {
18520+
"type": "string",
18521+
"description": "Human-readable workflow execution failure message."
18522+
},
18523+
"code": {
18524+
"type": "string",
18525+
"enum": [
18526+
"TIMEOUT",
18527+
"CANCELLED",
18528+
"USAGE_LIMIT_EXCEEDED",
18529+
"INVALID_INPUT",
18530+
"BLOCK_EXECUTION_FAILED",
18531+
"CHILD_WORKFLOW_FAILED",
18532+
"EXECUTION_FAILED"
18533+
],
18534+
"description": "Stable machine-readable execution failure code. `BLOCK_EXECUTION_FAILED` and `CHILD_WORKFLOW_FAILED` are reported only where block attribution is available; elsewhere a block-level failure is reported as `EXECUTION_FAILED`."
18535+
},
18536+
"blockId": {
18537+
"description": "Identifier of the failing block, when attributable. Get workflow run reads it from the run trace, so it is absent there when the trace is unavailable or hidden by organization permission groups, when no failed block in the trace recorded the run error, and for a timeout, cancellation, usage-limit, or invalid-input failure.",
18538+
"type": "string"
18539+
},
18540+
"blockName": {
18541+
"description": "Display name of the failing block, when attributable. Present whenever `blockId` is.",
18542+
"type": "string"
18543+
},
18544+
"blockType": {
18545+
"description": "Integration or block type that failed, when attributable. Present whenever `blockId` is.",
18546+
"type": "string"
18547+
}
18548+
},
18549+
"required": ["message", "code"],
18550+
"additionalProperties": false
1851818551
},
1851918552
{
1852018553
"type": "null"

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,7 @@ export const v2ExecutionErrorSchema = z
16121612
.string()
16131613
.optional()
16141614
.describe(
1615-
'Block a rerun of this failure starts from (`run.entry` of type `block` naming it, with this run as `sourceRunId`): the failing block, or the outermost loop or parallel holding it, since a run cannot start inside one. Set by Execute workflow from the graph the run executed and by Get workflow run from the saved draft; absent elsewhere, whenever `blockId` is, and when that graph no longer has the block.'
1615+
'Block a rerun of this failure starts from (`run.entry` of type `block` naming it, with this run as `sourceRunId`): the failing block, or the outermost loop or parallel holding it, since a run cannot start inside one. Set by Execute workflow from the graph the run executed and by Get workflow run from the saved draft, whenever `blockId` is and that graph still has the block.'
16161616
),
16171617
})
16181618
.meta({
@@ -2091,6 +2091,12 @@ export type V2ResumeWorkflowQueued = z.output<typeof v2ResumeWorkflowQueuedSchem
20912091

20922092
export const v2ResumeWorkflowDataSchema = v2ExecuteWorkflowDataSchema
20932093
.omit({ executionTimeoutSeconds: true })
2094+
.extend({
2095+
error: v2ExecutionErrorSchema
2096+
.omit({ rerunFromBlockId: true })
2097+
.nullable()
2098+
.describe('Structured execution failure, or null when none occurred.'),
2099+
})
20942100
.meta({
20952101
id: 'WorkflowResumeResult',
20962102
title: 'Workflow resume result',

‎packages/sim-cli/src/generated/v2-api.ts‎

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17801,28 +17801,25 @@ export type ResumeWorkflowBody = {
1780117801
}
1780217802

1780317803
type ResumeWorkflowResponseRef0 = {
17804-
message: string
17805-
code:
17806-
| 'TIMEOUT'
17807-
| 'CANCELLED'
17808-
| 'USAGE_LIMIT_EXCEEDED'
17809-
| 'INVALID_INPUT'
17810-
| 'BLOCK_EXECUTION_FAILED'
17811-
| 'CHILD_WORKFLOW_FAILED'
17812-
| 'EXECUTION_FAILED'
17813-
blockId?: string
17814-
blockName?: string
17815-
blockType?: string
17816-
rerunFromBlockId?: string
17817-
}
17818-
17819-
type ResumeWorkflowResponseRef1 = {
1782017804
runId: string
1782117805
workflowId: string
1782217806
status: 'completed' | 'failed' | 'paused' | 'cancelled'
1782317807
output: unknown
1782417808
blockOutputs: Record<string, unknown> | null
17825-
error: ResumeWorkflowResponseRef0 | null
17809+
error: {
17810+
message: string
17811+
code:
17812+
| 'TIMEOUT'
17813+
| 'CANCELLED'
17814+
| 'USAGE_LIMIT_EXCEEDED'
17815+
| 'INVALID_INPUT'
17816+
| 'BLOCK_EXECUTION_FAILED'
17817+
| 'CHILD_WORKFLOW_FAILED'
17818+
| 'EXECUTION_FAILED'
17819+
blockId?: string
17820+
blockName?: string
17821+
blockType?: string
17822+
} | null
1782617823
startedAt?: string
1782717824
endedAt?: string
1782817825
durationMs?: number
@@ -17836,18 +17833,18 @@ type ResumeWorkflowResponseRef1 = {
1783617833
} | null
1783717834
}
1783817835

17839-
type ResumeWorkflowResponseRef2 = {
17836+
type ResumeWorkflowResponseRef1 = {
1784017837
runId: string
1784117838
statusUrl: string
1784217839
queuePosition?: number
1784317840
}
1784417841

1784517842
export type ResumeWorkflowResponse =
1784617843
| {
17847-
data: ResumeWorkflowResponseRef1
17844+
data: ResumeWorkflowResponseRef0
1784817845
}
1784917846
| {
17850-
data: ResumeWorkflowResponseRef2
17847+
data: ResumeWorkflowResponseRef1
1785117848
}
1785217849

1785317850
/** `POST /api/v2/files/[fileId]/versions/[version]/revert` */

0 commit comments

Comments
 (0)