Toki.

Docs/Merchants/Workflows & Timers

Timers

A timer starts a workflow at a time you choose, instead of waiting for a customer to do something. Set it to run once on a specific date and time, or to repeat at a fixed interval, such as every day or every 7 days. Timers are made for scheduled housekeeping across your whole program, like clearing all store credits at the end of a season or switching an activity on for a launch day.

How timers work with workflows

A timer's only job is to go off at the right time. When it does, every workflow that starts with the Timer Triggered trigger runs in response. The timer decides when; the workflow decides what.

A timer run is not tied to a specific customer. Because of that, some bulk actions that apply to many customers at once are only offered in workflows that start with the Timer Triggered trigger.

Open the Timers page

The Timers page is reached from a workflow's trigger:

  1. In the Toki app, click Workflows in the left navigation and open the workflow you want to run on a schedule, or create a new one.
  2. Hover over the trigger step and click the edit icon.
  3. Set Trigger Type to Timer Triggered.
  4. Below the field, next to "You can configure timers here:", click Timers. The Timers page opens in a new tab.

Keep the workflow tab open. You'll come back to it once the timer exists.

Create a timer

  1. On the Timers page, click Create New Timer.
  2. Under Settings, enter a Name. A name is required.
  3. Under Configuration, pick a Type: One-time or Recurring.
  4. Set the Start Date: the date and time of the first run. It has to be in the future.
  5. For a recurring timer, set the Repeat Interval in days, hours, and minutes. It starts at 1 day.
  6. Set Status to Active to put the timer on the schedule, or leave it as Draft to finish later.
  7. Click Save in the save bar.

Toki confirms with "Saved" and opens the timer. From now on, its page shows a Recent Executions card with every run.

SettingWhat it does
NameHow the timer appears in the Timers list and when you pick it in a workflow. Required.
StatusActive timers run. Draft timers are saved but never go off.
TypeOne-time: "Timer will run once at the specified date and time." Recurring: "Timer will run repeatedly at the specified interval."
Start DateWhen the timer goes off for the first time. Every time you save the timer, this date has to be in the future.
Repeat IntervalRecurring timers only. How often the timer repeats, entered as days, hours, and minutes.

When a timer runs

  • A One-time timer goes off once, at its Start Date.
  • A Recurring timer goes off at its Start Date, then again after each Repeat Interval. The next run is counted from the moment the previous run happened, not from the original start date. For example, a timer that starts on a Monday with an interval of 7 days runs every Monday.

Each run shows up in the timer's Recent Executions card as Waiting while it sits on the schedule, then Running, then Completed. More on that below.

Active and Draft

Only Active timers go off.

Switching a timer to Draft and saving cancels its scheduled run right away. Nothing happens until you switch it back to Active and save. Because the Start Date has to be in the future whenever you save, pick a fresh Start Date when you reactivate a timer whose original date has passed.

The same rule applies to any edit. When you change a timer that has already started, for example to rename it or change its interval, set a new Start Date before saving. The next run moves to that date, and a recurring timer keeps repeating from there.

Pick which timer starts a workflow

A workflow with the Timer Triggered trigger runs whenever any of your active timers goes off. If you have more than one timer, add a condition so the workflow only continues for the right one:

  1. In the workflow, click the + button under the trigger step and choose Add Condition. Then open the new condition step.
  2. Click Add Condition inside the step.
  3. Under Variable, click Select variable and pick Timer Id from the trigger's variables.
  4. Set Operator to Equals.
  5. In the Timers field, pick the timer from the list ("Select a timer").
  6. Save the workflow.

Now the workflow's actions only run when that timer goes off.

Follow a timer's runs

Open a timer from the Timers page. The Recent Executions card lists its runs, newest first, 5 per page. Use the arrows under the table to see older runs. The card refreshes on its own every 10 seconds.

ColumnWhat it shows
Scheduled AtThe date and time the run was set to go off.
StatusWaiting: on the schedule. Running: going off right now. Completed: the timer went off and its workflows were started. Failed: something stopped this run. Chat with us and we'll look into it with you.
ErrorDetails for a Failed run. Shows "-" for every other run.

A run that was canceled because you switched the timer to Draft stays in the list with a canceled badge, for your records.

A timer that hasn't run yet shows "No executions yet" instead of the table.

Find and edit timers

The Timers page lists all your timers with their Name and Status (Active or Draft), most recently updated first. The list shows 10 timers per page and refreshes on its own every 30 seconds.

  • Type in Search timers to filter the list by name.
  • Click a timer, or its Edit link, to open it.
  • Make your changes and click Save in the save bar, or Discard to undo them. If you try to leave with unsaved changes, Toki asks you to save or discard them first.

Delete a timer

  1. Open the timer.
  2. Click Delete at the top of the page.
  3. In the "Delete [timer name]?" dialog, click Delete to confirm, or Cancel to keep the timer.

Toki confirms with "Deleted" and returns to the Timers page. Deleting is permanent, as the dialog says: "This action cannot be undone." A deleted timer never goes off again, so any workflow that depended on it simply stops running on that schedule. The workflow itself stays as it is.

Related

  • Workflows: the Workflows page, the canvas, Draft and Active, saving and deleting.
  • Workflow triggers: the Timer Triggered trigger that timers start.
  • Workflow conditions: the Timer Id condition that ties a workflow to one timer.
  • Workflow actions: the actions that appear only in timer-triggered workflows.
  • Store credits: what store credits are, if you plan to clear them on a schedule.
Didn't find what you need? Chat with us — a human answers, usually within the hour.