@loopstack/hitl-confirm-example-workflow
Demonstrates how to ask the user for a yes/no confirmation from inside a workflow using the ConfirmUserWorkflow from @loopstack/hitl and branch on the decision.
By using this example you’ll get…
- A parent workflow that launches
ConfirmUserWorkflowas a sub-workflow - Two different outcome branches for the
confirmed/deniedpaths - A
ConfirmUserDocumentrendered in the UI while the workflow is paused
Installation
npm install @loopstack/hitl-confirm-example-workflowThe package depends on @loopstack/hitl.
How It Works
- The workflow starts and calls
ConfirmUserWorkflow.run({ markdown })as a sub-workflow. - The sub-workflow renders a
ConfirmUserDocumentand stops. - When the user confirms or denies, the parent’s callback fires with
data.confirmed. - The parent saves a
MessageDocumentindicating which branch was taken.
Public API
HitlConfirmExampleModuleHitlConfirmExampleWorkflow
Dependencies
@loopstack/common@loopstack/hitl
Last updated on