Navigation

5-0 Error Handling in NiFi Flows

Many of the example flows presented in this cookbook have auto-terminated relationships that represent error conditions, such as "failure", "unmatched", etc. Here we demonstrate a few patterns for handling those errors.
Example 1: Log attributes and save content file

Download Template

Processors:

  • UpdateAttribute
    • Properties
      • error.condition: (Your message about this error condition.)
  • LogAttribute – write to nifi-app.log
    • Properties
      • Attributes to Log: filename, error.condition (, any other attributes that are relevant to your flow and/or error condition.)
  • PutFile – write error file to the file system
    • Properties
      • Directory: ./error-files (or wherever you want the files to go)
    • Settings
      • Automatically Terminate Relationships: failure, success