@ai-sdk/workflow@2.0.71 Changes URL Input Handling in Workflow Functions
The latest patch for @ai-sdk/workflow changes how URL-backed image and file inputs are processed, shifting download responsibility from the workflow context to model steps for improved reliability.
What changed?
@ai-sdk/workflow version 2.0.71 now passes URL-backed image and file inputs through workflow functions before they reach model steps. Previously, these inputs were downloaded in the workflow context, but this is no longer possible because 'fetch' is unavailable in that context. Now, the model step downloads unsupported URLs using the resolved model's supportedUrls for both stream() and generate() operations. Additionally, the experimental_download function has moved to the model step and must be marked with 'use step' to be utilized within steps.
Why does it matter to an everyday developer?
Developers who rely on workflows with image or file inputs provided as URLs are now required to handle downloading these inputs within model steps rather than in the workflow context. This change ensures that downloads are handled where network access is available, increasing reliability. Developers can also make use of the new experimental_download function directly in their model steps for custom download behavior.
What can the developer do now?
- Update your workflow logic to avoid downloading files or images in the workflow context.
- Ensure that model steps are configured to process URL-backed inputs using the model's supportedUrls feature.
- Leverage the experimental_download function inside your model steps, marking it with 'use step' for proper behavior.
