Skip to content

[Workflows] Add step name and config to Workflows step context#13351

Merged
petebacondarwin merged 1 commit intomainfrom
osilva/add-workflows-step-context
Apr 9, 2026
Merged

[Workflows] Add step name and config to Workflows step context#13351
petebacondarwin merged 1 commit intomainfrom
osilva/add-workflows-step-context

Conversation

@pombosilva
Copy link
Copy Markdown
Contributor

@pombosilva pombosilva commented Apr 8, 2026

Fixes WOR-1203.

Adds step.name, step.count and config to step context.


A picture of a cute animal (not mandatory, but encouraged)


Open with Devin

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 8, 2026

🦋 Changeset detected

Latest commit: 8e2cf1e

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Apr 8, 2026
@pombosilva pombosilva marked this pull request as ready for review April 8, 2026 13:20
@workers-devprod workers-devprod requested review from a team and ascorbic and removed request for a team April 8, 2026 13:20
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Apr 8, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/workflows
  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Apr 8, 2026

The changes look clean and correct. Let me verify my understanding:

  1. count comes from this.#getCount("run-" + name) at line 190, which is 1-indexed and increments per unique step name — this is the same counter already used for cacheKey and stepNameWithCounter.

  2. name is the step name string passed to step.do().

  3. config is the fully resolved config (defaults merged with user overrides) computed at lines 180-187.

  4. The WorkflowStepContext type is correctly extended with the new fields.

  5. The new fields are only passed in the main execution path (line 516), which is correct — the forceStepTimeout and replaceResult branches don't invoke the user callback, so they don't need to pass WorkflowStepContext.

  6. Tests cover: basic step name/count, count incrementing for same-named steps, default config in context, and user-overridden config in context.

  7. The changeset is properly marked as minor since this is a new feature (additive, non-breaking).

Everything looks correct. The implementation is straightforward and the tests are thorough.

LGTM

github run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

✅ All changesets look good

Reviewed: .changeset/step-context-parameters.md

The changeset correctly:

  • Uses minor version type for a new feature (adding step and config properties to workflow step context)
  • Provides a clear, meaningful description explaining what properties are added and their structure
  • Contains no prohibited markdown headers (h1/h2/h3)

devin-ai-integration[bot]

This comment was marked as resolved.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 8, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13351

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13351

miniflare

npm i https://pkg.pr.new/miniflare@13351

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13351

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13351

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13351

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13351

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13351

wrangler

npm i https://pkg.pr.new/wrangler@13351

commit: 8e2cf1e

@pombosilva pombosilva force-pushed the osilva/add-workflows-step-context branch from 82ccd4d to dbe6ae9 Compare April 8, 2026 13:27
@pombosilva pombosilva force-pushed the osilva/add-workflows-step-context branch from dbe6ae9 to 1fac66c Compare April 8, 2026 13:33
@pombosilva pombosilva force-pushed the osilva/add-workflows-step-context branch from 1fac66c to e943bb1 Compare April 8, 2026 13:37
Copy link
Copy Markdown
Contributor

@workers-devprod workers-devprod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Apr 8, 2026
@pombosilva pombosilva force-pushed the osilva/add-workflows-step-context branch from e943bb1 to 8e2cf1e Compare April 8, 2026 14:04
@pombosilva pombosilva enabled auto-merge April 8, 2026 14:05
@pombosilva pombosilva added this pull request to the merge queue Apr 8, 2026
@pombosilva pombosilva removed this pull request from the merge queue due to a manual request Apr 8, 2026
@pombosilva pombosilva added this pull request to the merge queue Apr 8, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 8, 2026
@pombosilva pombosilva added this pull request to the merge queue Apr 8, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 8, 2026
@pombosilva pombosilva added this pull request to the merge queue Apr 8, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 8, 2026
@pombosilva pombosilva added this pull request to the merge queue Apr 9, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 9, 2026
@pombosilva pombosilva added this pull request to the merge queue Apr 9, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 9, 2026
@pombosilva pombosilva added this pull request to the merge queue Apr 9, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 9, 2026
@pombosilva pombosilva added this pull request to the merge queue Apr 9, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 9, 2026
@petebacondarwin petebacondarwin added this pull request to the merge queue Apr 9, 2026
@petebacondarwin petebacondarwin removed this pull request from the merge queue due to the queue being cleared Apr 9, 2026
@petebacondarwin petebacondarwin merged commit 3788983 into main Apr 9, 2026
56 of 57 checks passed
@petebacondarwin petebacondarwin deleted the osilva/add-workflows-step-context branch April 9, 2026 14:49
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants