Skip to main content
The Condition step is used to branch between different paths in your spell based on certain criteria. For example, imagine you are building a spell to screen job applicants based on their resume’s content. You may want to look for certain keywords, and can use the Condition step to create two paths: one for moving forward with the candidate, and another for rejecting them. Condition step with 2 paths

Options

The Condition step has a custom options panel. There are two high-level concepts:
  • Paths
  • Conditions
Paths represent different routes the spell can take if its conditions are met. Inside of each path is a condition which decides whether that path is executed. For example, in the image above, we’re defining two paths with a “contains” condition - if the resume contains “javascript” it will execute Path 1, and if it contains “python” it will execute Path 2. Note that multiple paths can be executed as long as their conditions are satisfied. If the resume contains both “javascript” and “python”, both paths will be executed. When a new path is created, a new connector will be created where you may attach later steps. Steps attached to a path will only execute if that path’s condition is met. Conditions are comprised of 3 parts:
  • First value
  • Condition operator
  • Second value
To create a valid condition, you’ll need to fill out all 3 parts. You can insert variables into any of these fields, and usually at least one of the value fields will use a variable. Below are the possible operators:

Outputs

The Condition step does not produce any outputs on its own; it only decides which paths should be executed. Steps placed after a Condition step can still use variables produced from steps before the Condition.

Behavior

When the Condition step runs, each condition is evaluated at the same time. Any conditions that are met will be marked as “passed”. Once all conditions have been evaluated, the step(s) after the passed conditions will be run. If the Condition step encounters an error, no further steps will be executed even if some conditions passed. This is done to prevent behavior where multiple paths are expected to always run together, but only one path successfully executed before another one errored.