1

Good day everyone,

I am using the Docker version of Directus.

I have the following Flow:

- Cron Job > Read Data > Run Script

But I want to "Run Function" instead as "Run script" is limited and cannot "import" nor "require" external libraries on it.

I know that I can run an API Endpoint / Webhook. So basically my question is if that I can create a custom extension with an API endpoint and then run it on the Flow, or if it is possible to "Run function".

What I want to do is to run Puppeteer inside a Flow:

- Cron Job > Read Data > Loop through the "read data" returned information and run puppeteer to return information.

I hope this question is clear.

Regards.

I tried "Run Script" but for security reasons doesn't allow "import" or "require" external libraries (Puppeteer, for example).

2 Answers2

0

You can just send a HTTP request to that custom endpoint I guess?

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 19 '23 at 22:01
0

Add a CSV list of trusted Node modules to the FLOWS_EXEC_ALLOWED_MODULES env var and restart your container. Now you can import those Node modules.

It's mentioned in the docs: https://docs.directus.io/self-hosted/config-options.html

tobius
  • 825
  • 1
  • 8
  • 10