-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
bugSomething isn't workingSomething isn't workingproduct:workflowsWorkflows: https://developers.cloudflare.com/workflows/Workflows: https://developers.cloudflare.com/workflows/
Description
Which Cloudflare product(s) does this pertain to?
Other
What version(s) of the tool(s) are you using?
3.97.0 wrangler
What version of Node are you using?
20.18.0
What operating system and version are you using?
Mac sonoma 14.6.1
Describe the Bug
The docs show 2 contradicting ways to access workflow events payload.
Under Rules For Workflows, there's an example showing that the event payload can be accessed directly using event.data or event.user - both properties are defined in MyEvent interface.
Under Events and Parameters, it says that event properties are accessible via event.payload. E.g. event.payload.userEmail
The only difference between the 2, is that the second one is TypeScript while the first one is Javascript. But I don't believe that it should really make any difference.
2 more things:
- Maybe worth showing how event properties can be used inside the workflow/steps in the Pass parameters to a Workflow section, which is not TypeScript specific as the one following it.
- The example in Get started guide shows that "my first step" returns the event. This is confusing imo, as it suggests that in order to access the event in following steps it has to be returned from previous steps. In case I got it wrong, and indeed it's recommended to return it in each step, then it has to be explicitly documented and not just appear in the example.
Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
No response
Metadata
Metadata
Labels
bugSomething isn't workingSomething isn't workingproduct:workflowsWorkflows: https://developers.cloudflare.com/workflows/Workflows: https://developers.cloudflare.com/workflows/
Type
Projects
Status
Done