Forums

Dynamically add scheduled job

Hi all,

Is there any way to automate the scheduling of a job?

I'd like to run a python script periodically but with different parameters, dependant on the input of a user.

Is the API still available for use?

Thanks

Hi there, we don't have an API for something like that.

Could you, instead, save user input to the database or the filesystem somewhere, and then have a generic script that runs periodically, that looks at the database/fs, and decides what to do based on that?

I'm sure you guys used to have an API for managing scheduled tasks... I'm most likely mistaken.

That's a away around it but it's a bit janky.

We've never had an API for managing scheduled tasks.

...but maybe we should add one :-) I've added it to our to-do list, with an upvote on your (@mikeres0's) behalf.

Would be a huge +1 from me.

Do you still have an API that we can use? I remember we could request access a while back.

We have! I've switched it on for your account -- just go to the "Account" page to generate an access key.

A warning: it's very much under-development, and it's not very well documented. Our next system update will make a few small changes, and will add the first cut of proper docs. But you might find it useful now... any suggestions much appreciated!

That's awesome thanks guys, I'll have a play around with it. How much of a pain would it be to add an endpoint to schedule tasks? Say, with params of username, frequency, time and path to file?

It's definitely doable, but I can't promise anything about timelines...

That said, as a general indication -- over time we're migrating our web front-end over to using the API for its own access to the underlying data models, which (of course) means that we're expanding the scope of the API. One of the things we're working on right now involves scheduled tasks, which may well involve API-ifying that. So it's likely that something will happen in that area soon -- but again, no promises, as it's something we're likely to do as a side-effect of something we've formally scheduled to do, rather than something we've explicitly put onto the roadmap.

Yeah no problems, completely understand. I will keep my eyes peeled for any developments.

Cheers!