Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

workflow ecma script even works?


Level 3

I'm playing with workflows and must say it is terrible experience

From UI all looks good then in logs I see errors about my model.

I've try to just run sample script delivered with AEM and it is not working

 Unable to execute rule /libs/workflow/scripts/sample.ecma : Failure running script /libs/workflow/scripts/sample.ecma: ReferenceError: "workItem" is not defined. (NO_SCRIPT_NAME#2)

Now I limited my script just to log some random text

log.info("Workflow Bartek LOG test");

And now error is even more surprising

Caused by: org.apache.sling.api.scripting.ScriptEvaluationException: Failure running script /libs/workflow/scripts/my-test.ecma: ReferenceError: "check" is not defined. (NO_SCRIPT_NAME#2)

I don't have any "check" in my script and running it as single process. Any idea how to make it work? Should I even spend time on playing with ECMA scripts?

2 Replies


Community Advisor

Hi @broman__pl ,
Yes, it works. Maybe you missed a step or config.

Please try to go through this answer by @Shubham_borole, and check whether you are following the same process or not.
Solved: Custom Step Workflow with Ecma script - Adobe Experience League Community - 416420


Level 3

I don't want to create anything custom. It was rather initial test of workflow.

After restart my workflow somehow started working but even if step is super simple logging message


instead of finishing it is stuck in running state which prevents any next instance on same workflow. There is nothing that could give me a clue why and it is not very reliable as once it is stuck all next same events are ignored.