<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to update FlowFile attributes in Python now that Jython is removed? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-update-FlowFile-attributes-in-Python-now-that-Jython/m-p/412293#M253352</link>
    <description>&lt;P&gt;That approach is not feasible. Adopting a new programming language is impractical given the large number of existing Python scripts that I cannot realistically migrate. The second option is also suboptimal, since creating a dedicated NiFi processor for each script would introduce significant overhead. Furthermore, each custom processor would run in its own isolated virtual environment, leading to excessive heap consumption&lt;/P&gt;</description>
    <pubDate>Fri, 05 Sep 2025 12:36:21 GMT</pubDate>
    <dc:creator>Ghilani</dc:creator>
    <dc:date>2025-09-05T12:36:21Z</dc:date>
    <item>
      <title>How to update FlowFile attributes in Python now that Jython is removed?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-update-FlowFile-attributes-in-Python-now-that-Jython/m-p/412162#M253287</link>
      <description>&lt;P&gt;In NiFi 2.4 and above, the Jython engine is no longer available in &lt;STRONG&gt;ExecuteScript&lt;/STRONG&gt;.&lt;BR /&gt;Previously, I used scripts like this to read and update attributes:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;val = flowFile.getAttribute(&lt;SPAN class="hljs-string"&gt;'x'&lt;/SPAN&gt;)
flowFile = session.putAttribute(flowFile, &lt;SPAN class="hljs-string"&gt;'x'&lt;/SPAN&gt;, &lt;SPAN class="hljs-built_in"&gt;str&lt;/SPAN&gt;(&lt;SPAN class="hljs-built_in"&gt;int&lt;/SPAN&gt;(val) + &lt;SPAN class="hljs-number"&gt;10&lt;/SPAN&gt;))&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Now I want to do the same using &lt;STRONG&gt;Python&lt;/STRONG&gt; in NiFi 2.4+:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Read an attribute (e.g., x)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Compute a new value&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Write it back as an attribute (or a new one)&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Keep the original FlowFile content unchanged&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;What’s the recommended way in &lt;STRONG&gt;NiFi 2.4+&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;Any official docs, samples, or best practices for this scenario would be very helpful.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 10:22:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-update-FlowFile-attributes-in-Python-now-that-Jython/m-p/412162#M253287</guid>
      <dc:creator>Ghilani</dc:creator>
      <dc:date>2025-08-25T10:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to update FlowFile attributes in Python now that Jython is removed?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-update-FlowFile-attributes-in-Python-now-that-Jython/m-p/412291#M253350</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In NiFi 2.4 and above, the built-in Jython (Python 2 interpreter) for ExecuteScript has been removed, so the traditional approach using inline Python is no longer supported. There is, however, a modern and robust alternative using NiFi's first-class Python processor support for attribute manipulation, or using Groovy/Clojure in ExecuteScript, or simply leveraging UpdateAttribute for simple logic.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://nifi.apache.org/nifi-docs/python-developer-guide.html" target="_blank" rel="noopener"&gt;https://nifi.apache.org/nifi-docs/python-developer-guide.html&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://nifi.apache.org/components/org.apache.nifi.processors.script.ExecuteScript/" target="_blank" rel="noopener"&gt;https://nifi.apache.org/components/org.apache.nifi.processors.script.ExecuteScript/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2025 11:25:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-update-FlowFile-attributes-in-Python-now-that-Jython/m-p/412291#M253350</guid>
      <dc:creator>RAGHUY</dc:creator>
      <dc:date>2025-09-05T11:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to update FlowFile attributes in Python now that Jython is removed?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-update-FlowFile-attributes-in-Python-now-that-Jython/m-p/412293#M253352</link>
      <description>&lt;P&gt;That approach is not feasible. Adopting a new programming language is impractical given the large number of existing Python scripts that I cannot realistically migrate. The second option is also suboptimal, since creating a dedicated NiFi processor for each script would introduce significant overhead. Furthermore, each custom processor would run in its own isolated virtual environment, leading to excessive heap consumption&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2025 12:36:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-update-FlowFile-attributes-in-Python-now-that-Jython/m-p/412293#M253352</guid>
      <dc:creator>Ghilani</dc:creator>
      <dc:date>2025-09-05T12:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to update FlowFile attributes in Python now that Jython is removed?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-update-FlowFile-attributes-in-Python-now-that-Jython/m-p/412294#M253353</link>
      <description>&lt;P&gt;However, I was able to resolve this by leveraging ExecuteStreamCommand (ESC). Specifically, I used the Output Destination Attribute property to push the required attributes into it, which I can then process separately.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2025 12:39:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-update-FlowFile-attributes-in-Python-now-that-Jython/m-p/412294#M253353</guid>
      <dc:creator>Ghilani</dc:creator>
      <dc:date>2025-09-05T12:39:32Z</dc:date>
    </item>
  </channel>
</rss>

