[SOLVED] Custom Workflow script Error

I’m following the Custom Workflow guide documented here: https://docs.squidex.io/guides/10-workflow

However, the update script is failing with the following error:

Failed to execute script with javascript error: role is undefined: role is undefined.

It looks like role isn’t being populated in ctx.user. This is happening in both the cloud and my local install.
Any help would be great. Thanks.

Thank you for the report. I will have a look today.

Please note that we also work on an improved workflow system.

Sorry, there was a bug in the tutorial.

It must be ctx.user.claims.role instead of ctx.user.role. Please note that all claim values are arrays.