Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 BUG: contradicting docs re workflows events #19181

Open
danbars opened this issue Dec 18, 2024 · 0 comments · May be fixed by #19191
Open

🐛 BUG: contradicting docs re workflows events #19181

danbars opened this issue Dec 18, 2024 · 0 comments · May be fixed by #19191
Assignees
Labels
bug Something isn't working product:workflows Workflows: https://developers.cloudflare.com/workflows/

Comments

@danbars
Copy link

danbars commented Dec 18, 2024

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:

  1. 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.
  2. 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

@danbars danbars added the bug Something isn't working label Dec 18, 2024
@WalshyDev WalshyDev pinned this issue Jan 13, 2025
@WalshyDev WalshyDev unpinned this issue Jan 13, 2025
@WalshyDev WalshyDev transferred this issue from cloudflare/workers-sdk Jan 13, 2025
@WalshyDev WalshyDev added the product:workflows Workflows: https://developers.cloudflare.com/workflows/ label Jan 13, 2025
@elithrar elithrar linked a pull request Jan 14, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product:workflows Workflows: https://developers.cloudflare.com/workflows/
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

6 participants