Skip to content

LlamaIndex (TypeScript)

Event-driven agentic workflows in TypeScript — RAG, agent coordination, typed event handling.

GroupData & RAG
Current versionv0.12.1
Bonds withTs

Event-driven agentic workflows for TypeScript. @llamaindex/workflow models agents as typed events and handlers, with RAG primitives available from the llamaindex umbrella package.

Install

Terminal window
npm install @llamaindex/workflow @llamaindex/openai zod

Version

Final releases, listed below · Node 22+ · checked 2026-11-19

Best for

Maintaining existing LlamaIndex.TS code; typed event-driven flows.

No further versions will be published, so these are the versions the guides document:

PackageFinal releaseContents
@llamaindex/workflow1.1.25Workflow runtime (createWorkflow, workflowEvent, run) and agents (agent, multiAgent), built on @llamaindex/workflow-core 1.3.x
@llamaindex/workflow-core1.3.4The engine itself: events, handlers, stream, state and validation middleware (page)
@llamaindex/core0.6.23LLM, tool, memory and schema interfaces
@llamaindex/openai0.4.23OpenAI LLM and embeddings (other providers have their own package)
llamaindex0.12.1Indexes, readers, node parsers, query and chat engines

llamaindex 0.12.1 pins exact, slightly older versions of its dependencies: @llamaindex/workflow 1.1.24 and @llamaindex/core 0.6.22. A project that uses only workflows and agents can install the latest of each scoped package. A project that also uses llamaindex should install @llamaindex/workflow@1.1.24, so npm resolves a single copy of @llamaindex/core (and a matching @llamaindex/openai):

Terminal window
npm install llamaindex @llamaindex/openai @llamaindex/workflow@1.1.24 zod

With two copies installed, llamaindex prints “llamaindex was already imported”, and Settings.llm set through one copy is not seen by agents created from the other.

  • runWorkflow(), runAndCollect() and runStream() are marked @deprecated; use run(workflow, event).until(stopEvent).toArray() instead.
  • handle() mutates the workflow in place and returns void — method chaining is not supported.
  • Handler signature is (ctx, ...events): the first argument is the workflow context; subsequent arguments are the matched input events in order.
  • Agent workflows built with agent(...) / multiAgent(...) expose run() (a Promise of the final stop event) and runStream() (all events).

@llamaindex/workflow uses a functional API — createWorkflow, workflowEvent, run. A class-based extends Workflow + @step() pattern is the Python API and does not exist in the TypeScript package.

import { createWorkflow, workflowEvent, run } from '@llamaindex/workflow';
// Define typed events — the generic parameter is the payload type
const startEvent = workflowEvent<{ input: string }>({ debugLabel: 'start' });
const stopEvent = workflowEvent<{ result: string }>({ debugLabel: 'stop' });
// Build the workflow — handle() mutates in place; it does not return the workflow
const workflow = createWorkflow();
workflow.handle([startEvent], async (ctx, start) => {
return stopEvent.with({ result: `Echo: ${start.data.input}` });
});
const events = await run(workflow, startEvent.with({ input: 'Hello!' }))
.until(stopEvent)
.toArray();
console.log(events.at(-1)?.data); // { result: 'Echo: Hello!' }

For runtime validation of payloads, zodEvent(schema) creates an event type from a Zod schema.

For multi-agent topologies use multiAgent(...) + FunctionAgent. For streaming use run(...).toStream() or iterate the return value of run(...) directly.

Ready? Start Zero → Hero Step 1 →


DateVersionChanges
2026-10-24final releasesAdded a recipe for metadata-filtered retrieval and a chat engine; the comprehensive guide named a non-existent @llamaindex/azure-openai package (the Azure classes are in @llamaindex/azure).
2026-10-24workflow-core 1.3.4Added the workflows engine page for @llamaindex/workflow-core, with a working snapshot/resume example; listed the package under final releases.
2026-10-21final releasesFinal package versions now listed once, in Final releases, with the note that llamaindex pins @llamaindex/workflow 1.1.24. Corrected the claim that llamaindex re-exports the workflow API. Node 22+ (Node 20 reached end of life in April 2026). Added a real VectorStoreIndex RAG recipe; production guide rebuilt to compile under its own config.
2026-10-21llamaindex 0.12.1 / @llamaindex/workflow 1.1.25Added the upstream deprecation notice (repository and npm packages deprecated). Minimal example fixed — it passed a Zod schema as workflowEvent({ data }), which is not a valid option and does not type-check. Version card now reads from the site’s version registry. Comprehensive guide, recipes and production guide re-checked with tsc.
2026-05-04@llamaindex/workflow 1.1.25Bumped 1.1.24 → 1.1.25. Fixed broken minimal example: corrected handler signature to (ctx, start) (was incorrectly ({ data })); removed unsupported chaining on handle(); replaced deprecated runWorkflow() with run().until().toArray(). Added “What’s new in 1.1.25” section documenting runWorkflow deprecation and handle() void-return behaviour. Snippet executed against installed 1.1.25 in .routine-envs/check-0504-node.
2026-04-211.1.24Minimal example rewritten against functional API (createWorkflow/workflowEvent/runWorkflow) after pkg introspection — class + @step pattern documented earlier does not exist.
April 20261.1.24Scoped package migration; typed event handlers stabilised.

Note: Python implementation lives at LlamaIndex (Python).