Enabling Conditional

To enable conditional for a step:

  1. Click the step’s options menu (⋮)
  2. Click Add Conditional
  3. Enter a condition that determines whether the step should run

Conditional Expression

  • A JavaScript expression that evaluates to a boolean value
  • Must return true or false
  • Cannot contain async operations

Common Expressions

return input1.output.document_type === 'pdf';

return codeStep1.output.score > 0.8 && codeStep2.output.verified;

return codeStep1.output.results?.length > 0;

Invalid Expressions

  • Async operations
  • Function declarations
  • Complex logic blocks with if/else

Step Skip Handling

When a step is skipped due to a conditional evaluating to false, subsequent steps need to handle this gracefully when accessing the output of the skipped step.