Skip to content
LogoLogo

How to write a condition

This guide shows you how to build a rule in the visual condition builder. The builder appears on a condition node, on an experience condition, on an initialize-open condition, and on a field option.

Steps

  1. Choose the node or the field that takes the condition.
  2. Find the Logic section in the inspector.
  3. Choose a data source: Responses, Actions, Feature flags, Conditions, or Window Location.
  4. Choose an operator. The choices include equals, not equals, greater than, and contains.
  5. Enter a value.

Join more than one rule

  1. Create an AND group or an OR group.
  2. Add your rules inside it.

With AND every rule must match. With OR one rule must match. Put a group inside another group to build a larger rule.

Example

To show a step only to a visitor who is on one page and who accepted marketing:

  1. Create an AND group.
  2. Add a rule: Window Location → pathname equals /pricing.
  3. Add a rule: Responses → marketing_opt_in equals true.

The group matches only when both rules are true.

API and MCP

You can also do this task with the Management API, the MCP server, or code that you send to picked_run.

TaskGraphQLMCP toolRun
Write the rule of a condition nodeconditionUpdate, experienceFlowUpdateupdate_experience_flowtools.update_experience_flow({ experience_id, workspace_id, update_conditions })
Write the experience condition or the initialize-open conditionexperienceUpdate, experienceFlowUpdateupdate_experience_flowtools.update_experience_flow({ experience_id, workspace_id, condition, initialize_open })
Write the condition of a field optionfieldUpdate, experienceFlowUpdateupdate_experience_flowtools.update_experience_flow({ experience_id, workspace_id, update_fields })

The API and the MCP server take each rule as a JSON Logic expression.