Aller au contenu
Skillpedia
Automatisations25k · #10105

nocobase-app-plugin-scheduler

Ce qu’il fait

Cette skill guide les développeurs dans la création de tâches planifiées d'une application NocoBase 3, dont le statut est visible par les administrateurs métier. Elle s'adresse aux équipes qui doivent suivre des travaux récurrents.

Quand l’utiliser

  • ✓Quand les administrateurs métier doivent voir et suivre les tâches récurrentes de l'application.
  • ✓Quand vous voulez définir un planning dans le code, avec un statut visible dans l'interface.
  • ✓Quand une tâche d'arrière-plan n'a pas besoin d'être visible dans l'interface, et qu'un autre mécanisme de travaux est préférable.

Lien du skill

https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-scheduler/skills/nocobase-app-plugin-scheduler/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-scheduler/skills/nocobase-app-plugin-scheduler/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Je voudrais ajouter une tâche de nuit qui archive les anciennes commandes, et permettre aux administrateurs de voir ses exécutions et de la désactiver.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'IA définit le planning et sa logique d'exécution dans le code, enregistre la cible et signale le statut final. Scheduler conserve l'historique des déclenchements pour que les administrateurs suivent chaque exécution.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

Develop Scheduled Tasks in an Application

Use the installed version's public exports, without importing plugin internals. The application owns business logic, schedule declarations, Providers, permissions, and deployment timing. Scheduler owns scheduling projections, trigger history, and execution state. The plugin's skills/ directory is the source of truth; do not edit the synchronized application copy under .agents/skills/.

Decide Whether to Use Scheduler

The primary reason to define tasks through Scheduler is UI observability for business administrators. Developers define schedules and execution logic in code. Business administrators use the task list and detail pages the application builds on the Scheduler API to view schedules, track individual executions, and enable or disable tasks when authorized.

Tasks that do not need to be viewed and tracked through the UI must not be managed by the Scheduler plugin. Give recurring ones a ScheduleExecutor of their own from the application's jobs service (jobExecutorServiceToken in @nocobase/app-server/jobs), and one-off background work a JobExecutor; the application development Skill describes both. For administrator-visible tasks, deliver Client registration, access permissions, meaningful task names, and accurate final execution status together; successful server-side dispatch alone is incomplete.

Then Choose the Execution Model

After deciding to use Scheduler, choose according to business complexity:

Scenario Choice Implementation boundary
Periodic cleanup, cache refresh, a single report, or one business Service call Own target type Short operations may complete directly; hand lengthy work to a JobExecutor
A simple operation that happens hourly Own target type Cron alone is not a reason to introduce a heavier execution system
Immediate asynchronous execution JobExecutor No Cron Schedule is needed
A one-time delay, such as ten minutes after a request Queue delay No Cron Schedule is needed; JobExecutor has no delay
Another execution system with its own references, status queries, and completion protocol Own target type The same registerTarget() call, with inspect() and completion reporting for work that finishes later

Every schedule points at a registered target; registerTarget() is the target extension surface, and there is no built-in target type. A target does not guarantee exactly-once external business effects; design business idempotency.

Read by Task

Development Loop

  1. Establish which tasks and execution records administrators need to see. Check Server/Client/CLI registration, page permissions, the application's jobs configuration (a redis adapter for more than one instance; memory serves one process) and JobExecutorServiceProvider composition and target availability, then choose or register the target type.
  2. Implement business logic and Providers in application source, and call schedulerServiceToken.defineSchedule(definition) with an application-wide stable key from that Provider's register()/boot().
  3. Validate payload/inpu
Questions fréquentes

Chaque tâche d'arrière-plan doit-elle utiliser Scheduler ?

Non. La skill indique que les tâches qui n'ont pas besoin de visibilité dans l'interface ne doivent pas l'utiliser.

Qui peut activer ou désactiver une tâche ?

Les administrateurs métier autorisés, depuis l'interface.

Scheduler contient-il la logique métier ?

Non. L'application possède la logique, et Scheduler gère la planification et le statut.

Détails

Description originale de l’auteur

Develop scheduled tasks in NocoBase 3 that business administrators need to view and track through the application UI. Define schedules in code, register the target a schedule points at, integrate execution status, and report completion. Do not use Scheduler to manage tasks that do not need UI visibility.

repo: nocobase/nocobase

Popularité

Étoiles GitHub
25k
Position au classement
#10105
Licence
—
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires