Execution failed: unregistered explicit script

Hello,
I am attempting to execute an automation script through a workflow function node.

I added the volume to the docker-compose.yaml file and updated the env file CORREDOR_EXT_SEARCH_PATHS variable file per the documentation. My custom script is appearing successfully in the Corredor Scripts list in the admin area.

However, when I execute my workflow, the function calling my script gives the following error message: 'execution failed: unregistered explicit script. “/client-scripts/system/test/Alert.js:default” '.

The script string is copied directly off the corredor scripts page. Any thoughts as to how to fix this execution failure?

There are a few examples so I am unsure which you’ve copied. Could you paste me the triggers (...) {...} parameter of the script?
Here is the documentation regarding automation script execution from a workflow. The main requirement of an automation script is that the trigger parameter returns an on('manual').for('system')

Thank you for your response. Right now, I’ve simplified the script down to the following for troubleshooting:

export default {
  label: 'Just a test',
  description: 'Testing out automation scripts',

  triggers ({ on }) {
    return on('manual').for('system')
  },

  async exec (args, { logger }) {
    return {
      a: 123,
      b: true
    }
  }
}

Here is what I see on the corredor admin page:
corredor print

This is the error appearing when testing the workflow:
execution error

Ee… this should be a server-script, not a client-script; place it in the /server-scripts directory. Client scripts are not executable by the server; they are bundled and passed down to the web application.

Thank you, changing it to server script allowed the workflow to run successfully. I knew it had to be simple user error somewhere :innocent:

Can you provide some clarification:

  • Is it the trigger that is limiting this script to being only a server script? (IE, a different trigger is needed for client script)
  • Must all automation scripts executed by workflow be server scripts?

No. The directory is the delimiter.

Yes. Client scripts are only bundled and served to the appropriate application; no execution can be performed server-side. Server scripts are entirely handled and executed by the Corredor server.