Symptom
WorkflowAgent.stream() fails before the first model call when a message contains a URL file or image part. The line is AI_DownloadError: Failed to download https://…/image.png: Error: Global "fetch" is unavailable in workflow functions.
Evidence what you'll see
- The stack names
downloadAssetsthenconvertToLanguageModelPromptthenWorkflowAgent.stream. - A user message with an image attachment ended the agent run before the model was called, on every such turn, until a no-op
experimental_downloadwas passed. - Reported on
@ai-sdk/workflow@2.0.68,ai@7.0.136,workflow@5.2.0.
Why it happens
Workflow-side prompt conversion declared supportedUrls: {}, so every URL was planned for download, then used the default downloader that calls globalThis.fetch. Workflow functions cannot use that fetch. Pull request 22462 keeps URLs through an unconditional no-op on the workflow side and does model-aware conversion inside the durable step.
Affected versions
@ai-sdk/workflow@2.0.68, ai@7.0.136, workflow@5.2.0. The linked issue does not name an operating system.
Fix steps
0 of 2 done
Your check marks stay in this browser only.
How to check it worked
WorkflowAgent.stream()with a URL-backed image part reaches the model call and does not printGlobal "fetch" is unavailable in workflow functions.
If it still fails
- The linked issue does not describe
AI_DownloadErroronai@7.0.143. - A custom
experimental_downloadstill runs in the durable step when conversion needs a download.
Sources and credit
Summarized in our own words from these public reports. Credit goes to their authors.
Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change
Hit an error we don't cover? Submit it