You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are multiple triggers that can be used ([trigger docs]):
217
+
218
+
-[IntervalTrigger]: use when you want to run the task at fixed intervals of time.
219
+
-[CronTrigger]: use when you want to run the task periodically at certain time(s) of day.
220
+
-[DateTrigger]: use when you want to run the task just once at a certain point of time.
221
+
-[CalendarIntervalTrigger]: use when you want to run the task on calendar-based intervals, at a specific time of day.
222
+
-[AndTrigger]: use when you want to combine multiple triggers so the task only runs when **all** of them would fire at the same time.
223
+
-[OrTrigger]: use when you want to combine multiple triggers so the task runs when **any one** of them would fire.
224
+
225
+
For detailed configuration options, see the [APScheduler scheduling docs].
226
+
227
+
The scheduler automatically loads any schedules that are imported before the scheduler starts.
228
+
229
+
> In previous versions, schedules needed to be explicitly listed in an ALL_SCHEDULERS variable.
230
+
> This is no longer required; ALL_SCHEDULERS is deprecated as of orchestrator-core 4.7.0 and will be removed in 5.0.0.
231
+
> Follow-up ticket to remove deprecated code: [#1276](https://github.com/workfloworchestrator/orchestrator-core/issues/1276)
232
+
155
233
## The scheduler
156
234
157
235
The scheduler is invoked via `python main.py scheduler`.
158
236
Try `--help` or review the [CLI docs][cli-docs] to learn more.
159
237
238
+
### Initial schedules
239
+
From version orchestrator-core >= `4.7.0`, the scheduler uses the database to store schedules instead of hard-coded schedule files.
240
+
Previous versions (orchestrator-core < `4.7.0` had hard-coded schedules. These can be ported to the new system by creating them via the API or CLI.
241
+
Run the following CLI command to import previously existing orchestrator-core schedules and change them if needed via the API.
242
+
243
+
```shell
244
+
python main.py scheduler load-initial-schedule
245
+
```
246
+
247
+
> Remember, that if you do not explicitly import these, they will not be available to the scheduler.
160
248
### Manually executing tasks
161
249
162
250
When doing development, it is possible to manually make the scheduler run your task even if your Orchestrator instance is not in "scheduler mode."
@@ -165,11 +253,11 @@ Shell into your running instance and run the following:
165
253
166
254
```shell
167
255
docker exec -it backend /bin/bash
168
-
python main.py scheduler force run_nightly_sync
256
+
python main.py scheduler force "c1b6e5e3-d9f0-48f2-bc65-3c9c33fcf561"
169
257
```
170
258
171
-
...where `run_nightly_sync` is the job defined in the schedule file - not the name of the task.
172
-
This doesn't depend on the UI being up, and you can get the logging output.
259
+
...where `c1b6e5e3-d9f0-48f2-bc65-3c9c33fcf561` is the job id of the schedule you want to run.
260
+
The job id can be found via the GraphQL API or directly in the database.
173
261
174
262
### Starting the scheduler
175
263
@@ -213,30 +301,6 @@ fi
213
301
```
214
302
215
303
216
-
## Developer notes
217
-
218
-
### Executing multiple tasks
219
-
220
-
If one needs to execute multiple tasks in concert with each other, one can not call a task from another task. Which is to say, calling `start_process` is a "top level" call. Trying to call it inside an already invoked task does not work.
221
-
222
-
But the schedule (ie: crontab) files are also code modules so one can achieve the same thing there:
Copy file name to clipboardExpand all lines: docs/guides/upgrading/4.0.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,3 +71,26 @@ This will update the `target` for all workflows that are `SYSTEM` or `VALIDATE`
71
71
72
72
This is a breaking change, so you will need to test your workflows after making this change to ensure that they are
73
73
working as expected.
74
+
75
+
## Scheduling flows
76
+
In 4.4.0 we have introduced a new way to schedule workflows via the decorator [@scheduler.scheduled_job(...)](../tasks.md#the-schedule-file-deprecated).
77
+
In 4.7.0 we introduce a new way to schedule workflows via the [Scheduler API](../tasks.md#the-schedule-api).
78
+
79
+
The 4.7.0 migration will create the `apscheduler_jobs` table if missing, so upgrades from older versions still succeed, but the table will initially be empty.
80
+
81
+
### Who needs to take action?
82
+
83
+
**Users upgrading from 4.4–4.6:**
84
+
- Nothing special required; your scheduler data already exists.
85
+
86
+
**Users upgrading from <4.4 who used the old decorator:**
87
+
- Your schedules will not automatically reappear. Restore them by running:
Copy file name to clipboardExpand all lines: docs/reference-docs/websockets.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ The main component is the `WebSocketManager` (WSM) which has the following respo
18
18
3. Provide an interface to pass messages from a backend process (workflow/task)
19
19
20
20
In a setup with multiple isolated Orchestrator instances the WSM is initialized multiple times as well, therefore clients can be connected to any arbitrary WSM instance.
21
-
Letting a backend process broadcast messages to all clients thus requires a message broker, for which we use [Redis Pub/Sub](https://redis.io/docs/manual/pubsub).
21
+
Letting a backend process broadcast messages to all clients thus requires a message broker, for which we use [Redis Pub/Sub](https://redis.io/docs/latest/develop/pubsub/).
22
22
23
23
There are 2 WSM implementations: a `MemoryWebsocketManager` for development/testing, and a `BroadcastWebsocketManager` that connects to Redis. We'll continue to discuss the latter.
0 commit comments