Ruby filter to execute code only once

Hi All

I have a scenario where I am using Ruby filter and I want to execute the code only once after reading the input. Basically after executing this code it should come out to output and should not process further

I tried Ruby 'init' which works perfectly well, but it works only when pipeline starts.

My pipeline will keep running on daily basis and input will have schedule that will read input data and execute the Ruby filter code only once and give it to output.

Example : I have 10 records from input
1 record from Ruby filter (hard coded record)

so 11 records in output

Is there any way I can Ruby filter once and exit?

Anyone has tips around it?

Thanks for reading my problem