Live data from Hacker News

Workflows 1.0: A Lightweight Framework for Agentic systems

llamaindex.ai

1–3 of 3 posts

Re: Workflows 1.0: A Lightweight Framework for Agentic systems

#2
I notice that the python versions and typescript versions are pretty different. Python is sort of class based, with python magic decorators

    class MyWorkflow(Workflow):
        @step
        async def start(self, ctx: Context, ev: StartEvent) -> MyEvent:
            num_runs = await ctx.get("num_runs", default=0)
whereas TS is sort of builder/function based

    import { createWorkflow } from "@llamaindex/workflow-core";
    
    const convertEvent = workflowEvent();
    
    const workflow = createWorkflow();
    
    workflow.handle([startEvent], (start) => {
      return convertEvent.with(Number.parseInt(start.data, 10));

Is there reason for this? });

Re: Workflows 1.0: A Lightweight Framework for Agentic systems

#3
post #2

I notice that the python versions and typescript versions are pretty different. Python is sort of class based, with python magic decorators class MyWorkflow(Workflow): @step async def start(self, ctx: Context, ev: StartEvent) -> MyEvent: num_runs = await ctx.get("num_runs", default=0) whereas TS is sort of builder/function based import { createWorkflow } from "@llamaindex/workflow-core"; const convertEvent = workflow…

yea good callout -- python workflows came first, and while we could have directly translated these, the ergonomics around classes in python are not exactly what JS/TS devs expect.

So instead, the goal was to capture the spirit of event-driven workflows, and implement them in a more TS-native way and improve the dev-ux for those developers. This means it might be harder to jump between the two, but I'd argue most people are not doing that anyways.