Skip to main content

Blocks

Overview

Blocks define the targeting and logic of a flow. They’re also used to store state for each user in a flow that developers can access via the SDK to build experiences with.

Blocks are connected by paths that define how user will transition through the flow.

There are 3 types of blocks:

TypeDescription
Start blocks Start blockStart blocks define which users will enter a flow.
Step blocks Step blockStep blocks represent the state of an experience for a particular user (e.g. active: true) as the user progresses through the flow. Methods for accessing and updating the state are made available by Dopt’s SDK to build onboarding experiences in your application.
Finish blocks Finish blockA finish block sets all blocks in the flow to completed, effectively finishing the flow.

Start blocks

Start block

A start block defines which users will enter a flow. This enables you to target specific sets of users to enter specific flows.

A start block contains targeting rules., which is an expression that will evaluate user properties to determine if a user should qualify for the flow. For example, a targeting rule could be projects < 10 AND SKU == "Pro".

Step blocks

Step block

A step block is used to represent and store the state (e.g. active: true ) of a step of the flow.

A step block usually represents a single experience for users, like an embedded contextual tip or a welcome modal. For example, if you wanted to create a flow for an interactive walkthrough with 3 steps, then the flow would likely have 3 step blocks, one for each step.

Every step block has a unique ID (UID). The UID is the key that developers will use to access the block via the SDK.

Using step blocks in code to build experiences

Step blocks are the bridge between Dopt’s flow builder and using Dopt’s SDKs to build your experience in code.

More here →

Flow transitions

When a step block’s state is updated via the SDK, Dopt will automatically transition the flow state appropriately.

More here →

Step block states

A step block contains the following states. All states can be either true or false for a user in a flow.

Step statesDefinition
ActiveThe block has met all entry criteria so it can be shown to the user
StartedA user has seen this block and has not yet completed it
CompletedA user has seen and completed this block
StoppedA user has seen the block and will not progress to the following block
ExitedA user will not progress to any block in this flow

These states represent the entire lifecycle of a step that developers can use to build onboarding experiences with.

Finish blocks

Finish block

When a finish block is triggered all blocks in the flow are set to completed, effectively finishing the flow. This happens even if there are other branches in the flow that have not yet hit a finish block.

Once the flow is finished, the user will not re-enter the flow, even if they match the targeting rules.

You can have many finish blocks in a flow and many edges can flow into a single finish block.

You can reset the flow for a user via the API or the users page. Once reset, a user will be able to qualify for the flow again. More here →

Paths & transitions

Blocks are be connected to other blocks by paths. Paths define the logic of how Dopt will transition across blocks in a flow.

Path

How transition works

When a .complete() call from the SDK occurs on a step block:

  1. The step block’s state is updated to completed == true
  2. Dopt will automatically transition the state of the flow by updating all downstream step block’s states to active == true. This is in effect transitioning the flow to the next step.

An example transition

For a simple example, let’s say you have Step 1 → Step 2.

info

For more detailed dev-documentation on methods corresponding to an intent-based API for signaling state transitions of a block check out these docs!