Anonymous View
Skip to content

Document CallbackSchema and how to type callback payloads #196

Description

@jakobklippel

Context

CallbackSchema from @loopstack/common is the base zod schema for every sub-workflow callback payload — it carries workflowId, status, and data: unknown. The HITL docs show callbacks being typed with an undefined AnswerCallback schema but never explain that it should extend CallbackSchema. As a result, readers don't know payload.workflowId and payload.status exist at top-level (which is needed to update the corresponding LinkDocument on callback).

What to do

Document CallbackSchema and the canonical extension pattern, and mirror it into every HITL feature/example doc.

Affected area

  • Docs: build/patterns/human-in-the-loop.md, registry/features/hitl-module.md, every HITL example doc

Acceptance criteria

  • A reader can write a correctly-typed callback transition without source access.
  • The relationship between payload.workflowId and the LinkDocument flow is shown explicitly.

Additional context

Surfaced during a benchmark agent session. See todo-docs.md#5.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationpriority:p2Medium prioritytaskGeneral task / chore

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions