Error!A draft must be in the 'built' state before it can be deployed

Within an action, calling management API getRoles(...) leads to long waits, then to the posted error message. How can you unravel this type problem? What am I doing wrong?

exports.onExecutePostLogin = async (event, api) => {
const management = new auth0.ManagementClient({
    // identifiers with caps are defined 
    domain: configuration.AUTH0_DOMAIN,
    clientId: configuration.AUTH0_CLIENT_ID,
    clientSecret: configuration.AUTH0_SECRET,
var my_roles = await management.getRoles();

Did anyone meet this type of problem?

update: this gets interesting, removed all lines except the following skeleton:

exports.onExecutePostLogin = async (event, api) => {

* @param {Event} event - Details about the user and the context in which they are logging in.
* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.

exports.onContinuePostLogin = async (event, api) => {


Same error… fascinating!

DenverCoder9 What did you see!!!

Joke aside, did you ever figure this out, running into it right now.