cloudflare / cloudflare/workerd
Workflows: Add a way to test workflow hibernation
- Dominant language
- C++
- Stars
- 8.7k
- Forks
- 739
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 174
Description
When writing libraries or code to work with Cloudflare Workflows, we have to consider the fact that the state may be lost due to hibernation.
However, there is currently no (reasonable) way to test that our libraries or code do not violate the workflow rules and are not impacted by hibernation.
We could:
```ts
await step.sleep("Hopefully this hibernates", "1 hour");
```
But this is not really viable for tests!
How about something like this that only works with wrangler?
```ts
await step.hibernate();
```
Contributor guide
Research direction
Start by locating the Cloudflare Workflows step API around step.sleep and the Wrangler-only execution path mentioned in the issue. Define the behavior and tests for triggering hibernation without waiting an hour, and consider the work complete when a test can verify code remains valid across that transition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100