Hi all. Is it possible to pause/resume
Hi all. Is it possible to pause/resume workflow steps and wait for user input?
We're using workflows for order processing. For new users, we require that the user verifies their identity with an external KYC provider. Is there a way to wrap this in a step that will block until the user has verified their identity? Some kind of signal mechanism similar to what Temporal has?
Thanks in advance.
6 Replies
Cloudflare Docs
Sleeping and retrying · Cloudflare Workflows docs
This guide details how to sleep a Workflow and/or configure retries for a Workflow step.
I see. So I could just sleep for say, 1 minute, and throw an exception if the condition (KYC) is not met? Then repeat that for 24h or so?
I guess that would work, but it would also incur up to 1440 worker invocations, when I actually only need 1.
Perhaps https://www.inngest.com/ would be more suited for now?
or what if you just stop at the KYC step, and schedule a background job that will ping the KYC service, and then trigger part B of your workflow>
Inngest - Queuing and orchestration for modern software teams
Inngest's durable functions replace queues, state management, and scheduling to enable any developer to write reliable, multi-step code faster without touching infrastructure.
Came to ask the same question.
It's just too bad that sleeping cannot be interrupted, otherwise we can do something a bit more clever.
My workflow had its status marked as "running" at the sleep step instead of sleeping, and resuming doesn't let me skip the rest of the sleep
I'd be over the moon if that works
Just tried it again. Same thing

What I've found out through testing:
step.sleep()
=> will keep the workflow status as "running". When a workflow is sleeping, it cannot be paused
workflow.pause()
=> will put the workflow status into paused. It will take a bit of time for the workflow to go into paused state.