Build

Waiting and scheduling

Make a branch wait a few seconds or several days, and run a Blueprint on a schedule.

Two ways to make a Blueprint act later: wait in the middle of a flow, or schedule when it starts.

Waiting

The Wait node (Logic family) pauses what follows it on its branch: for a duration, or until a date. Delete a warning after 10 seconds, remove a temporary role after 7 days, kick a new member who didn't verify within 10 minutes, remind something in 2 hours.

Duration or date

  • For a duration: a number and a unit (seconds, minutes, hours, days).
  • Until a date: a date, or a formula that gives one, like add(now(), 7, "days") or a Date Variable. A date already past goes on at once.

A wait lasts 30 days at most. Its resumeAt output says when what follows resumes.

Only its branch waits

The other branches don't wait. After "Command /giveaway", with two links:

  1. Wait 24 hours, then draw the winner;
  2. Reply "Giveaway started!".

The reply goes out at once; the draw happens the next day. What follows the Wait resumes as an execution of its own, marked Continued in the Executions section.

Good to know

  • The data stays as it was at the start: after the wait, a member's nickname or a message's content are those from when the Event came. For a fresh value, read it again after the wait ("Read a member", "Read a message"). An Action on something gone in the meantime (a member who left, a deleted channel) takes its Failure output.
  • Replying after a wait: Discord takes a reply to an interaction for 15 minutes. A reply after a longer wait is refused by validation; after a computed date, the editor warns you, and past the delay the reply takes its Failure output. For later, send a message to the channel instead. Showing a modal after a wait is impossible: a modal must be the first reply.
  • Deploying a new version doesn't change waits in progress: they resume on the version that started them.
  • Pausing or deleting the Blueprint cancels its waits; the confirmation says how many. A suspended Blueprint keeps them, and they resume with it.
  • 500 waits at most per server: beyond that, Wait takes its Failure output.

Follow and cancel

At the top of the editor's Executions section, the waits in progress, soonest first, with when they resume. Each can be cancelled: what follows it won't run. Cancelling a wait of the deployed Blueprint takes the permission to deploy.

In a test

A wait during a test runs as in production. The Skip the wait button of the Test section resumes it at once: no need to wait 24 hours to see what follows. A "once per Event" session doesn't end while a wait hasn't resumed, and stopping the session cancels the remaining ones.

Scheduling

The Scheduled Event starts an execution on a schedule, with nothing on Discord's side: an announcement every Monday, a "Members: 1,245" channel kept up to date, a cleanup every night.

  • Every… 10, 15, 20 or 30 minutes, or 1, 2, 3, 4, 6, 8 or 12 hours. Aligned on the day: every 15 minutes runs at :00, :15, :30 and :45.
  • Every day, on some days of the week or every month, at the chosen time. A month without the chosen day (the 31st) runs on its last day.
  • Time zone: filled in with yours, and daylight saving time is followed. A time that doesn't exist (clocks going forward) runs at the first minute that does; a time that happens twice runs once.

The panel shows the next three runs. Its outputs: scheduledAt, the planned time, and firedAt, when it actually started (a few seconds later at most).

  • Nobody acts: after a scheduled Event, answering an interaction is impossible, and a member Variable must say which member.
  • Bot stopped at the planned time: the execution runs when it's back if it's less than an hour late, once; beyond that, it's skipped.
  • 25 scheduled Events at most per server, across all Blueprints.
  • Pause: a paused or suspended Blueprint no longer runs its scheduled Events; when it resumes, they start again at their next time.
  • In a test: a scheduled Event of the draft never runs by itself during the session. The Run now button of the Test section runs it. The deployed Blueprint keeps running as usual.