BlockLogic

Run a custom block at a later time, like in 10 minutes or 3 days. Its inputs are saved when it's scheduled.

When is a duration from now (30s, 10m, 3d, 2w) or a Unix timestamp. Scheduling a key that's already scheduled replaces that run, or keeps it with "Keep Existing". The custom block runs on its own when it's due, without this flow's trigger, so pass in anything it needs (like a user or channel ID).
  • Also takes the inputs defined by the custom block it runs.

Inputs

Custom BlockRequired

The custom block to run.

WhenRequired

A duration from now (30s, 10m, 3d) or a Unix timestamp.

Example: 1d

Key

Names the run so it can be replaced, checked or cancelled later. Leave empty to generate one.

Example: giveaway-123

If Key Is Scheduled

What to do when this key is already scheduled.

OptionsReplaceKeep Existing

Outputs

Key

The run's key, generated when none was given.

Example: giveaway-123

Run At (Unix)

When the custom block will run.

Example: 1700003600

Scheduled

False when the key was already scheduled and kept as it was.

Example: true

Build a bot using blocks like Run Later

Use this block in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.

Advanced Documentation

This documentation can be useful when using code mode.

ID: run_later
  • Also takes the custom block's inputs as Args keys. See custom blocks.

Inputs

FieldInventScript nameValue
Custom Blocktarget_component_id
Whenschedule_whene.g. "1d"
Keyschedule_keye.g. "giveaway-123"
If Key Is Scheduledschedule_if_exists"Replace", "Keep Existing"

Outputs

FieldInventScript nameValue
Keykeye.g. "giveaway-123"
Run At (Unix)run_ate.g. "1700003600"
Scheduledschedulede.g. "true"

Example InventScript

runLater := run_later(Args{target_component_id: "...", schedule_when: "1d"})
send_text_message(Args{channel_id: trigger.channel_id, message_content: "Key: " + runLater.key})

More logic blocks