{"record":{"id":"2f52c7b7ae6b1988","repo":"Budibase/budibase","slug":"unable-to-collect-response","errorCode":null,"errorMessage":"Unable to collect response","messagePattern":"Unable to collect response","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/server/src/sdk/workspace/automations/execution.ts","lineNumber":40,"sourceCode":"  if (triggerType !== \"APP\") {\n    throw new Error(\n      `Cannot manually trigger automation '${automation.name}'. Only automations with APP trigger type can be manually triggered. This automation has trigger type: ${triggerType}`\n    )\n  }\n\n  let hasCollectStep = sdk.automations.utils.checkForCollectStep(automation)\n  if (hasCollectStep && (await features.isSyncAutomationsEnabled())) {\n    const response = await triggers.externalTrigger(\n      automation,\n      {\n        fields,\n        timeout: timeout ? timeout * 1000 : env.AUTOMATION_THREAD_TIMEOUT,\n      },\n      { getResponses: true }\n    )\n\n    if (!(\"steps\" in response)) {\n      throw new Error(\"Unable to collect response\")\n    }\n\n    let collectedValue = response.steps.find(\n      step => step.stepId === AutomationActionStepId.COLLECT\n    )\n    return collectedValue?.outputs\n  } else {\n    const appId = context.getWorkspaceId()\n    await triggers.externalTrigger(automation, {\n      fields,\n      appId,\n    })\n\n    return {\n      message: `Automation ${automation._id} has been triggered.`,\n      automation,\n    }\n  }","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/automations/execution.ts#L22-L58","documentation":"Thrown by `trigger` when the internal automation run dispatcher returns a response without a `steps` array, so the COLLECT step's outputs cannot be extracted. This means the run did not return step-level results (e.g. the run errored, timed out, or the dispatcher shape changed) even though `getResponses: true` was requested.","triggerScenarios":"Manual trigger of an automation containing a COLLECT (query) step where the queued run fails before producing steps, the thread times out (AUTOMATION_THREAD_TIMEOUT exceeded), or the dispatcher returns an error object instead of steps.","commonSituations":"The automation's underlying queries fail or hang in the environment; Redis/queue infrastructure is unhealthy so run responses are lost; the timeout (seconds) passed to trigger is too small for long-running COLLECT queries.","solutions":["Check server logs for the underlying automation run failure preceding this error","Increase the timeout argument to trigger (seconds) so long COLLECT steps can finish","Verify Redis and the automation queue infrastructure are healthy","Retry the trigger once infrastructure issues are resolved; investigate the COLLECT step's query target separately"],"exampleFix":"// before\nconst res = await trigger(automationId, { timeout: 2 })\n// after\nconst res = await trigger(automationId, { timeout: 60 }) // allow long COLLECT queries","handlingStrategy":"try-catch","validationCode":"const timeout = 60 // generous default for automations with COLLECT steps","typeGuard":"function hasSteps(r: object): r is { steps: { stepId: string; outputs: unknown }[] } {\n  return \"steps\" in r && Array.isArray((r as any).steps)\n}","tryCatchPattern":"try {\n  const res = await sdk.automations.execution.trigger(id, { timeout })\n} catch (err: any) {\n  if (err.message === \"Unable to collect response\") {\n    // check run logs and retry after fixing infrastructure\n  } else {\n    throw err\n  }\n}","preventionTips":["Use adequate timeouts for COLLECT-heavy automations","Monitor Redis/queue health","Review automation run history for recurring failures"],"tags":["automation","timeout","response-shape"],"backgroundTag":"missing-response-payload","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}