Toki.

Docs/Merchants/Workflows & Timers

Workflow triggers

A trigger is the first step of every workflow. It's the moment Toki watches for: a customer earns points, unlocks a tier, adds a product to their wishlist, or a timer goes off. When that moment happens, the workflow runs for the customer involved, and the details of the moment, such as the points amount or the tier name, are available to every step that follows.

How triggers work

  • A workflow has exactly one trigger, and it's always the first step. You can change which trigger it is, but you can't remove it. If you try, Toki shows "Cannot delete trigger node".
  • Each time the trigger happens, the workflow runs for the customer it happened to. The Timer Triggered trigger is the exception: it runs on a schedule you set, not because of a customer. See Timers.
  • Only workflows with Workflow status set to Active react to triggers. A Draft workflow is saved but sits still until you switch it to Active. You can still test a draft. See Workflow test runs and execution history.

Pick a trigger for a new workflow

  1. In the Toki app, click Workflows in the left navigation, then click New Workflow.
  2. The empty canvas shows a "Start Your Workflow" box. Click Select Trigger.
  3. Type in Search triggers... to filter the list by name or description, then click the trigger you want. Toki places it on the canvas as the first step.
  4. Click the + button under the trigger step and choose Add Condition or Add Action to build the rest of the workflow.
  5. Give the workflow a Workflow name and click Save.

Change or edit the trigger

  1. Open the workflow and hover over the trigger step. Click the edit icon.
  2. Change the fields you need.
  3. Click Save to keep your changes, or Cancel to leave the step as it was. Then save the workflow.
FieldWhat it does
Trigger TypeThe moment that starts the workflow. Type to search the list. Picking a new one also resets the step's Label and Description to match.
LabelThe name shown on the trigger step in the canvas. Starts out as the trigger's name.
DescriptionA short note shown under the label on the step. Starts out as the trigger's description.
HandleAdvanced option. Leave it as it is unless we've set something up with you.
Enable Run InputAdvanced option. Chat with us and we'll set it up with you.

When Trigger Type is Timer Triggered, the step also shows "You can configure timers here:" with a Timers link. That's where you create the schedule. See Timers.

If you switch a workflow to a different trigger after building it, the variable picker in later steps lists the new trigger's values. Review any conditions or actions that used values from the old trigger.

Trigger reference

Trigger Type is one searchable list. The tables below group the same triggers by topic so they're easier to scan. Unless a row says otherwise, the workflow runs for the customer the moment happened to.

Points and rewards

TriggerWhen it fires
Points EarnedPoints are added to a customer's account, from any source.
Points SpentA customer spends points.
Redemption CreatedA customer redeems points and receives a discount code. See Redemption options.
Reward CreatedA customer earns a discount or free-gift reward and Toki issues the code.
Automated Gift SentToki sends a customer a free product as an automated gift.
Transactions DeletedPoints transactions are removed from a customer's history.

Activities and challenges

TriggerWhen it fires
Activity CompletedA customer completes an activity from your Ways to Earn.
Voting Activity CompletedA customer answers a voting activity.
Activity/Challenge ApprovedYou approve a completion that was waiting for your review. See Reward approvals.
Activity/Challenge DeniedYou deny a completion that was waiting for your review.
Challenge StartedA customer starts a challenge.
Challenge ProgressA customer makes progress on a challenge they haven't finished yet.
Challenge CompletedA customer completes a challenge.
Challenge ReminderToki fires a reminder for a challenge the customer is still working on.

Memberships

TriggerWhen it fires
Membership UnlockedA customer reaches a membership tier. See Membership tiers.
Membership LostA customer drops out of a membership tier.
Paid Membership SubscribedA customer subscribes to a paid membership. See Paid memberships.
Paid Membership Trial UsedA customer uses a paid membership trial.
Paid Membership RenewedA paid membership renews.
Paid Membership Renewal Payment FailedA paid membership renewal payment fails. See Paid membership billing.
Paid Membership Cancellation RequestedA customer asks to cancel a paid membership.
Paid Membership CancelledA paid membership is cancelled.

Segments

TriggerWhen it fires
Segment UnlockedA customer becomes part of a segment. See Segments.
Segment LostA customer leaves a segment.
Segment ReminderToki fires a reminder for a segment with Reminder Settings turned on, ahead of the customer's exit date from the segment.

Referrals

TriggerWhen it fires
Referred a FriendA friend uses a customer's referral code on an order. The workflow runs for the customer who shared the code. See Referral rewards.
Referral Code UsedThe same moment, but the workflow runs for the friend who used the code.
Send Refer a Friend InviteA customer sends a refer-a-friend invite.
Referral Properties UpdatedA customer's referral link or referral discount is updated.

Accounts, sign-ups, and birthdays

TriggerWhen it fires
Account CreatedA customer creates their loyalty account.
AuthenticatedA customer signs in to your loyalty program for the first time.
Newsletter Sign UpA customer signs up for your newsletter through Toki.
Klaviyo SubmissionA customer submits a Klaviyo form connected to Toki.
BirthdayIt's the customer's birthday.
Birthdate ChangedA customer adds or changes their birthdate.

Wishlists

TriggerWhen it fires
Wishlist Item AddedA customer adds a product to their wishlist.
Wishlist Item RemovedA customer removes a product from their wishlist.
Wishlist Collections ChangedA customer's wishlist collections change.

Orders and gift cards

TriggerWhen it fires
Order ProcessedToki finishes processing one of the customer's orders.
Product Gift Card GiftedA customer sends a gift card to someone. The workflow runs for the sender. See Gift card products.
Product Gift Card DeliveredA gift card reaches its recipient. The workflow runs for the recipient. See Gift card delivery and emails.

Reviews

TriggerWhen it fires
Review CreatedA customer submits a review.
Request ReviewA review request is created for a customer, for example by the Request Review action in another workflow.

Schedules

TriggerWhen it fires
Timer TriggeredOne of your active timers goes off. Create and manage timers on the Timers page. See Timers.

Advanced

TriggerWhen it fires
Webhook ReceivedAdvanced. Starts the workflow when another system sends Toki a signal. Chat with us and we'll set it up with you.
InitAdvanced. Chat with us and we'll set it up with you.

Variables: use the trigger's details in later steps

A variable is a placeholder that Toki fills in with a real value when the workflow runs. Variables are written in double curly braces, for example {{customer.email}}. If an email step's To (Email Address) field reads {{customer.email}}, the email goes to whichever customer set the workflow off.

You don't have to type variables by hand. Every field that accepts them has an Add variable button next to it (a few fields call it Insert variable), and a condition's Variable section has Select variable. Clicking it opens the variable picker:

  1. Type in Search by variable name or description to filter, or scroll the groups.
  2. Look for the Trigger group. It holds everything the trigger knows about the moment and the customer.
  3. Click a value to add it. Toki appends its placeholder to the end of the field. Values with an arrow, such as Customer, open a sub-list; click the arrow at the top of the picker to go back.

Every entry shows its name, a short description, and the exact placeholder text it inserts, so what you see in the picker is what ends up in your field.

Values every workflow has

No matter which trigger you pick, the Trigger group includes:

ValuePlaceholderWhat it holds
CustomerCustomer ID{{customer.id}}The customer's Shopify customer ID, as a number.
CustomerCustomer Email{{customer.email}}The customer's email address.
CustomerCustomer Name{{customer.name}}The customer's full name.
User Properties{{userProperties.…}}The customer's loyalty details, such as Point Balance, Tier Name, Referral Link, and Birthdate. Open the group in the picker for the full list and each value's placeholder.

Values specific to the trigger

Each trigger adds the details of its own moment to the Trigger group. For example, Points Earned adds Points Amount, Challenge Completed adds Challenge Name, Redemption Created adds Discount Code, and Timer Triggered adds Timer Id. The picker always shows the exact set for the trigger you picked, so open it in any step below the trigger to see what's available.

Action steps add their own values too, grouped under the step's Label. The Create Gift Card workflow action is one example: later steps can use the code and balance of the card it created.

Triggers and the actions you can add

Most actions are available with every trigger. Three actions that change many customers at once are offered only in workflows that start with Timer Triggered: Change Activity Status, Update Segment, and Delete All Store Credits. If you don't see one of them in Action Type, check the workflow's trigger.

Test a trigger

You don't have to wait for a customer to set off the trigger. Save the workflow, click Test, pick a customer, and fill in the Trigger fields with the values the trigger would normally carry. See Workflow test runs and execution history.

Related

Didn't find what you need? Chat with us — a human answers, usually within the hour.