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
- In the Toki app, click Workflows in the left navigation, then click New Workflow.
- The empty canvas shows a "Start Your Workflow" box. Click Select Trigger.
- 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.
- Click the + button under the trigger step and choose Add Condition or Add Action to build the rest of the workflow.
- Give the workflow a Workflow name and click Save.
Change or edit the trigger
- Open the workflow and hover over the trigger step. Click the edit icon.
- Change the fields you need.
- Click Save to keep your changes, or Cancel to leave the step as it was. Then save the workflow.
| Field | What it does |
|---|---|
| Trigger Type | The moment that starts the workflow. Type to search the list. Picking a new one also resets the step's Label and Description to match. |
| Label | The name shown on the trigger step in the canvas. Starts out as the trigger's name. |
| Description | A short note shown under the label on the step. Starts out as the trigger's description. |
| Handle | Advanced option. Leave it as it is unless we've set something up with you. |
| Enable Run Input | Advanced 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
| Trigger | When it fires |
|---|---|
| Points Earned | Points are added to a customer's account, from any source. |
| Points Spent | A customer spends points. |
| Redemption Created | A customer redeems points and receives a discount code. See Redemption options. |
| Reward Created | A customer earns a discount or free-gift reward and Toki issues the code. |
| Automated Gift Sent | Toki sends a customer a free product as an automated gift. |
| Transactions Deleted | Points transactions are removed from a customer's history. |
Activities and challenges
| Trigger | When it fires |
|---|---|
| Activity Completed | A customer completes an activity from your Ways to Earn. |
| Voting Activity Completed | A customer answers a voting activity. |
| Activity/Challenge Approved | You approve a completion that was waiting for your review. See Reward approvals. |
| Activity/Challenge Denied | You deny a completion that was waiting for your review. |
| Challenge Started | A customer starts a challenge. |
| Challenge Progress | A customer makes progress on a challenge they haven't finished yet. |
| Challenge Completed | A customer completes a challenge. |
| Challenge Reminder | Toki fires a reminder for a challenge the customer is still working on. |
Memberships
| Trigger | When it fires |
|---|---|
| Membership Unlocked | A customer reaches a membership tier. See Membership tiers. |
| Membership Lost | A customer drops out of a membership tier. |
| Paid Membership Subscribed | A customer subscribes to a paid membership. See Paid memberships. |
| Paid Membership Trial Used | A customer uses a paid membership trial. |
| Paid Membership Renewed | A paid membership renews. |
| Paid Membership Renewal Payment Failed | A paid membership renewal payment fails. See Paid membership billing. |
| Paid Membership Cancellation Requested | A customer asks to cancel a paid membership. |
| Paid Membership Cancelled | A paid membership is cancelled. |
Segments
| Trigger | When it fires |
|---|---|
| Segment Unlocked | A customer becomes part of a segment. See Segments. |
| Segment Lost | A customer leaves a segment. |
| Segment Reminder | Toki fires a reminder for a segment with Reminder Settings turned on, ahead of the customer's exit date from the segment. |
Referrals
| Trigger | When it fires |
|---|---|
| Referred a Friend | A 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 Used | The same moment, but the workflow runs for the friend who used the code. |
| Send Refer a Friend Invite | A customer sends a refer-a-friend invite. |
| Referral Properties Updated | A customer's referral link or referral discount is updated. |
Accounts, sign-ups, and birthdays
| Trigger | When it fires |
|---|---|
| Account Created | A customer creates their loyalty account. |
| Authenticated | A customer signs in to your loyalty program for the first time. |
| Newsletter Sign Up | A customer signs up for your newsletter through Toki. |
| Klaviyo Submission | A customer submits a Klaviyo form connected to Toki. |
| Birthday | It's the customer's birthday. |
| Birthdate Changed | A customer adds or changes their birthdate. |
Wishlists
| Trigger | When it fires |
|---|---|
| Wishlist Item Added | A customer adds a product to their wishlist. |
| Wishlist Item Removed | A customer removes a product from their wishlist. |
| Wishlist Collections Changed | A customer's wishlist collections change. |
Orders and gift cards
| Trigger | When it fires |
|---|---|
| Order Processed | Toki finishes processing one of the customer's orders. |
| Product Gift Card Gifted | A customer sends a gift card to someone. The workflow runs for the sender. See Gift card products. |
| Product Gift Card Delivered | A gift card reaches its recipient. The workflow runs for the recipient. See Gift card delivery and emails. |
Reviews
| Trigger | When it fires |
|---|---|
| Review Created | A customer submits a review. |
| Request Review | A review request is created for a customer, for example by the Request Review action in another workflow. |
Schedules
| Trigger | When it fires |
|---|---|
| Timer Triggered | One of your active timers goes off. Create and manage timers on the Timers page. See Timers. |
Advanced
| Trigger | When it fires |
|---|---|
| Webhook Received | Advanced. Starts the workflow when another system sends Toki a signal. Chat with us and we'll set it up with you. |
| Init | Advanced. 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:
- Type in Search by variable name or description to filter, or scroll the groups.
- Look for the Trigger group. It holds everything the trigger knows about the moment and the customer.
- 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:
| Value | Placeholder | What it holds |
|---|---|---|
| Customer → Customer ID | {{customer.id}} | The customer's Shopify customer ID, as a number. |
| Customer → Customer Email | {{customer.email}} | The customer's email address. |
| Customer → Customer 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
- Workflows: the Workflows page, the canvas, Draft and Active, saving and deleting.
- Workflow conditions: compare a trigger's values and split the run into True and False paths.
- Workflow actions: what a workflow can do once it starts.
- Timers: schedule the Timer Triggered trigger and pick which timer a workflow reacts to.
- Workflow test runs and execution history: run a workflow for a customer you choose and read what each step did.
- Create Gift Card workflow action: an action that adds its own values for later steps.
- Automatic campaigns: send a message when the same kinds of moments happen, without building a workflow.
- Segments: the Reminder Settings behind Segment Reminder.