You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Steps can be configured by setting their property values. Property values can be configured to map data from previous step events or by setting the values directly.
10
9
11
-
<Imageheight={600}img={workflowImg} />
10
+
All steps will have access to a context containing a list of all the steps, their events, and the event data. This behavior allows you to pass data around, transform, make decisions, etc.
11
+
12
+
## Context
13
+
14
+
Accessing data on this context is done like this: `{{step-name.event-name.property}}` where:
15
+
16
+
-`step-name` - The name you gave to a step.
17
+
-`event-name` - The name of the event for that given step that was fired.
18
+
-`property` - The property of the event data.
19
+
20
+
:::info
21
+
Context data are immutable and cannot be changed by any steps.
22
+
:::
23
+
24
+
## Dataflow
25
+
26
+
We will use a simple example of a workflow to demonstrate how data flows between steps:
27
+
28
+

29
+
30
+
The `ClickCounter` will keep track of how many times the user clicks a specified element. This step also exposes an `OnClick` event that will pass the counter to the next step.
31
+
32
+
This event data has the following schema:
33
+
34
+
```
35
+
{
36
+
Counter: integer
37
+
}
38
+
```
39
+
40
+
For the sake of showing how the Workflow builds the context, we will use 2 `ClickCounter` sequentially that will sent that data to a Webhook step.
41
+
42
+
### Single Execution
43
+
44
+
The following shows a data flow with the shape of the data being passed to each step when their events are fired:
This dataflow tells us that **ClickerA** then **ClickerB** was clicked. This was repeated two times.
88
+
89
+
Here we can see that the first try, the context that went to the webhook had `ClickerA.OnClick.Counter: 1`.
90
+
On the second set of clicks, the context for **ClickerA** has changed to `ClickerA.OnClick.Counter: 2` but **ClickerB** hasn't changed. This is because all executions of other steps are disposed of when the event is fired twice.
91
+
92
+
**ClickerA** was never disposed of, therefore the state changed and the context was updated.
93
+
**ClickerB** was disposed of when **ClickerA** was clicked, so the second pass was a brand new step, which is why the counter value is still **1**.
94
+
95
+
:::caution
96
+
When an event is fired multiple times, all previously executed steps will be disposed of in favor of executing new steps.
Workflows make it easy to run various actions that should happen for an experiment. Workflows are made up of one or more steps that can be executed by one or more trigger events.
11
8
12
-
<Imageheight={500}img={workflowImg} />
13
-
14
-
### Triggers
9
+
#### Triggers
15
10
16
11
Triggers are a a list of events that occurs in the application to start the workflow. For example, a trigger can be configured to fire when the user clicks on an element on a specific page. Please see [Triggers Overview documentation](./workflows/triggers) for more details.
17
12
18
-
### Steps
13
+
####Steps
19
14
20
15
Steps are a set of actions that are executed after a workflow is triggered. Please see [Steps Overview documentation](./steps)
16
+
17
+
### The stages of a Workflow
18
+
19
+
You can build your own experiments by composing a workflow whose complexity can range from a simple painted door to complex multi-variance test that collects a wide variety of quantitative and qualitative metrics.
20
+
21
+
The experiment below is configured to collect feedback when the checkout button is clicked on the checkout page.
22
+
23
+
The workflow can be configured so that if the user has either canceled or submit the feedback, the default order behavior will continue.
24
+
:::note
25
+
This will work for navigating away with anchor tags or form submissions.
26
+
:::
27
+
28
+

29
+
30
+
The workflow above contains 2 triggers that must match before the workflow begins executing the steps. The two triggers represents clicking a specific element while on a specified page.
31
+
32
+
The workflow contains 2 steps. A Microsurvey step that will complete the workflow if it is canceled or it will pass the collected data to a Webhook step. The webhook step will attempt to send this data to a url and will complete the workflow if the request failed or succeed.
0 commit comments