Background Job in Frappe V13

Hi,

Custom Script & Server Script prevents developers from modifying files,
So, Is there a way to make background without editing the hooks file?
If not how can #Frappe #Cloud deal with needs?

1 Like

I’m assuming you want to run scheduled background jobs.

One way to do this is to create a Server Script of type Scheduler Event. Here, I’m using a small one-liner to create random Notes

frappe.get_doc({
    "doctype": "Note",
    "title": frappe.utils.generate_hash(length=10),
}).insert()

Once saved, click on the Schedule Script button and choose the frequency. If successful, this will create a new Scheduled Job Type.

That’s it

3 Likes