Server-Side Action with Multiple Functions

Hello fellow Bubblers,

This is my first time creating a server-side plugin Action (v4 API), so I’m thinking I’ve simply missed something fundamental. Any guidance offered will be greatly appreciated!

Anytime I include a second function in my Action code, I get the error “This code cannot be interpreted as Javascript” as shown below:

If I take out all the functions except the primary, the error goes away.

When executing the Action from within the app (with multiple functions), I get the error “Workflow error - Sorry, we ran into a temporary bug and can’t complete your request. We’ll fix it as soon as we can; please try again in a bit!”

When executing with only the async function(properties, context), removing the other functions that the primary needs to call, it runs without issue.

What am I missing, friends? Thanks so much in advance!

All of your logic and functions should be wrapped in the main function or imported from elsewhere (inside of the main function)