Is there a way to pauses and resumes a workflow programmatically through the REST API? For instance, I would like to be able to submit a personal time off request from an app, the app creates and triggers a workflow. The workflow sends a notification to the manager for approval and the workflow execution is paused while waiting for the manager's approval. Once the manager approves the request, it calls the workflow API to resumes the execution of the workflow.
From the documentation, there's an option to put the workflow to sleep and I can use it to periodically check for the request's status but this incurs additional cost because there's no idea when the manager is going to approve the request.
Update 2021-10-05:
Waiting for an HTTP callback is now supported:
Original response
The ability to wait for an HTTP webhook callback during a workflow execution is planned. (I'm the Workflows PM.)
Until then, you're right that the best solution is to poll for a flag (Firestore works well for this) using
sleep
.