Package Exports
- @loopstack/hitl-confirm-example-workflow
- @loopstack/hitl-confirm-example-workflow/src/__tests__/hitl-confirm-example.workflow.spec.ts
- @loopstack/hitl-confirm-example-workflow/src/hitl-confirm-example.module.ts
- @loopstack/hitl-confirm-example-workflow/src/hitl-confirm-example.ui.yaml
- @loopstack/hitl-confirm-example-workflow/src/hitl-confirm-example.workflow.ts
- @loopstack/hitl-confirm-example-workflow/src/index.ts
Readme
@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
loopstack add @loopstack/hitl-confirm-example-workflowThis installs @loopstack/hitl as a dependency automatically.
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/core@loopstack/hitl