Skip to main content

What does this node do?

The Fail node stops workflow execution and displays a custom error message. Use it to validate data, enforce business rules, or gracefully handle error conditions. Common uses:
  • Validate required data
  • Enforce business rules
  • Handle expected errors
  • Provide clear error messages

Quick setup

1

Add a Conditional node

Check for the error condition
2

Write a clear error message

Explain what went wrong

Configuration

Required fields

error_message
string
required
The error message to display when the workflow fails.Tips for good error messages:
  • Explain what went wrong
  • Include relevant data values
  • Suggest how to fix it
Examples:
"No URL provided. Please enter a valid URL to scrape."

"Invalid API response: {{status}}. Check API credentials."

"Content too short ({{wordCount}} words). Minimum is 500 words."

Output

When triggered, the workflow stops and returns:
{
  "status": "failed",
  "error": {
    "message": "No URL provided. Please enter a valid URL.",
    "code": "VALIDATION_ERROR",
    "node": "Fail_0",
    "timestamp": "2024-01-15T10:30:00Z"
  }
}

Examples

Data validation

Validate required input: Error message:
"URL is required but was not provided. 
Please enter a valid URL to continue."

Business rule enforcement

Enforce minimum content length: Error message:
"Content is too short ({{wordCount}} words). 
Minimum required: 500 words. 
Please expand the content before publishing."

API error handling

Handle API failures: Error message:
"API request failed with status {{HTTP_0.status}}.
Response: {{HTTP_0.body.error}}
Please check your API credentials and try again."

Rate limit protection

Stop before hitting limits: Error message:
"API rate limit reached ({{usage}}/{{limit}} calls).
Please wait {{resetTime}} before running again."

Best practices

Write helpful error messages

Include context to help users fix the issue:
❌ "Error occurred"

✅ "Failed to scrape URL: {{url}}. 
   The page returned a 403 Forbidden error. 
   This usually means the site blocks automated requests.
   Try a different URL or add a delay between requests."

Include relevant values

Show the actual data that caused the failure:
"Score validation failed.
 Received: {{score}}
 Expected: >= 0 and <= 100
 Please check the scoring logic."

Fail early

Validate inputs at the beginning: Don’t process data only to fail at the end.

Use consistent error codes

Create a standard set of error codes:
CodeMeaning
VALIDATION_ERRORInput data is invalid
API_ERRORExternal API failed
AUTH_ERRORAuthentication failed
RATE_LIMITRate limit exceeded
DATA_MISSINGRequired data not found

Consider alternatives

Before using Fail, consider:
  • Conditional: Route to a different path instead
  • Default values: Use fallbacks for missing data
  • Retry logic: Try again for transient failures

Common patterns

Validation at start

Multiple validation checks

Graceful degradation

When NOT to use Fail

Don’t fail for expected cases

If “no data” is a valid outcome:
❌ Fail: "No results found"
✅ Conditional → Handle empty results gracefully

Don’t fail in loops

One bad item shouldn’t stop everything:
❌ Loop → Item fails → Entire workflow stops
✅ Loop → Item fails → Log error → Continue to next

Don’t fail without context

Always explain what went wrong:
❌ Fail: "Error"
✅ Fail: "Database connection failed after 3 retries. 
         Check database credentials in Settings → Integrations."