async def some_fn(ev: SomeEvent) -> SomeOtherEvent
or async def some_fn(ctx: Context, ev: SomeEvent) -> SomeOtherEvent
from llama_index.core.workflow import Context, StartEvent, StopEvent, Workflow, step @step def some_fn(ctx: Context, ev: StartEvent) -> StopEvent: return StopEvent(result="This came from a free function!") w = Workflow() w.add_step(some_fn)
llama_index.core.workflow.Workflow
and then use the add_step instance method in a workflow instance, that is raising a validation error here -> https://github.com/run-llama/llama_index/blob/ef7207247e0884d48b05c85a710634b43dc04b05/llama-index-core/llama_index/core/workflow/workflow.py#L142