Agent skill

Frappe Impl Scheduler

by Impertio-Studio in Impertio-Studio/Frappe_Claude_Skill_Package

A skill your agent uses when implementing scheduled tasks and background jobs in Frappe v14/v15/v16.

MITAuto-check passedProductivity & Automation

Install Frappe Impl Scheduler

skills CLI
$ npx skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-impl-scheduler -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Impertio-Studio/Frappe_Claude_Skill_Package frappe-impl-scheduler --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/source/impl/frappe-impl-scheduler .claude/skills/frappe-impl-scheduler && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
frappe-impl-scheduler
GitHub stars
188
Token cost
~2.4k tokens
SKILL.md length
469 words
Files
5 (incl. references)
Skills in repo
61
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when implementing scheduled tasks and background jobs in Frappe v14/v15/v16.

  • Works in 7 steps: Scheduler tasks receive NO arguments -… → ALWAYS bench migrate after hooks.py… → Jobs run as Administrator - ALWAYS… → …
  • Implementing scheduled tasks and background jobs in Frappe v14/v15/v16
  • SKILL.md covers Main Decision:…, Which Scheduler Event Type?, Which Queue for frappe.enqueue? and Implementation Step 1:…, plus 10 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Frappe Impl Scheduler is an agent skill from Impertio-Studio/Frappe_Claude_Skill_Package. Use when implementing scheduled tasks and background jobs in Frappe v14/v15/v16. Covers hooks.py schedulerevents, frappe.enqueue, queue selection, job deduplication, testing with bench execute/scheduler, monitoring via Scheduled Job Log and RQ Dashboard, error handling, long-running job patterns, email digest, data cleanup, and report generation. Keywords: schedule task, background job, cron job, async processing, queue selection, job deduplication, scheduler implementation, run task automatically, background…

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/anti-patterns.md`, `references/decision-tree.md` and `references/examples.md`). Compatibility notes: Claude Code, Claude.ai Projects, Claude API. Frappe v14-v16.

It sits in Productivity & Automation, covering Scheduled and recurring tasks and Background jobs. The repository describes itself as: 60 deterministic Claude AI skills for Frappe Framework & ERPNext v14-v16 development and operations. The licence is MIT.

When your agent uses it

  • Implementing scheduled tasks and background jobs in Frappe v14/v15/v16
  • Tasks that involve Scheduled and recurring tasks
  • Tasks that involve Background jobs

Example prompts

  • “/frappe-impl-scheduler”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): Claude Code, Claude.ai Projects, Claude API. Frappe v14-v16.

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Scheduler tasks receive NO arguments - Use settings or hardcoded values
  2. ALWAYS bench migrate after hooks.py changes - Required to register events
  3. Jobs run as Administrator - ALWAYS commit explicitly
  4. Commit in batches - NEVER per-record (every 100-500 records)
  5. ALWAYS use job_id for user-triggered jobs - Prevents duplicates
  6. Use enqueue_after_commit=True from document events - Ensures data exists
  7. Scheduler events should be thin - Enqueue heavy work to background

What it can do on your machine

Read from SKILL.md and the folder at commit 36cfa80. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python and bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Claude Code, Claude.ai Projects, Claude API. Frappe v14-v16.

    From compatibility in the SKILL.md frontmatter.

Context cost

Frappe Impl Scheduler loads about 2.4k tokens when it runs, and up to ~20k if it reads all its reference files. Until then it costs about 147 tokens; SKILL.md has 469 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~147
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~20k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Impertio-Studio/Frappe_Claude_Skill_Package at commit 36cfa80, republished under its MIT licence (© Impertio-Studio). 469 words, ~2,428 tokens.

Download SKILL.mdSave it as .claude/skills/frappe-impl-scheduler/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
frappe-impl-scheduler
description
Use when implementing scheduled tasks and background jobs in Frappe v14/v15/v16. Covers hooks.py scheduler_events, frappe.enqueue, queue selection, job deduplication, testing with bench execute/scheduler, monitoring via Scheduled Job Log and RQ Dashboard, error handling, long-running job patterns, email digest, data cleanup, and report generation. Keywords: schedule task, background job, cron job, async processing, queue selection, job deduplication, scheduler implementation, run task automatically, background process, scheduled task not running, async task.
compatibility
Claude Code, Claude.ai Projects, Claude API. Frappe v14-v16.
license
MIT
metadata.author
OpenAEC-Foundation
metadata.version
2.0

Frappe Scheduler & Background Jobs - Implementation

Workflow for implementing scheduled tasks and background jobs. For exact syntax, see frappe-syntax-scheduler.

Version: v14/v15/v16 compatible


Main Decision: scheduler_events vs frappe.enqueue

WHAT ARE YOU BUILDING?
|
+-- Runs at fixed intervals/times?
|   +-- YES --> scheduler_events (hooks.py)
|   |           Task receives NO arguments
|   |           See: Workflow 1-2
|   |
|   +-- NO --> Triggered by user action or code?
|              +-- YES --> frappe.enqueue()
|              |           Pass any serializable data
|              |           See: Workflow 3-4
|              |
|              +-- NO --> Reconsider requirements
Aspectscheduler_eventsfrappe.enqueue
Triggered byTime/intervalCode execution
Defined inhooks.pyPython code
ArgumentsNONE (must be parameterless)Any serializable data
Use caseDaily cleanup, hourly syncUser-triggered long task
Queue controlEvent suffix (_long)queue= parameter
Restart behaviorRuns on scheduleLost if worker restarts

Which Scheduler Event Type?

NeedEvent KeyQueue
Every scheduler tickallshort (NEVER >60s)
Hourly (<5 min)hourlyshort
Hourly (5-25 min)hourly_longlong
Daily (<5 min)dailyshort
Daily (5-25 min)daily_longlong
Weekly (<5 min)weeklyshort
Weekly (5-25 min)weekly_longlong
Monthly (<5 min)monthlyshort
Monthly (5-25 min)monthly_longlong
Custom schedulecron["expr"]short

Rule: ALWAYS use *_long suffix for tasks exceeding 5 minutes.


Which Queue for frappe.enqueue?

QueueDefault TimeoutUse For
short300s (5 min)Quick operations (<1 min)
default300s (5 min)Standard tasks (1-5 min)
long1500s (25 min)Heavy processing (>5 min)

Rule: ALWAYS specify queue= explicitly. NEVER rely on the default.


Implementation Step 1: Scheduler Event

python
# myapp/tasks.py
import frappe

def daily_cleanup():
    """Daily cleanup - NO parameters allowed."""
    cutoff = frappe.utils.add_days(frappe.utils.nowdate(), -30)
    frappe.db.delete("Error Log", {"creation": ("<", cutoff)})
    frappe.db.commit()
python
# hooks.py
scheduler_events = {
    "daily": ["myapp.tasks.daily_cleanup"]
}

After editing hooks.py: ALWAYS run bench migrate.


Implementation Step 2: Background Job (frappe.enqueue)

python
# myapp/api.py
import frappe
from frappe.utils.background_jobs import is_job_enqueued

@frappe.whitelist()
def process_documents(doctype, filters):
    job_id = f"process_{doctype}_{frappe.session.user}"

    if is_job_enqueued(job_id):
        return {"message": "Already in progress"}

    frappe.enqueue(
        "myapp.tasks.process_batch",
        queue="long",
        timeout=1800,
        job_id=job_id,
        enqueue_after_commit=True,
        doctype=doctype,
        filters=filters
    )
    return {"status": "queued"}

Testing Scheduled Tasks

Method 1: bench execute (direct)
bash
# Run the function directly (no queue involved)
bench --site mysite execute myapp.tasks.daily_cleanup
Method 2: bench scheduler (full scheduler test)
bash
# Check scheduler status
bench --site mysite scheduler status

# Enable scheduler
bench --site mysite scheduler enable

# Trigger all pending scheduler events NOW
bench --site mysite scheduler trigger

# Run specific event type
bench --site mysite execute frappe.utils.scheduler.trigger --args "['daily']"
Method 3: bench console (interactive)
python
bench --site mysite console
>>> frappe.enqueue("myapp.tasks.my_task", queue="short", now=True)
# now=True executes synchronously for testing
Method 4: Check Scheduled Job Type
1. Go to: Setup > Scheduled Job Type
2. Find: myapp.tasks.daily_cleanup
3. Verify: Frequency correct, Stopped = No
4. Click "Run Now" to trigger manually

Monitoring

Scheduled Job Log (UI)
Setup > Scheduled Job Log
- Shows every scheduler run with status
- Filter by: status (Success/Failed), creation date
- Check execution time to detect slow tasks
RQ Dashboard
bash
# Start RQ monitor (development)
bench --site mysite rq-dashboard
# Opens at http://localhost:9181

# Show background job status
bench --site mysite show-pending-jobs
bench --site mysite show-failed-jobs
Programmatic Health Check
python
def scheduler_health_check():
    failed = frappe.db.count("Scheduled Job Log", {
        "status": "Failed",
        "creation": [">=", frappe.utils.add_to_date(None, hours=-1)]
    })
    if failed > 5:
        frappe.sendmail(
            recipients=["admin@example.com"],
            subject="Scheduler Alert: Many failures",
            message=f"{failed} scheduler jobs failed in last hour"
        )

Error Handling in Scheduled Tasks

Per-Record Error Isolation
python
def sync_all_orders():
    orders = get_pending_orders()
    success, errors = 0, 0

    for order in orders:
        try:
            sync_to_external(order)
            success += 1
        except Exception as e:
            errors += 1
            frappe.db.rollback()
            frappe.log_error(
                f"Sync failed for {order}: {e}",
                "Order Sync Error"
            )
    frappe.db.commit()
    frappe.logger("sync").info(f"{success} ok, {errors} errors")

Rule: ALWAYS wrap per-record processing in try-except. NEVER let one failure stop the entire batch.


Long-Running Job Patterns

Self-Chaining Pattern (>25 min tasks)
python
def process_batch(offset=0, batch_size=500, total=None):
    if total is None:
        total = frappe.db.count("Sales Invoice", {"custom_processed": 0})

    records = frappe.get_all("Sales Invoice",
        filters={"custom_processed": 0},
        pluck="name", limit=batch_size)

    if not records:
        return  # Done

    for name in records:
        process_single(name)
    frappe.db.commit()

    remaining = frappe.db.count("Sales Invoice", {"custom_processed": 0})
    if remaining > 0:
        frappe.enqueue(
            "myapp.tasks.process_batch",
            queue="long",
            offset=offset + batch_size,
            batch_size=batch_size,
            total=total
        )

Rule: ALWAYS split tasks >25 min into self-chaining batches.


Common Implementation Patterns

Show full SKILL.md (188 more words)Show less
Email Digest (weekly summary)
python
# hooks.py
scheduler_events = {
    "cron": {
        "0 8 * * 1": ["myapp.newsletter.send_weekly_digest"]
    }
}

See references/examples.md Example 4 for complete implementation.

Data Cleanup (daily maintenance)
python
scheduler_events = {
    "daily_long": ["myapp.maintenance.daily_database_maintenance"]
}

See references/examples.md Example 1 for batch deletion pattern.

Report Generation (user-triggered)
python
frappe.enqueue(
    "myapp.tasks.generate_report",
    queue="long",
    timeout=3600,
    job_id=f"report::{frappe.session.user}",
    user=frappe.session.user
)

See references/workflows.md Workflow 6 for progress reporting.


Critical Rules

  1. Scheduler tasks receive NO arguments - Use settings or hardcoded values
  2. ALWAYS bench migrate after hooks.py changes - Required to register events
  3. Jobs run as Administrator - ALWAYS commit explicitly
  4. Commit in batches - NEVER per-record (every 100-500 records)
  5. ALWAYS use job_id for user-triggered jobs - Prevents duplicates
  6. Use enqueue_after_commit=True from document events - Ensures data exists
  7. Scheduler events should be thin - Enqueue heavy work to background

Version Differences

Aspectv14v15v16
Tick interval240s60s60s
Job dedup paramjob_namejob_idjob_id
enqueue_doc()YesYesYes
Custom queuesNoYesYes

Reference Files

FileContents
workflows.md8 step-by-step implementation patterns
decision-tree.mdDetailed decision flowcharts
examples.md5 complete working examples
anti-patterns.md14 common mistakes to avoid

See Also

  • frappe-syntax-scheduler - Exact syntax reference for hooks and enqueue
  • frappe-errors-serverscripts - Error handling patterns
  • frappe-impl-hooks - Hook configuration patterns
  • frappe-ops-bench - Bench commands for scheduler management
  • frappe-ops-performance - Performance tuning for background jobs
  • frappe-testing-unit - Testing scheduled task logic

© Impertio-Studio, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in skills/source/impl/frappe-impl-scheduler of Impertio-Studio/Frappe_Claude_Skill_Package.

  • SKILL.md
  • references/anti-patterns.md
  • references/decision-tree.md
  • references/examples.md
  • references/workflows.md

Open the folder on GitHubat commit 36cfa80

Compare with similar skills

Frappe Impl Scheduler next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Frappe Impl Scheduler compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Frappe Impl Scheduler this skillImpertio-Studio/Frappe_Claude_Skill_Package188—~2.4kAutomated safety check: PassMIT
Worker DevelopmentChatbotXIO/ChatbotX881—~2.7kAutomated safety check: NotesCustom licence
Cronshibing624/agentica352—~317Automated safety check: PassApache-2.0
AI Automation WorkflowsNeverSight/learn-skills.dev2161 repos~2.6kAutomated safety check: PassNone
Convex Cronsopenclaw/clawhub9.5k1 repos~189Automated safety check: PassMIT
Minimal Web Baas DemoTencentCloudBase/CloudBase-AI-Toolkit1.1k1 repos~2.2kAutomated safety check: PassMIT

Similar skills

  • Worker Development

    ChatbotXIO/ChatbotX

    Create and manage background workers, BullMQ queues, and scheduled jobs.

    881 GitHub stars~2.7k tokensUpdated today
    Productivity & AutomationAuto-check: notes
  • Cron

    shibing624/agentica

    Schedule, list, pause, resume, edit, or run the user's agentica cron jobs with the cronjob tool.

    352 GitHub stars~317 tokensUpdated today
    Productivity & AutomationAuto-check passed
  • AI Automation Workflows

    NeverSight/learn-skills.dev

    Build automated AI workflows combining multiple models and services.

    216 GitHub starsUsed in 1 repo~2.6k tokens
    Productivity & AutomationAuto-check passed
  • Convex Crons

    openclaw/clawhub

    Add recurring scheduled jobs (crons) to the Convex app. An agent skill from openclaw/clawhub.

    9.5k GitHub starsUsed in 1 repo~189 tokens
    Productivity & AutomationAuto-check passed
  • Minimal Web Baas Demo

    TencentCloudBase/CloudBase-AI-Toolkit

    Fast path for a minimal CloudBase Web + database demo (最小前后端 / 最小可用 fullstack / Lovable-like BaaS).

    1.1k GitHub starsUsed in 1 repo~2.2k tokens
    Productivity & AutomationAuto-check passed
  • Task Runner

    LeoYeAI/openclaw-master-skills

    Persistent task queue system. An agent skill from LeoYeAI/openclaw-master-skills.

    2.2k GitHub stars~4.1k tokensUpdated 2 mo ago
    Productivity & AutomationAuto-check passed

More from Impertio-Studio/Frappe_Claude_Skill_Package

All 61 skills in this repo
  • Frappe Ops Website Deploy

    Impertio-Studio/Frappe_Claude_Skill_Package

    Deploy HTML/CSS websites to ERPNext/Frappe (v15/v16) as Web Pages via the REST API.

    188 GitHub stars~2.5k tokensUpdated 22 days ago
    Auto-check passed
  • Frappe Agent Architect

    Impertio-Studio/Frappe_Claude_Skill_Package

    A skill your agent uses when designing multi-app Frappe architectures, deciding whether to split functionality into separate apps, or implementing cross-app communication patterns.

    188 GitHub stars~2.8k tokensUpdated 22 days ago
    Auto-check passed
  • Frappe Agent Debugger

    Impertio-Studio/Frappe_Claude_Skill_Package

    A skill your agent uses when debugging Frappe errors, using bench console for live inspection, analyzing tracebacks, or reading Frappe log files.

    188 GitHub stars~2.9k tokensUpdated 22 days ago
    Auto-check passed
  • Frappe Agent Interpreter

    Impertio-Studio/Frappe_Claude_Skill_Package

    A skill your agent uses when receiving vague or unclear ERPNext/Frappe development requests that need interpretation.

    188 GitHub stars~3.2k tokensUpdated 22 days ago
    Auto-check passed
  • Frappe Agent Migrator

    Impertio-Studio/Frappe_Claude_Skill_Package

    A skill your agent uses when migrating a Frappe app between major versions, detecting breaking API changes, or resolving post-migration errors.

    188 GitHub stars~2.8k tokensUpdated 22 days ago
    Auto-check: notes
  • Frappe Agent Validator

    Impertio-Studio/Frappe_Claude_Skill_Package

    A skill your agent uses when reviewing or validating Frappe/ERPNext code against best practices and common pitfalls.

    188 GitHub stars~2.8k tokensUpdated 22 days ago
    Auto-check passed

Questions about Frappe Impl Scheduler

What does Frappe Impl Scheduler do?

A skill your agent uses when implementing scheduled tasks and background jobs in Frappe v14/v15/v16. Frappe Impl Scheduler is an agent skill from Impertio-Studio/Frappe_Claude_Skill_Package. Use when implementing scheduled tasks and background jobs in Frappe v14/v15/v16.

When should I use Frappe Impl Scheduler?

Frappe Impl Scheduler fits situations like: implementing scheduled tasks and background jobs in Frappe v14/v15/v16; tasks that involve Scheduled and recurring tasks; tasks that involve Background jobs.

How do I install Frappe Impl Scheduler in Claude Code?

Run `npx skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-impl-scheduler -a claude-code`. Or copy the skill folder (skills/source/impl/frappe-impl-scheduler in Impertio-Studio/Frappe_Claude_Skill_Package) into .claude/skills/frappe-impl-scheduler in your project. Claude Code loads it when a task matches its description.

How do I install Frappe Impl Scheduler in Codex?

Run `npx skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-impl-scheduler -a codex`. Or copy the skill folder (skills/source/impl/frappe-impl-scheduler in Impertio-Studio/Frappe_Claude_Skill_Package) into .agents/skills/frappe-impl-scheduler in your project. Codex loads it when a task matches its description.

Can I use Frappe Impl Scheduler in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-impl-scheduler -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/frappe-impl-scheduler, .gemini/skills/frappe-impl-scheduler, .github/skills/frappe-impl-scheduler and .opencode/skills/frappe-impl-scheduler in your project.

What does Frappe Impl Scheduler need to run?

SKILL.md names no scripts, command-line tools or credentials: Frappe Impl Scheduler is instructions for the agent only. Our summary lists: Python 3. Compatibility (from SKILL.md): Claude Code, Claude.ai Projects, Claude API. Frappe v14-v16..

Does Frappe Impl Scheduler access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Frappe Impl Scheduler safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Frappe Impl Scheduler use?

Frappe Impl Scheduler is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Frappe Impl Scheduler use?

About 2.4k tokens (SKILL.md is roughly 9.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 18k tokens, read only when the agent opens those files.

What are the alternatives to Frappe Impl Scheduler?

Skills that share tags, products or a category with Frappe Impl Scheduler: Worker Development (ChatbotXIO/ChatbotX, 881 stars), Cron (shibing624/agentica, 352 stars), AI Automation Workflows (NeverSight/learn-skills.dev, 216 stars) and Convex Crons (openclaw/clawhub, 9.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Frappe Impl Scheduler?

Impertio-Studio (a GitHub organization) maintains it in Impertio-Studio/Frappe_Claude_Skill_Package, which has 188 GitHub stars. The repository holds 61 skills in this directory. The repository was last updated on September 17, 2026.

Source: Impertio-Studio/Frappe_Claude_Skill_Package on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.