@loopstack/delegate-error-example-workflow
Demonstrates how delegate tool-call loops handle different tool failure modes and feed structured error results back to the LLM for recovery.
By using this example you’ll get…
- A multi-turn LLM workflow using
LlmGenerateTextTool+LlmDelegateToolCallsTool - Three failure types in one flow: schema validation error, runtime error, and failing sub-workflow
- Error propagation back into the conversation via
LlmUpdateToolResultTool
Installation
npm install @loopstack/delegate-error-example-workflowThis example uses @loopstack/claude-module through @loopstack/llm-provider-module, so configure Claude credentials before running.
How It Works
- The workflow seeds an instruction asking the model to intentionally trigger tool failures first.
- The LLM generates tool calls (
strict_schema,runtime_error,failing_sub_workflow). - Delegate execution runs tools and callback updates merge results into pending delegate state.
- Completed tool results are posted back as
tool_resultblocks so the LLM can self-correct. - The workflow ends when the model reaches
end_turnand stores the final message.
Public API
DelegateErrorExampleModuleDelegateErrorWorkflow
Dependencies
@loopstack/common@loopstack/llm-provider-module@loopstack/claude-module
Last updated on