@loopstack/agent-example-workflow
Demonstrates how to launch AgentWorkflow from @loopstack/agent as a sub-workflow with custom tools (weather_lookup, calculator) and render progress/results in Studio.
By using this example you’ll get…
- A parent workflow that queues
AgentWorkflowviaWORKFLOW_ORCHESTRATOR - The child agent rendered inline in the parent’s view via
show: 'inline' - A callback transition that stores the final agent response as a
MessageDocument
Installation
npm install @loopstack/agent-example-workflow@loopstack/agent requires an LLM provider configuration. Use AgentExampleModule.forFeature({ llm: ... }) when you want to override provider config per module.
Then register the module in your app:
import { AgentExampleModule, AgentExampleWorkflow } from '@loopstack/agent-example-workflow';
import { StudioApp } from '@loopstack/common';
@StudioApp({
title: 'Agent Example',
workflows: [AgentExampleWorkflow],
})
@Module({
imports: [AgentExampleModule],
})
export class MyAppModule {}How It Works
startqueuesAgentWorkflowwith a system prompt and selected tools, withshow: 'inline'so the child is embedded in the parent’s run view.- When the child workflow finishes,
agentCompletereceives the callback payload data. - The workflow saves the final assistant message.
Public API
AgentExampleModuleAgentExampleWorkflowCalculatorToolWeatherLookupTool
Dependencies
@loopstack/common@loopstack/agent
Last updated on