is this code in a formula, a bound value or a js action?
for sure you can use async functions in a js action (it’s basically an async action itself).
This is in a change a variable action in a workflow. The full problem is I want to return a base64 string of a pdf file that I have generated on the page so that I can email it and the pdf generation is async, and I want to return what was generated.
To get a bit more help, try zooming out a bit with the context. A video lets you do this much more quickly, because instead of picking “the right screenshot” you let the viewer play and freeze where its most helpful.
Update: Seems like @dorilama took care of you in this round!
the right place for async code is js actions in workflows, everywhere else it doesn’t work as you would expect.
to solve this add a js action before the change variable action, execute your async logic and return the data (remember to await async operations). then in the change variable action use the “result of step” of the js action.