Skip to content

Workflows: add info that in local dev, pause and resume methods are not available - #19988

Closed
bruxodasilva wants to merge 2 commits into
cloudflare:productionfrom
bruxodasilva:dferreira-workflows-localdev-limitations
Closed

Workflows: add info that in local dev, pause and resume methods are not available#19988
bruxodasilva wants to merge 2 commits into
cloudflare:productionfrom
bruxodasilva:dferreira-workflows-localdev-limitations

Conversation

@bruxodasilva

@bruxodasilva bruxodasilva commented Feb 14, 2025

Copy link
Copy Markdown
Contributor

Summary

Add info that for Workflows, in local dev, pause and resume methods are not available

Relates to issue 8128

Closes WOR-506

@irvinebroque irvinebroque left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems much more discoverable here, no?

https://docs.sentry.io/platforms/javascript/guides/cloudflare/

If I call one of these unsupported methods locally, how do I know it's not supposed to work, without reading the docs?


[^2]: Using Vectorize always accesses your Cloudflare account to run queries, and will incur usage charges even in local development.

[^3]: `pause()` and `resume()` are not available in local development.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If they're not in local dev, and Workflows doesn't work in remote dev, that means...you just have to write code ship to prod and trust it will work? Or am I missing something?

@sidharthachatterjee sidharthachatterjee Feb 14, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@irvinebroque No, you're correct. pause and resume are not supported locally. However, writing and running a WorkflowEntrypoint is. wrangler dev on a project that exports a WorkflowEntrypoint works and that's what I would classify as local development to assert if something works before shipping to production.

Pause and resume are unsupported at the moment due to a miniflare limitation (killing the engine DO kills all threads unless I'm mistaken). Pause and resume are also often not in the happy path for p90 Workflows use cases so we are happy with that being a foot note for now until we are unblocked.

@sidharthachatterjee

Copy link
Copy Markdown
Contributor

Seems much more discoverable here, no?

https://docs.sentry.io/platforms/javascript/guides/cloudflare/

If I call one of these unsupported methods locally, how do I know it's not supposed to work, without reading the docs?

Guessing link is incorrect. Using them locally throws an Error documenting that they are unsupported at the moment.

@ToriLindsay
ToriLindsay requested a review from Oxyjun March 17, 2025 14:31
@ToriLindsay ToriLindsay assigned Oxyjun and unassigned ToriLindsay Mar 17, 2025
@ToriLindsay
ToriLindsay removed the request for review from Oxyjun March 17, 2025 14:42
@hyperlint-ai-deprecated

Copy link
Copy Markdown
Contributor

Howdy and thanks for contributing to our repo. The Cloudflare team reviews new, external PRs within two (2) weeks. If it's been two weeks or longer without any movement, please tag the PR Assignees in a comment.

We review internal PRs within 1 week. If it's something urgent or has been sitting without a comment, start a thread in the Developer Docs space internally.


PR Change Summary

Updated local development documentation for Workflows to clarify the unavailability of pause and resume methods.

  • Added information that pause() and resume() methods are not available in local development for Workflows.
  • Updated the documentation to reflect changes in the support status of Workflows.

Modified Files

  • src/content/docs/workers/local-development.mdx

How can I customize these reviews?

Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.

@kodster28

Copy link
Copy Markdown
Collaborator

This has conflicts, so closing out.

Feel free to re-open as a new PR if still required.

@kodster28 kodster28 closed this Dec 12, 2025
auto-merge was automatically disabled December 12, 2025 16:23

Pull request was closed

ask-bonk Bot pushed a commit that referenced this pull request Feb 5, 2026
… code examples

Address the inconsistency where MySQL examples included ctx.waitUntil(connection.end())
but all PostgreSQL examples (node-postgres, postgres.js, Drizzle, Prisma, Timescale tutorial)
omitted client cleanup entirely. This adds:

- ctx.waitUntil(client.end()) to all PostgreSQL code examples
- ctx.waitUntil(connection.end()) to MySQL Drizzle ORM example
- ctx.waitUntil(prisma.$disconnect()) to Prisma ORM example
- A new 'Cleaning up client connections' section in connection-lifecycle.mdx
  explaining the best practice and clarifying that .end() only closes the
  local client, not the Hyperdrive-managed pool connection
- Consistent comments across all examples explaining that Hyperdrive keeps
  the underlying database connection open in its pool for reuse
- Updated step-by-step explanations in get-started.mdx for both PG and MySQL

Also fixes pre-existing bugs:
- Missing 'return' in node-postgres partial catch block
- Missing error response in mysql2 partial catch block
- Changed mysql2 Drizzle ORM import from 'mysql2' to 'mysql2/promise' for
  correct Promise-based .end() behavior

Closes #19988
elithrar added a commit that referenced this pull request Feb 6, 2026
* Add connection cleanup (ctx.waitUntil client.end()) to all Hyperdrive code examples

Address the inconsistency where MySQL examples included ctx.waitUntil(connection.end())
but all PostgreSQL examples (node-postgres, postgres.js, Drizzle, Prisma, Timescale tutorial)
omitted client cleanup entirely. This adds:

- ctx.waitUntil(client.end()) to all PostgreSQL code examples
- ctx.waitUntil(connection.end()) to MySQL Drizzle ORM example
- ctx.waitUntil(prisma.$disconnect()) to Prisma ORM example
- A new 'Cleaning up client connections' section in connection-lifecycle.mdx
  explaining the best practice and clarifying that .end() only closes the
  local client, not the Hyperdrive-managed pool connection
- Consistent comments across all examples explaining that Hyperdrive keeps
  the underlying database connection open in its pool for reuse
- Updated step-by-step explanations in get-started.mdx for both PG and MySQL

Also fixes pre-existing bugs:
- Missing 'return' in node-postgres partial catch block
- Missing error response in mysql2 partial catch block
- Changed mysql2 Drizzle ORM import from 'mysql2' to 'mysql2/promise' for
  correct Promise-based .end() behavior

Closes #19988

* Fix post-merge issues: wrong variable name in Drizzle Postgres example and missing cleanup in index.mdx PostgreSQL example

---------

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: Matt Silverlock <msilverlock@cloudflare.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:workers Related to Workers product size/xs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants