-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadvanced-scheduler-workflow.yaml
More file actions
86 lines (74 loc) · 2.35 KB
/
advanced-scheduler-workflow.yaml
File metadata and controls
86 lines (74 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Advanced Scheduler Workflow Example Configuration
# This demonstrates a more complex scheduler workflow with multiple jobs and schedules
requires:
plugins:
- name: messaging
- name: modular-compat
modules:
# Define schedulers with different cron patterns
- name: minutely-scheduler
type: scheduler.modular
config:
cronExpression: "* * * * *" # Run every minute
- name: hourly-scheduler
type: scheduler.modular
config:
cronExpression: "0 * * * *" # Run at the start of every hour
- name: daily-scheduler
type: scheduler.modular
config:
cronExpression: "0 0 * * *" # Run at midnight every day
# Define job handlers
- name: system-stats-job
type: messaging.handler
config:
description: "Collects system statistics"
- name: data-cleanup-job
type: messaging.handler
config:
description: "Cleans up old data"
- name: report-generator-job
type: messaging.handler
config:
description: "Generates daily reports"
- name: health-check-job
type: messaging.handler
config:
description: "Performs health checks on services"
workflows:
scheduler:
jobs:
# System statistics job runs every minute
- scheduler: minutely-scheduler
job: system-stats-job
config:
metrics: ["cpu", "memory", "disk", "network"]
retention: "24h"
# Health check job runs every hour
- scheduler: hourly-scheduler
job: health-check-job
config:
endpoints:
- name: "api-server"
url: "http://localhost:8080/health"
- name: "database"
url: "http://localhost:5432/health"
- name: "cache"
url: "http://localhost:6379/health"
# Data cleanup job runs every day at midnight
- scheduler: daily-scheduler
job: data-cleanup-job
config:
tables: ["logs", "events", "metrics"]
olderThan: "30d"
# Report generation job runs every day at midnight
- scheduler: daily-scheduler
job: report-generator-job
config:
reportTypes: ["system-health", "performance", "errors"]
format: "pdf"
destinations:
- type: "email"
recipients: ["admin@example.com", "alerts@example.com"]
- type: "storage"
path: "/reports"