Docs/Merchants/Workflows & Timers
Workflow test runs and execution history
Every time a workflow runs, Toki records an execution: when it started, who it ran for, how long it took, and what each step did. You can also start a run yourself with the Test button, so you can check a workflow with a customer you pick instead of waiting for a real event. Together, test runs and the execution history show you whether a workflow does what you built it to do, and why a run stopped if it did.
Test a workflow
The Test button runs a saved workflow once, for one customer, right now.
- In the Toki app, click Workflows in the left navigation and open the workflow.
- Make sure there are no unsaved changes. Test is grayed out while the save bar is showing, so click Save first (or Discard).
- Click Test at the top of the page. The Test workflow dialog opens.
- Check Selected trigger. It shows the trigger the workflow starts with. If it says "No trigger selected", add a trigger to the workflow, save, and come back.
- Under Customer, type in Search customers and pick the member the workflow should run for. Members are listed by email. This is required: Run test stays grayed out until you pick someone.
- Under Trigger fields, fill in any details the trigger would normally carry with it. This section depends on the trigger; the Points Earned trigger, for example, offers fields such as Points Amount. Fields you leave empty are simply left out of the run. A field that expects a number shows "Enter a valid number." if you type anything else. If the trigger has no fields, the dialog says "This trigger does not require additional fields."
- Click Run test. The button reads Running... while the run starts.
The dialog closes and Toki confirms with "Workflow test started". The run appears in the Recent Executions card on the right side of the page, usually as Running first, then Completed or Failed. Toki runs the workflow for the customer you picked and records it in the execution history like any other run, so you can open it and read what every step did (see below).
You can test a workflow while its status is Draft. Only Active workflows react to real events, so testing a draft is a good way to check it before you switch it on.
A good habit: test with a customer account you control, such as your own.
Where to find a workflow's runs
- Recent Executions card: open a workflow. The card sits on the right, below Workflow Details and Status, and lists the 5 most recent runs. Click View all to see the full history.
- Executions page: the full history for one workflow. Its title is Executions: followed by the workflow name, and it shows 20 runs per page. Use the arrows under the table to move between pages, and Workflows at the top to go back to your list.
- Workflows list: the Last Run column shows the date and time of each workflow's most recent run, or "-" if it hasn't run yet.
Both the card and the page refresh on their own every 10 seconds, so a run you just started shows up without reloading. A workflow that hasn't run yet shows "No executions yet" instead of the table.
Read the execution history
Each row is one run. Click a row to open its Execution Details page.
| Column | What it shows |
|---|---|
| Started At | The date and time the run started, in your device's time zone. |
| Trigger | The trigger that started the run, such as Points Earned. |
| Status | Running, Completed, or Failed. See the table below. |
| Duration | How long the run took, such as "3s" or "1m, 12s". A run that finished in under a second, or is still running, shows "Less than 1 minute". |
| User | The customer the workflow ran for, shown by email. Click it to open their member profile. |
| Error message | Why a Failed run stopped. Shows "-" for every other run. |
| Status | What it means |
|---|---|
| Running | The run is still going. A workflow with a Wait step stays Running until the wait is over and the remaining steps finish. Its Duration is filled in once the run is done. |
| Completed | Every step on the path the workflow took finished. |
| Failed | A step stopped the run. The error message tells you what happened, and the run's Execution Details page shows which step it was. |
Execution details
Open any run to see the Execution Details page. The status badge next to the title shows Running, Completed, or Failed. Click Back to return to the history.
On the left, you see a read-only picture of the workflow, so you can match each step to its place in the flow.
On the right, the Execution Summary card shows:
| Field | What it shows |
|---|---|
| Execution ID | The unique ID of this run. Share it with us when you'd like help with a specific run. |
| Trigger | The trigger that started the run. |
| Started at | When the run started. |
| Duration | How long the whole run took. Appears once the run has finished. |
If the run failed, the error message appears at the bottom of the summary.
Below the summary there is one card for each step that ran. Steps on a branch the workflow didn't take don't appear, so the list of cards tells you which path the run followed after a condition. Each card shows:
- Step followed by a short ID, and the step's status: Succeeded, Failed, or Processing.
- The name of the step, such as Points Earned, Send Email, or Credit Points.
- The time the step started.
Click Step data to expand the card:
| Section | What it shows |
|---|---|
| Input | The information the step started with, including values from earlier steps. |
| Output | The information the step passed on to the next step. |
| Result | The outcome of the step itself. |
| Error | Shown only when the step failed: the message explaining what stopped it. |
| Duration | How long the step took, in seconds. |
Input, Output, and Result are shown as raw data. You don't need to read them line by line: the status badge and the error message usually tell you enough, and the raw data is there when you chat with us about a run.
Restart a failed run
A Failed run has a Restart button at the top of its Execution Details page. Restart runs the workflow again for the same customer, with the same trigger and the same trigger details, and opens the new run's details page. The original run stays in the history as it was.
Restart works for workflows whose status is Active. If you fixed the workflow after the failed run, save it first, then restart.
Related
- Workflows: the Workflows page, the canvas, Draft and Active, saving and deleting.
- Timers: timers have their own Recent Executions card for scheduled runs.
- Member profile: where the User column takes you.