ExecuteScript

Description:

Experimental - Executes a script given the flow file and a process session. The script is responsible for handling the incoming flow file (transfer to SUCCESS or remove, e.g.) as well as any flow files created by the script. If the handling is incomplete or incorrect, the session will be rolled back. Experimental: Impact of sustained usage not yet verified.

Additional Details...

Tags:

script, execute, groovy, python, jython, jruby, ruby, javascript, js, lua, luaj, clojure

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Script EngineScript EngineECMAScript DEPRECATED
  • ECMAScript DEPRECATED ECMAScript ECMA - 262 Edition 5.1 [Oracle Nashorn 11.0.3]
Language Engine for executing scripts
Script FileScript FilePath to script file to execute. Only one of Script File or Script Body may be used

This property requires exactly one file to be provided..

Supports Expression Language: true (will be evaluated using variable registry only)
Script BodyScript BodyBody of script to execute. Only one of Script File or Script Body may be used
Module DirectoryModule DirectoryComma-separated list of paths to files and/or directories which contain modules required by the script.

This property expects a comma-separated list of resources. Each of the resources may be of any of the following types: directory, file.

Supports Expression Language: true (will be evaluated using variable registry only)

Dynamic Properties:

Supports Sensitive Dynamic Properties: Yes

Dynamic Properties allow the user to specify both the name and value of a property.

NameValueDescription
Script Engine Binding propertyBinding property value passed to Script RunnerUpdates a script engine property specified by the Dynamic Property's key with the value specified by the Dynamic Property's value
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)

Relationships:

NameDescription
successFlowFiles that were successfully processed
failureFlowFiles that failed to be processed

Reads Attributes:

None specified.

Writes Attributes:

None specified.

State management:

ScopeDescription
LOCAL, CLUSTERScripts can store and retrieve state using the State Management APIs. Consult the State Manager section of the Developer's Guide for more details.

Restricted:

Required PermissionExplanation
execute codeProvides operator the ability to execute arbitrary code assuming all permissions that NiFi has.

Input requirement:

This component allows an incoming relationship.

System Resource Considerations:

None specified.

See Also:

InvokeScriptedProcessor