Is it possible to use a server-side cron job to trigger a Wappler Flow

I have a php page with a Wappler flow, set to auto-run on page load. Is it possible to trigger this process from a server-side cron job? (Plesk server running on a Windows Server 2019). I see how to invoke the php engine, but get a completed with errors message when I direct it to the page.

Yes, it is definitely possible, I do it with my app.

Can’t remember how now as I’m messaging from my phone nowhere near the computer…

1 Like

There are a couple of examples here.

1 Like

I tried the methods shown in the sample but could not get it to execute without error.

You should probably check your plesk documentation on how it is done in your version. Sometimes you only have to give the php script and other times you have to point it to the php executable.

It does require point to the executable and the path to the page as an argument.

I’ve tried mimicking some of the other cron jobs, haven’t be able get the flow to complete successfully. I was wondering if this was because it was relying on a flow and not the underlying ServerConnect files.

I specifically execute the server connect files…

Instead of pointing to the page and letting the flow execute? (My flow is simply made up of 5 server connect files) so this would be easy to do, although each must complete execution before the next one starts.

You can’t call a browser flow from a cron job.

1 Like

Calling the API php files individually should still work, correct?

1 Like

Yup!

1 Like

I’m still struggling with this. I am getting the script to start, then I get a fatal script error because the paths in the script are relative web style paths (…/…/…/dmxConnectLib/dmxConnect.php) but the command requires windows style ( C:\inetpub\vhosts\edtechdev.lcsdor.org\httpdocs\dmxConnect\api\import\import_ivision_auto.php )

Is there any around this, other that duplicating the script using windows style paths?

Progress. I got the server connect action to run using the “fetch a url” option. It completed the operation, but did not end the cron task until I manual cancelled it. Is there an additional directive I can add to the file to indicate that it has completed?

You can’t stop crons individually. If you are just scheduling it to run once use at command.

Unfortunately, it’s running on a windows platform. Not linux.

I am not a windows expert but check:

1 Like