Skip to content

Workflows reference: event.params should be event.payload #23

@FredKSchott

Description

@FredKSchott

Multiple files in the workflows reference use event.params to access workflow event data, but the actual WorkflowEvent<T> type from cloudflare:workers uses event.payload.

From the runtime type definition:

export type WorkflowEvent<T> = {
    payload: Readonly<T>;
    timestamp: Date;
    instanceId: string;
};

Affected files (non-exhaustive):

  • references/workflows/api.md — e.g. event.params.paymentMethod, event.params.userId
  • references/workflows/patterns.md — e.g. event.params.imageKey, event.params.email, event.params.sourceUrl
  • references/workflows/gotchas.md — best practices mention event.payload in one place but the rest of the docs consistently use event.params

All instances of event.params in workflow code examples should be event.payload.

Source: cloudflare:workers type definitions and https://developers.cloudflare.com/workflows/build/events-and-parameters/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions