# Workflows step.do() levels up: richer step context and ReadableStream support!

Hey there, it's me, Shiichan! Today I've got a nice little update: [Workflows](https://developers.cloudflare.com/workflows/) just made `step.do()` a bit more convenient.

## What was announced?

Over on the Cloudflare Changelog, [Workflows](https://developers.cloudflare.com/workflows/) added two features to `step.do()`. One is **more context information** you can read inside the step callback, and the other is that a step can now **return a `ReadableStream`**.

## The story so far

Up to now, the `step.do()` callback already let you [read](https://developers.cloudflare.com/changelog/post/2026-03-06-step-context-available/) `attempt` (which retry you're on), but you couldn't see the step's name, how many times it had run, or what its config actually was. On top of that, a step's return value had a size limit, which made handling large data a little awkward.

## What changes

From now on, a step can clearly know "what kind of step am I?" That makes it easy to tell which iteration you're on when you run the same step in a loop, and to check the timeout and retry settings that are really in effect. And since you can return large outputs as a stream, the range of data you can handle grows a lot.

## Dive Deep

Here are the three newly added context properties.

- `step.name`: the step name you passed to `step.do()`
- `step.count`: how many times a step with that name has been invoked in this instance (1-indexed). Handy in loops
- `config`: the resolved step configuration for `timeout` and `retries`, with defaults applied

As for `ReadableStream`, a step can now return a stream directly. Regular step outputs are [limited to 1 MiB](https://developers.cloudflare.com/workflows/reference/limits/), but streamed outputs can carry much larger payloads. For example, you might grab a large file from R2 and return its `body` as-is.

```ts
const largePayload = await step.do("fetch-large-file", async () => {
  const object = await env.MY_BUCKET.get("large-file.bin");
  return object.body;
});
```

One thing to keep in mind: streamed outputs still count toward your Workflow instance storage limit, so don't forget that.

## Wrap-up

- Cloudflare's Workflows `step.do()` gained additional step context and `ReadableStream` support
- The context now includes `step.name`, `step.count`, and `config`, making loops and config checks easier
- Returning a `ReadableStream` from a step lets you handle outputs bigger than 1 MiB (but they still count toward the storage limit)

This update is for folks building complex multi-step processes on Workflows, or anyone who needs to move large data between steps!
