Skip to content

@WorkflowStart

The @WorkflowStart decorator defines a typed entry point (workflows/<workflow-name>/<start-name>.workflow-start.ts) for starting a @Workflow. A workflow can declare multiple @WorkflowStart classes (for example, an interactive chat start and a batch webhook start), each seeding its own initial DTOs into the workflow’s Path Scope via start(StartClass).returns(InputDto).

Complete @WorkflowStart examples (single DTO, list input, and multi-field input)

Section titled “Complete @WorkflowStart examples (single DTO, list input, and multi-field input)”

Every @WorkflowStart class name ends with WorkflowStart and its name option ends with -workflow-start:

Option Type Required Description
name string Yes Unique kebab-case identifier ending with -workflow-start (e.g., "chat-workflow-start").
description string Yes Human- and CLI-readable description of what triggers this entry point.
input DtoClass | ListWrapper<DtoClass> | Readonly<Record<string, ValueShape>> Yes The DTO class, listOf(DtoClass), or map of DTO fields required by app.execute(StartClass, payload).
Section titled “What related entities work with @WorkflowStart?”
Related Entity Import Path Purpose
start(StartClass) "@agboss/core" Starts a flow path in @Workflow({ flow }) and chains .returns(...) to place the start’s input DTOs into Path Scope.
WorkflowStartTextDto "@agboss/core/dto" Standard built-in DTO ({ text: string }) for chat and text-first workflow entry points.
app.execute(StartClass, input, options?) "@agboss/core" Executes the workflow owning StartClass with compile-checked InputOf<StartClass> payload.
ExecutionOptions "@agboss/core" Optional third argument to app.execute: { threadId, ownerId, tenant, execution, signal, record }.
ExecutionOutput "@agboss/core" Return value of app.execute: discriminated by status (ExecutionStatus.Finished or ExecutionStatus.Paused).