In Mechanic, the decision to schedule an event is an action all by itself. This means that the flow for scheduling looks like this:
- Task A is created, subscribing to a user event – for the sake of this example, we'll use "user/scheduler/future". This is the task that's intended to run in the future.
- Task B is created or configured to trigger that event – "user/scheduler/future" – using the Event action, with the "run_at" option specifying exactly when that event should be run.
- Task B is triggered, which runs aforementioned the Event action. This results in a "user/scheduler/future" event being scheduled for the future, which will cause Task B to be run at that time.
Tip: You can easily schedule recurring tasks, by subscribing to Mechanic's scheduler events.
Here's an example of how the Event action might be written:
"data": "this is a future event!",
"run_at": "October 10"
The "run_at" option accepts many date formats, including ISO 8601 values, and UNIX timestamps. To ensure that it's reading your date correctly, use the task preview pane on the right: