Skip to main content

Function: workflow()

workflow(name): WorkflowBuilder

Defined in: packages/agentos/src/orchestration/builders/WorkflowBuilder.ts:184

Create a new WorkflowBuilder with the given human-readable name.

Parameters

name

string

Display name embedded in the compiled CompiledExecutionGraph.

Returns

WorkflowBuilder

A fresh WorkflowBuilder instance.

Example

const wf = workflow('my-pipeline')
.input(z.object({ query: z.string() }))
.returns(z.object({ answer: z.string() }))
.step('search', { tool: 'web_search' })
.step('answer', { gmi: { instructions: 'Answer the question.' } })
.compile();