Workflows: Enhanced step context and ReadableStream support
Key Points
- Step context now includes step name, invocation count, and resolved configuration
- ReadableStream support enables handling of large payloads beyond 1 MiB limit
- Enhanced loop support with step.count tracking for repeated step invocations
Summary
Cloudflare Workflows now provides additional context information in step.do() callbacks and supports returning ReadableStream for handling larger step outputs, enabling more flexible workflow implementations.
Key Points
-
Enhanced step context: step.do() callbacks now receive expanded context objects including:
step.name— The name passed to step.do()step.count— Invocation count for steps with the same name (1-indexed), useful for loopsconfig— Resolved step configuration with timeout and retries including defaults
-
ReadableStream support: Steps can now return ReadableStream directly for larger payloads
- Non-stream outputs remain limited to 1 MiB
- Streamed outputs support significantly larger data transfers
- Streamed outputs still count toward Workflow instance storage limits
-
Use case: Fetch and return large files directly from storage buckets without size constraints on individual steps