{"record":{"id":"2b649d209a1daf8b","repo":"anomalyco/sst","slug":"failed-to-describe-workflow","errorCode":null,"errorMessage":"Failed to describe workflow","messagePattern":"Failed to describe workflow","errorType":"error_code","errorClass":"DescribeError","httpStatus":null,"severity":"error","filePath":"sdk/js/src/aws/workflow.ts","lineNumber":350,"sourceCode":"    };\n  }\n\n  /**\n   * Get the details for a single workflow execution.\n   */\n  export async function describe(\n    arn: string,\n    options?: Options,\n  ): Promise<DescribeResponse> {\n    const response = await awsFetch(\n      \"lambda\",\n      `/2025-12-01/durable-executions/${encodeURIComponent(arn)}`,\n      {\n        method: \"GET\",\n      },\n      options,\n    );\n    if (!response.ok) throw new DescribeError(response);\n\n    const data = (await response.json()) as Partial<DescribeInvocationResponse>;\n\n    if (\n      !data.DurableExecutionArn ||\n      !data.DurableExecutionName ||\n      !data.FunctionArn ||\n      data.StartTimestamp === undefined ||\n      data.Status === undefined\n    ) {\n      throw new DescribeError(response);\n    }\n\n    const execution = parseExecution(data as DescribeInvocationResponse);\n    return {\n      ...execution,\n      version: data.Version,\n    };","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/sdk/js/src/aws/workflow.ts#L332-L368","documentation":"Thrown by the public `describe` function when the GET request to `/2025-12-01/durable-executions/{arn}` returns a non-OK HTTP status, or when the response body is missing required fields (DurableExecutionArn, DurableExecutionName, FunctionArn, StartTimestamp, Status). It wraps the raw Response so you can inspect status code and body. The library throws it because it cannot return a valid DescribeResponse from an error response or a malformed payload.","triggerScenarios":"Calling `Workflow.describe(arn)` where: (1) the ARN does not exist (404, e.g. typo or wrong region/execution already deleted); (2) credentials lack `lambda:GetDurableExecution` (403); (3) throttling or transient 5xx from Lambda; (4) the API returns 200 but a body missing one of the required fields.","commonSituations":"Describing an execution whose retention expired so it was deleted; using an ARN from another region or account; assuming a role without the durable-executions describe permission; querying immediately after a deploy changed the function; typos when copying an ARN from logs.","solutions":["Check the HTTP status on the thrown error (it wraps the Response) — 404 means the ARN does not exist; verify the ARN and region.","Confirm IAM credentials include lambda:GetDurableExecution for the target function/execution.","Retry on 429/5xx with exponential backoff (or pass retry options via the Options parameter).","If status is 200 but fields are missing, upgrade the SDK — the API response shape likely changed (e.g. newer API version than this SDK's 2025-12-01 path)."],"exampleFix":"// before\nconst wf = await describe(arnFromLog); // throws DescribeError 404\n// after\nconst arn = arnFromLog.trim();\nconst wf = await describe(arn, { region: \"us-east-1\" }).catch((err) => {\n  if (err instanceof DescribeError && err.response.status === 404) return null;\n  throw err;\n});\nif (!wf) console.warn(\"execution not found:\", arn);","handlingStrategy":"try-catch","validationCode":"import { Arn } from \"@aws-sdk/util-arn-parser\";\nfunction isDurableExecutionArn(arn: string): boolean {\n  try {\n    const p = Arn.parse(arn);\n    return p.service === \"lambda\" && arn.includes(\"durable-executions\") || /^arn:aws[a-z-]*:lambda:/.test(arn);\n  } catch { return false; }\n}\nif (!isDurableExecutionArn(arn)) throw new Error(`invalid execution ARN: ${arn}`);","typeGuard":"function isDescribeError(err: unknown): err is DescribeError {\n  return err instanceof DescribeError && typeof err.response?.status === \"number\";\n}","tryCatchPattern":"try {\n  const wf = await describe(arn);\n} catch (err) {\n  if (err instanceof DescribeError) {\n    if (err.response.status === 404) return null; // not found\n    if (err.response.status === 403) throw new Error(\"missing lambda:GetDurableExecution permission\");\n    if (err.response.status === 429 || err.response.status >= 500) return retryWithBackoff(() => describe(arn));\n  }\n  throw err;\n}","preventionTips":["Validate the ARN format and region before calling describe.","Grant lambda:GetDurableExecution to the calling principal (or role assumption chain).","Configure retry options for 429/5xx instead of failing fast on transient errors.","Remember executions are deleted after retention expires — don't describe very old ARNs from logs."],"tags":["aws","http","lambda","durable-executions","describe"],"backgroundTag":"aws-api-error-response","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}