Replies: 1 comment 2 replies
-
To expose events from the inner (nested) workflow in a human-in-the-loop setup, you need to ensure that the events produced by the sub-workflow (like In your current setup, the outer workflow ( How to expose inner workflow events: Instead of awaiting class HumanInTheLoopWorkflow2(Workflow):
@step
async def step0(self, ev: StartEvent) -> Event1:
return Event1()
@step
async def step1(self, ev: Event1, wf: HITLWorkflow, ctx: Context) -> StopEvent:
handler = wf.run(ctx=ctx)
async for event in handler.stream_events():
ctx.send_event(event) # Expose inner workflow events to the outer context
if isinstance(event, InputRequiredEvent):
# Wait for human input event to be sent to the context
response_event = await ctx.wait_for_event(HumanResponseEvent)
handler.ctx.send_event(response_event)
result = await handler
return StopEvent(result) This approach ensures that any Why you got a WorkflowTimeoutError: The timeout occurs because the inner workflow emits an Other tips to avoid deadlocks and timeouts:
If you need a more concrete example or run into further issues, let me know! To reply, just mention my name @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I try to replicate this example for Human-in-the-loop, but using nested workflow. I got TimeOut:
llama_index.core.workflow.errors.WorkflowTimeoutError: Operation timed out after 10.0 seconds
First I rewrite the HumanInTheLoopWorkflow to accept another workflow
The actually Human in the Loop sub-workflow
Then I run the workflow using the code snippet
I was told to expose the event of the inner workflow but I don't know how to do it? Can somebody help?
Beta Was this translation helpful? Give feedback.
All reactions