Support Questions

Find answers, ask questions, and share your expertise

NIFI ExecuteProcess linkage and Consolidated one Email notification

avatar
Contributor

41581-nifi-issues.png

41582-configuration.png

Hi All, I have a use case in NIFI.

I have 4 shell script which one I am willing to execute one by one. Like Script one Complete then Second Script and then 3rd Script and then 4th one. After 4th Script completion I willing to send the notification email.

I have created the workflow using the ExecuteProcess but not able to link all the ExecuteProcess, also when I am adding the putEmail its sending continues email to me but I need one email after 4th Script successful completion.

Issues : 1) How I can link one process to another

2) How I can send one email after 4th Process completion

Image having flow which i have created and configuration details

If anyone having template could you share pls

1 ACCEPTED SOLUTION

avatar
Master Guru

@Shakeel Ahmad

Use ExecuteStreamCommand processor instead of execute processor because execute processor won't allow any incoming connections but ExecuteStreamCommand processor accepts incoming connections.

Connect one output stream of ExecuteStreamCommand processor to another one so that the next ExecuteStreamCommand processor only triggers when first got completed after completing the 4th process keep put email notification.

ExecuteStream command configs:-

41610-esc.png

Flow:-

As i have added 2 ExecuteStreamCommand processors you need to add 4 of them then put email and to trigger first ExecuteStreamCommand processor use generateFlowFile processor and schedule that to run periodically.

41609-flow.png

Another way is

instead of using GenerateFlowFile processor to trigger the flow you can use execute process to trigger the flow, then connect the success relation to executestreamcommand processor.

Flow:-

Executeprocess(success)(1 script)-->ExecuteStreamCommand(output stream)(2 script)-->ExecuteStreamCommand(output stream)(3 script)-->ExecuteStreamCommand(output stream)(4 script)-->putEmail

41611-flow.png

As you want to trigger these scripts one by one so you can use either of the ways to put an Email after executing 4th script.

View solution in original post

3 REPLIES 3

avatar
Contributor

Hi All, can any one help me on that ?

avatar
Master Guru

@Shakeel Ahmad

Use ExecuteStreamCommand processor instead of execute processor because execute processor won't allow any incoming connections but ExecuteStreamCommand processor accepts incoming connections.

Connect one output stream of ExecuteStreamCommand processor to another one so that the next ExecuteStreamCommand processor only triggers when first got completed after completing the 4th process keep put email notification.

ExecuteStream command configs:-

41610-esc.png

Flow:-

As i have added 2 ExecuteStreamCommand processors you need to add 4 of them then put email and to trigger first ExecuteStreamCommand processor use generateFlowFile processor and schedule that to run periodically.

41609-flow.png

Another way is

instead of using GenerateFlowFile processor to trigger the flow you can use execute process to trigger the flow, then connect the success relation to executestreamcommand processor.

Flow:-

Executeprocess(success)(1 script)-->ExecuteStreamCommand(output stream)(2 script)-->ExecuteStreamCommand(output stream)(3 script)-->ExecuteStreamCommand(output stream)(4 script)-->putEmail

41611-flow.png

As you want to trigger these scripts one by one so you can use either of the ways to put an Email after executing 4th script.

avatar
Contributor

Thanks lot Shu, One more thing , is that possible to catch the output of the ExecuteStreenCommand and add that values in the PutEmail Body ? like in my 4th Script wanted to count the files and that files count i wanted to send through email