JSPM

@loopstack/hitl-ask-user-example-workflow

0.21.6
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 20
    • Score
      100M100P100Q93753F
    • License MIT

    Example workflow that uses @loopstack/hitl's AskUserWorkflow to prompt the user for free-text input and echoes the answer back

    Package Exports

    • @loopstack/hitl-ask-user-example-workflow
    • @loopstack/hitl-ask-user-example-workflow/src/__tests__/hitl-ask-user-example.workflow.spec.ts
    • @loopstack/hitl-ask-user-example-workflow/src/hitl-ask-user-example.module.ts
    • @loopstack/hitl-ask-user-example-workflow/src/hitl-ask-user-example.ui.yaml
    • @loopstack/hitl-ask-user-example-workflow/src/hitl-ask-user-example.workflow.ts
    • @loopstack/hitl-ask-user-example-workflow/src/index.ts

    Readme

    @loopstack/hitl-ask-user-example-workflow

    Demonstrates how to prompt the user for free-text input from inside a workflow using the AskUserWorkflow from @loopstack/hitl. The user's answer is captured and echoed back as an assistant message.

    By using this example you'll get...

    • A parent workflow that launches AskUserWorkflow as a sub-workflow with a callback
    • A concrete pattern for waiting on human input without blocking the worker
    • An AskUserDocument rendered in the UI while the workflow is paused

    Installation

    loopstack add @loopstack/hitl-ask-user-example-workflow

    This installs @loopstack/hitl as a dependency automatically.

    How It Works

    1. The workflow starts and calls AskUserWorkflow.run({ question }) as a sub-workflow.
    2. The sub-workflow renders an AskUserDocument and stops at waiting_for_user.
    3. When the user submits an answer, the sub-workflow finishes and the parent's callback fires.
    4. The parent saves a MessageDocument with the answer and ends.

    Public API

    • HitlAskUserExampleModule
    • HitlAskUserExampleWorkflow

    Dependencies

    • @loopstack/common, @loopstack/core
    • @loopstack/hitl