Integration / Apache NiFi Interview Questions
What is the ExecuteScript processor and what scripting languages does it support?
ExecuteScript is NiFi's escape hatch for custom logic that cannot be expressed with built-in processors. It allows you to write arbitrary script code that executes within the NiFi processor lifecycle — accessing incoming FlowFiles, creating new FlowFiles, modifying attributes, reading and writing content, and routing FlowFiles to relationships.
Supported scripting languages (via the Java Scripting Engine API):
- Groovy (most popular in NiFi community — expressive, JVM-native)
- Python (via Jython — Python 2.7 dialect; C extensions unavailable)
- ECMAScript / JavaScript (via Nashorn in Java 8, deprecated in Java 11+)
- Ruby (via JRuby)
- Lua
In Groovy, a typical ExecuteScript pattern looks like:
def flowFile = session.get()
if (!flowFile) return
flowFile = session.write(flowFile, { inputStream, outputStream ->
def text = inputStream.getText('UTF-8')
outputStream.write(text.toUpperCase().bytes)
} as StreamCallback)
session.transfer(flowFile, REL_SUCCESS)ExecuteScript has access to: session (ProcessSession), context (ProcessContext), log (ComponentLogger), and predefined relationship variables (REL_SUCCESS, REL_FAILURE). The script can use any Java library available on the NiFi classpath.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
