Stop

Overview

The Stop action terminates the current workflow execution immediately. It allows you to exit workflows conditionally when certain criteria are met or when you want to halt execution without marking the workflow as failed.

circle-info

🛑 Purpose

Use Stop to:

  • Exit early when conditions are met

  • Skip unnecessary steps

  • Implement conditional workflows

  • Mark as passed when objective achieved

  • Prevent redundant steps


When to Use Stop

✅ Good Use Cases

Scenario
Reason

Early Success

Goal achieved, no need to continue

Conditional Skip

Requirements not met, skip remaining steps

Resource Limit

Stop before exceeding resource quota

Data Validation

Critical data missing, cannot proceed

Workflow Optimization

Skip redundant verification steps

Cleanup Prevention

Stop before cleanup runs

❌ Anti-Patterns (Don't Do)

  • ❌ Stop on temporary errors (use Retry instead)

  • ❌ Stop instead of proper error handling

  • ❌ Stop without logging reason

  • ❌ Frequent stops (indicates workflow design issue)

  • ❌ Stop to avoid assertions (defeats purpose)


Configuration

Basic Setup

  1. Open your workflow

  2. Click "Add Action" → Select "Stop"

  3. Configure stop settings:

    • Stop Reason: Brief description of why stopping

    • Status: Pass or Fail (how to mark workflow)

    • Condition (optional): When to stop

  4. Place in workflow at decision point

  5. Save

Configuration Options


Stop Status Options

Pass Status

Workflow ends successfully without error:

Example:

Fail Status

Workflow ends with failure:

Example:

Skip Status

Workflow ends without pass or fail:

Example:


Conditional Stop Examples

Example 1: Early Success Stop

Example 2: Missing Data Stop

Example 3: Environment-Based Stop

Example 4: Resource-Based Stop

Example 5: Data Validation Stop


Combining Stop with Other Actions

Stop + Condition

Standard conditional stop:

Stop + Cleanup

Run cleanup before stopping:

Stop + Log

Log reason before stopping:

Stop in Loop

Exit loop early:


Best Practices

✅ Do

  • Always include a reason - Explain why stopping in message

  • Use meaningful stop status - Pass/Fail/Skip appropriately

  • Log the reason - Help with debugging and analysis

  • Test both paths - Verify stop executes and normal flow works

  • Clean up first - Run cleanup before stopping if needed

  • Document the logic - Explain why stop might occur

  • Consider implications - How will stop affect overall test suite

❌ Don't

  • Use Stop for error handling - That's what error actions are for

  • Stop without reason - Always document why

  • Stop frequently - Indicates workflow design issue

  • Ignore resource cleanup - Run cleanup before stopping

  • Mark as Pass when should Fail - Use correct status

  • Skip logging - Important for troubleshooting

  • Duplicate Stop logic - Consolidate decisions


Performance Impact

Workflow Termination Timing

Resource Cleanup

Always clean up resources before stopping:


Troubleshooting

Issue: Stop condition not being reached

Symptoms:

  • Workflow runs all steps

  • Stop should have executed but didn't

Causes:

  • Condition never evaluates to true

  • Condition syntax error

  • Logic placed in wrong location

Solutions:

  1. Add logging before stop to verify condition

  2. Check condition syntax and logic

  3. Verify data values before condition

  4. Test condition independently

Issue: Resources not cleaned before stop

Symptoms:

  • Test data left behind

  • Resources allocated but not freed

Solutions:

  1. Add cleanup step before Stop

  2. Configure Stop to run cleanup

  3. Move cleanup to earlier in workflow

  4. Use separate cleanup workflow

Issue: Stop marked as wrong status

Symptoms:

  • Stop marked as FAIL should be PASS

  • Stop marked as PASS should be FAIL

Solutions:

  1. Review stop condition and status mapping

  2. Verify business logic

  3. Test all code paths

  4. Update documentation


Real-World Scenarios

E-Commerce: Feature Availability Check

API Testing: Version Compatibility

Reporting: Data Sufficiency



Summary

  • Stop terminates workflow execution immediately

  • Use for conditional exits when objective is met

  • Choose appropriate status - Pass/Fail/Skip based on context

  • Always document why stopping in message

  • Clean up resources before stopping

  • Test both execution paths - stop and normal flow


Next: Learn about Send Email Action for notifications.

Last updated