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 #7578

Open
danbars opened this issue Dec 18, 2024 · 0 comments
Open

🐛 BUG: contradicting docs re workflows events #7578

danbars opened this issue Dec 18, 2024 · 0 comments
Labels
bug Something that isn't working 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 that isn't working label Dec 18, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Dec 18, 2024
@andyjessop andyjessop moved this from Untriaged to Backlog in workers-sdk Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working workflows
Projects
Status: Backlog
Development

No branches or pull requests

2 participants