JustPaid Workflows
Blocks

Condition Block

Branch workflow execution paths based on boolean expressions

The Condition block evaluates a boolean expression and routes execution to one of two paths: true or false. Use it to branch workflows based on data values, thresholds, or the presence of specific fields.

Configuration

Expression

A JavaScript expression that evaluates to true or false. The expression has access to data from upstream blocks via template variables.

Examples:

// Amount threshold
{{input.data.object.amount_paid}} > 100000

// String comparison
{{steps.lookup.output.status}} === "active"

// Field existence
{{input.data.object.customer_email}} !== null

// Compound conditions
{{input.amount}} > 5000 && {{input.currency}} === "usd"

True Path / False Path

Each path connects to different downstream blocks. When the expression evaluates to true, only the true-path blocks execute. When false, only the false-path blocks execute.

Common Patterns

High-Value Invoice Approval

Stripe (invoice created) -> Condition (amount > $5,000?)
    -> True: Approval (manager review) -> QuickBooks (create invoice)
    -> False: QuickBooks (create invoice)

Customer Tier Routing

Webhook -> Condition (customer.plan === "enterprise"?)
    -> True: Slack (#enterprise-support)
    -> False: Email (standard notification)

Error Handling

Stripe (create charge) -> Condition (status === "succeeded"?)
    -> True: QuickBooks (record payment)
    -> False: Slack (alert finance) + Gmail (notify customer)

Outputs

The Condition block passes through the upstream data unchanged. It does not transform data -- it only controls which path executes.

OutputTypeDescription
resultbooleanThe evaluation result (true or false)

Best Practices

  • Keep expressions simple. For complex logic, use a Code block upstream to compute a boolean value, then use the Condition block to branch on it.

  • Handle both paths. Always define behavior for both true and false outcomes to avoid silent failures.

  • Use descriptive names. Name your condition blocks after the decision: "Amount over $5K?" is clearer than "Condition 1."

Frequently Asked Questions

On this page