feat(cloudflare): expand workflows api#611
Open
Gerbuuun wants to merge 5 commits into
Open
Conversation
263413f to
a5ca86d
Compare
sam-goodwin
reviewed
Jun 16, 2026
Comment on lines
+431
to
+432
| * const result = yield* Cloudflare.task({ | ||
| * name: "call-api", |
Contributor
There was a problem hiding this comment.
I think it wouldn't be better if the id was the first argument instead of an object property to align with the rest of alchemy's api design.
Comment on lines
+459
to
+462
| * const event = yield* Cloudflare.waitForEvent<{ approved: boolean }>( | ||
| * "approval", | ||
| * { type: "approval", timeout: "1 day" }, | ||
| * ); |
Contributor
There was a problem hiding this comment.
Should we support an Effect schema here?
just-be-dev
reviewed
Jun 17, 2026
Comment on lines
+100
to
+103
| export interface WorkflowWaitForEventOptions { | ||
| type: string; | ||
| timeout?: string | number; | ||
| } |
Contributor
There was a problem hiding this comment.
These could just be defined inline. It's how they do it.
export abstract class WorkflowStep {
do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
do<T extends Rpc.Serializable<T>>(name: string, config: WorkflowStepConfig, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
waitForEvent<T extends Rpc.Serializable<T>>(name: string, options: {
type: string;
timeout?: WorkflowTimeoutDuration | number;
}): Promise<WorkflowStepEvent<T>>;
}I do need this though, so thank you for putting up the PR!
Contributor
There was a problem hiding this comment.
Ahh, nvm, I see why you separated it out.
Contributor
Author
|
Thanks for the feedback. I'm in the middle of exam week so it'll be probably end of next week I'll continue working on this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expand the Effect-native Cloudflare Workflow wrapper to cover the current Workers API surface with an object-based step API.
waitForEventsupportcreateBatch,restart,sendEvent, rollback status, and extended event metadata