Error workflow with automation script

Iā€™m trying the example in the documentation

https://docs.cortezaproject.org/corteza-docs/2022.3/integrator-guide/automation/workflows/automation-scripts.html

to reproduce. But get the error: ā€œexecution failed: expression ā€œserver-scripts/testscript.jsā€ failed: failed to select ā€˜serverā€™ on *expr.Vars: no such key 'serverā€ā€™
I canā€™t do anything with this error message.

does the script appear on the Corredor page (from admin page)?

Yes.
Before I had updated the script in the following way:

  • Change the script file (and the label and description to see the change in the admin page)
  • Stopping the containers
  • docker-compose up -d

There is one oddity in general:
According to the documentation, ā€œ/server-scripts/testscript.js:defaultā€ should be specified for example as the script name in the step definition. However, I get error messages regarding the characters ā€œ/ā€ at the beginning and ā€œ:ā€. But when I enter ā€œserver-scripts/testscript.jsā€ I donā€™t get an error message.
Is there a causal connection?

Problem solved. I corrected 2 things. Parameter ā€œargsā€ is a required field, although itā€™s not marked as such. You also have to write the name of the script in quotation marks and activate the ā€œexpressionā€ switch or vice versa.

2 Likes